gns3-server/gns3server/static/web-ui/main-XWFCXTXO.js
2026-07-09 08:40:05 +02:00

414 lines
3.5 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{a as li,b as pn,c as C4,d as de,e as ie,f as y4,g as Je,h as w4,i as M4,j as k4,k as T4,l as Ie,m as gt,n as nt,o as pc,p as Ne,q as bt,r as Fe,s as _e,t as $4,u as H4,v as DC,w as U4,x as eh}from"./chunk-764TLGKY.js";import{$ as G4,A as N4,B as vr,C as Ya,D as te,E as Ju,F as pk,G as ga,H as jr,I as F4,J as Wd,K as R4,L as Zi,M as ci,N as L4,O as V4,P as tr,Q as nr,R as B4,S as z4,T as j4,U as To,V as $r,W as qd,X as ki,Y as Qd,Z as zo,_ as di,a as It,b as wt,c as et,d as fi,e as MC,f as Gs,g as Mi,h as kC,i as Zu,j as Me,k as we,l as fd,m as TC,n as E4,o as D4,p as EC,q as P4,r as _t,s as I4,t as A4,u as Fo,v as At,w as vt,x as ko,y as Ws,z as O4}from"./chunk-NJCA2RVJ.js";import{$ as J,$a as O,$b as IO,$c as Uu,$d as zt,$e as wi,A as sr,Aa as Ia,Ab as Xt,Ac as VO,Ad as hC,Ae as dk,B as Qa,Ba as Zv,Bb as Kt,Bc as BO,Bd as n4,Be as SC,C as Kv,Ca as lr,Cb as Pe,Cc as rC,Ce as u4,D as Hn,Da as zu,Db as nn,Dc as aC,Dd as fC,De as wC,E as ai,Ea as m,Eb as Be,Ec as zO,Ee as mk,F as Ud,Fa as Xa,Fb as er,Fc as jO,Fe as hd,G as po,Ga as Oo,Gb as d,Gc as $u,Gd as Qu,Ge as h4,H as ok,Ha as sd,Hb as j,Hc as $O,Hd as i4,He as qo,I as rk,Ia as Si,Ib as ee,Ic as HO,Id as ud,Ie as f4,J as _O,Ja as ot,Jb as ui,Jc as js,Jd as Ft,Je as bp,K as vO,Ka as MO,Kb as eC,Kc as UO,Kd as gC,Ke as g4,L as Ao,La as oo,Lb as oc,Lc as Hu,Ld as Ue,Le as _4,M as CO,Ma as F,Mb as rc,Mc as GO,Md as o4,Me as lt,N as bO,Na as Ht,Nb as ac,Nc as fr,Nd as _C,Ne as Ku,O as gp,Oa as ft,Ob as Ui,Oc as sC,Od as Pt,Oe as ht,Pa as Ar,Pb as Fg,Pc as lC,Pd as rt,Pe as vn,Q as xO,Qb as fn,Qc as Cp,Qd as vC,Qe as v4,R as Yv,Ra as si,Rb as Bt,Rc as cr,Rd as gr,Re as dt,S as Dl,Sa as xe,Sb as dn,Sc as cC,Sd as Gn,T as _p,Ta as ju,Tb as zs,Tc as dC,Td as cc,Te as b4,Ua as kO,Ub as tC,Ud as Ye,Ue as Us,V as pi,Va as TO,Vb as nC,Vc as WO,Vd as r4,Ve as x4,W as Un,Wa as EO,Wb as en,Wc as Al,Wd as at,We as ia,X as tt,Xa as qt,Xb as jn,Xc as $s,Xd as _r,Xe as je,Y as Qi,Yb as na,Yc as Ka,Yd as Hs,Ye as mc,Z as yi,Za as A,Zb as PO,Zc as hi,Zd as a4,Ze as pe,_ as ad,_a as DO,_b as Rg,_c as cd,_d as s4,_e as W,a as K,aa as $t,ab as Hi,ac as lk,ad as qO,ae as Rt,af as S4,b as it,ba as cn,bb as Ae,bc as Jt,bd as QO,be as l4,bf as mn,c as uO,ca as ge,cb as Y,cc as sc,cd as XO,ce as c4,cf as Yu,d as Cs,da as f,db as Z,dc as AO,dd as KO,de as Xu,df as Oa,e as Ln,ea as yO,eb as C,ec as OO,ee as dc,f as Bs,fa as SO,fb as s,fc as le,fe as d4,g as So,ga as k,gb as l,gc as Nt,gd as dd,ge as CC,h as Dr,ha as T,hb as R,hc as NO,hd as YO,he as Vn,i as He,ia as ei,ib as vo,id as ZO,ie as Xe,j as an,ja as Ir,jb as wo,jc as U,jd as md,je as Dt,k as Hd,ka as Jo,kb as bs,kc as Q,kd as mC,ke as Aa,l as hO,la as Xi,lb as Le,lc as ld,ld as Mo,m as nc,ma as Pl,mb as Ve,mc as Ct,md as JO,me as bC,n as Lu,na as ve,nb as ro,nc as No,o as Vu,oa as Vi,ob as z,od as pd,p as Nn,pa as wO,pb as Wo,pc as iC,pe as xC,q as Bo,qa as ae,qb as g,qc as Yi,qd as e4,r as Ng,ra as ha,rb as Jv,rc as FO,s as fO,sa as bn,sb as v,sc as RO,sd as Gu,ta as Pi,tb as ii,tc as lc,td as Wu,u as Lt,ua as Zt,ub as on,uc as ck,ud as fa,v as Pr,va as Il,vb as Ki,vc as zr,vd as t4,w as ic,wa as Bu,wb as xn,wc as LO,wd as pC,we as m4,x as ik,xa as ak,xb as mt,xc as oC,xd as uC,xe as Gd,y as gO,ya as sk,yb as pt,yc as ne,yd as qu,ye as yC,z as qi,za as vp,zc as xs,ze as p4}from"./chunk-72DGZVTL.js";var B8=Cs((dJe,Fx)=>{(function(n,i,e){if(!n)return;for(var t={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},c,p=1;p<20;++p)t[111+p]="f"+p;for(p=0;p<=9;++p)t[p+96]=p.toString();function u(P,L,re){if(P.addEventListener){P.addEventListener(L,re,!1);return}P.attachEvent("on"+L,re)}function h(P){if(P.type=="keypress"){var L=String.fromCharCode(P.which);return P.shiftKey||(L=L.toLowerCase()),L}return t[P.which]?t[P.which]:o[P.which]?o[P.which]:String.fromCharCode(P.which).toLowerCase()}function _(P,L){return P.sort().join(",")===L.sort().join(",")}function S(P){var L=[];return P.shiftKey&&L.push("shift"),P.altKey&&L.push("alt"),P.ctrlKey&&L.push("ctrl"),P.metaKey&&L.push("meta"),L}function x(P){if(P.preventDefault){P.preventDefault();return}P.returnValue=!1}function b(P){if(P.stopPropagation){P.stopPropagation();return}P.cancelBubble=!0}function M(P){return P=="shift"||P=="ctrl"||P=="alt"||P=="meta"}function w(){if(!c){c={};for(var P in t)P>95&&P<112||t.hasOwnProperty(P)&&(c[t[P]]=P)}return c}function y(P,L,re){return re||(re=w()[P]?"keydown":"keypress"),re=="keypress"&&L.length&&(re="keydown"),re}function E(P){return P==="+"?["+"]:(P=P.replace(/\+{2}/g,"+plus"),P.split("+"))}function I(P,L){var re,oe,G,$=[];for(re=E(P),G=0;G<re.length;++G)oe=re[G],a[oe]&&(oe=a[oe]),L&&L!="keypress"&&r[oe]&&(oe=r[oe],$.push("shift")),M(oe)&&$.push(oe);return L=y(oe,$,L),{key:oe,modifiers:$,action:L}}function D(P,L){return P===null||P===i?!1:P===L?!0:D(P.parentNode,L)}function N(P){var L=this;if(P=P||i,!(L instanceof N))return new N(P);L.target=P,L._callbacks={},L._directMap={};var re={},oe,G=!1,$=!1,ue=!1;function be(ce){ce=ce||{};var ke=!1,ze;for(ze in re){if(ce[ze]){ke=!0;continue}re[ze]=0}ke||(ue=!1)}function me(ce,ke,ze,Ke,Qe,ye){var q,Oe,We=[],ct=ze.type;if(!L._callbacks[ce])return[];for(ct=="keyup"&&M(ce)&&(ke=[ce]),q=0;q<L._callbacks[ce].length;++q)if(Oe=L._callbacks[ce][q],!(!Ke&&Oe.seq&&re[Oe.seq]!=Oe.level)&&ct==Oe.action&&(ct=="keypress"&&!ze.metaKey&&!ze.ctrlKey||_(ke,Oe.modifiers))){var Tt=!Ke&&Oe.combo==Qe,Xn=Ke&&Oe.seq==Ke&&Oe.level==ye;(Tt||Xn)&&L._callbacks[ce].splice(q,1),We.push(Oe)}return We}function De(ce,ke,ze,Ke){L.stopCallback(ke,ke.target||ke.srcElement,ze,Ke)||ce(ke,ze)===!1&&(x(ke),b(ke))}L._handleKey=function(ce,ke,ze){var Ke=me(ce,ke,ze),Qe,ye={},q=0,Oe=!1;for(Qe=0;Qe<Ke.length;++Qe)Ke[Qe].seq&&(q=Math.max(q,Ke[Qe].level));for(Qe=0;Qe<Ke.length;++Qe){if(Ke[Qe].seq){if(Ke[Qe].level!=q)continue;Oe=!0,ye[Ke[Qe].seq]=1,De(Ke[Qe].callback,ze,Ke[Qe].combo,Ke[Qe].seq);continue}Oe||De(Ke[Qe].callback,ze,Ke[Qe].combo)}var We=ze.type=="keypress"&&$;ze.type==ue&&!M(ce)&&!We&&be(ye),$=Oe&&ze.type=="keydown"};function he(ce){typeof ce.which!="number"&&(ce.which=ce.keyCode);var ke=h(ce);if(ke){if(ce.type=="keyup"&&G===ke){G=!1;return}L.handleKey(ke,S(ce),ce)}}function B(){clearTimeout(oe),oe=setTimeout(be,1e3)}function X(ce,ke,ze,Ke){re[ce]=0;function Qe(ct){return function(){ue=ct,++re[ce],B()}}function ye(ct){De(ze,ct,ce),Ke!=="keyup"&&(G=h(ct)),setTimeout(be,10)}for(var q=0;q<ke.length;++q){var Oe=q+1===ke.length,We=Oe?ye:Qe(Ke||I(ke[q+1]).action);se(ke[q],We,Ke,ce,q)}}function se(ce,ke,ze,Ke,Qe){L._directMap[ce+":"+ze]=ke,ce=ce.replace(/\s+/g," ");var ye=ce.split(" "),q;if(ye.length>1){X(ce,ye,ke,ze);return}q=I(ce,ze),L._callbacks[q.key]=L._callbacks[q.key]||[],me(q.key,q.modifiers,{type:q.action},Ke,ce,Qe),L._callbacks[q.key][Ke?"unshift":"push"]({callback:ke,modifiers:q.modifiers,action:q.action,seq:Ke,level:Qe,combo:ce})}L._bindMultiple=function(ce,ke,ze){for(var Ke=0;Ke<ce.length;++Ke)se(ce[Ke],ke,ze)},u(P,"keypress",he),u(P,"keydown",he),u(P,"keyup",he)}N.prototype.bind=function(P,L,re){var oe=this;return P=P instanceof Array?P:[P],oe._bindMultiple.call(oe,P,L,re),oe},N.prototype.unbind=function(P,L){var re=this;return re.bind.call(re,P,function(){},L)},N.prototype.trigger=function(P,L){var re=this;return re._directMap[P+":"+L]&&re._directMap[P+":"+L]({},P),re},N.prototype.reset=function(){var P=this;return P._callbacks={},P._directMap={},P},N.prototype.stopCallback=function(P,L){var re=this;if((" "+L.className+" ").indexOf(" mousetrap ")>-1||D(L,re.target))return!1;if("composedPath"in P&&typeof P.composedPath=="function"){var oe=P.composedPath()[0];oe!==P.target&&(L=oe)}return L.tagName=="INPUT"||L.tagName=="SELECT"||L.tagName=="TEXTAREA"||L.isContentEditable},N.prototype.handleKey=function(){var P=this;return P._handleKey.apply(P,arguments)},N.addKeycodes=function(P){for(var L in P)P.hasOwnProperty(L)&&(t[L]=P[L]);c=null},N.init=function(){var P=N(i);for(var L in P)L.charAt(0)!=="_"&&(N[L]=(function(re){return function(){return P[re].apply(P,arguments)}})(L))},N.init(),n.Mousetrap=N,typeof Fx<"u"&&Fx.exports&&(Fx.exports=N),typeof define=="function"&&define.amd&&define(function(){return N})})(typeof window<"u"?window:null,typeof window<"u"?document:null)});var $L=Cs(wP=>{var jL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");wP.encode=function(n){if(0<=n&&n<jL.length)return jL[n];throw new TypeError("Must be between 0 and 63: "+n)};wP.decode=function(n){var i=65,e=90,t=97,o=122,r=48,a=57,c=43,p=47,u=26,h=52;return i<=n&&n<=e?n-i:t<=n&&n<=o?n-t+u:r<=n&&n<=a?n-r+h:n==c?62:n==p?63:-1}});var qL=Cs(kP=>{var HL=$L(),MP=5,UL=1<<MP,GL=UL-1,WL=UL;function Mce(n){return n<0?(-n<<1)+1:(n<<1)+0}function kce(n){var i=(n&1)===1,e=n>>1;return i?-e:e}kP.encode=function(i){var e="",t,o=Mce(i);do t=o&GL,o>>>=MP,o>0&&(t|=WL),e+=HL.encode(t);while(o>0);return e};kP.decode=function(i,e,t){var o=i.length,r=0,a=0,c,p;do{if(e>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(p=HL.decode(i.charCodeAt(e++)),p===-1)throw new Error("Invalid base64 digit: "+i.charAt(e-1));c=!!(p&WL),p&=GL,r=r+(p<<a),a+=MP}while(c);t.value=kce(r),t.rest=e}});var ey=Cs(ea=>{function Tce(n,i,e){if(i in n)return n[i];if(arguments.length===3)return e;throw new Error('"'+i+'" is a required argument.')}ea.getArg=Tce;var QL=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Ece=/^data:.+\,.+$/;function q0(n){var i=n.match(QL);return i?{scheme:i[1],auth:i[2],host:i[3],port:i[4],path:i[5]}:null}ea.urlParse=q0;function uf(n){var i="";return n.scheme&&(i+=n.scheme+":"),i+="//",n.auth&&(i+=n.auth+"@"),n.host&&(i+=n.host),n.port&&(i+=":"+n.port),n.path&&(i+=n.path),i}ea.urlGenerate=uf;var Dce=32;function Pce(n){var i=[];return function(e){for(var t=0;t<i.length;t++)if(i[t].input===e){var o=i[0];return i[0]=i[t],i[t]=o,i[0].result}var r=n(e);return i.unshift({input:e,result:r}),i.length>Dce&&i.pop(),r}}var TP=Pce(function(i){var e=i,t=q0(i);if(t){if(!t.path)return i;e=t.path}for(var o=ea.isAbsolute(e),r=[],a=0,c=0;;)if(a=c,c=e.indexOf("/",a),c===-1){r.push(e.slice(a));break}else for(r.push(e.slice(a,c));c<e.length&&e[c]==="/";)c++;for(var p,u=0,c=r.length-1;c>=0;c--)p=r[c],p==="."?r.splice(c,1):p===".."?u++:u>0&&(p===""?(r.splice(c+1,u),u=0):(r.splice(c,2),u--));return e=r.join("/"),e===""&&(e=o?"/":"."),t?(t.path=e,uf(t)):e});ea.normalize=TP;function XL(n,i){n===""&&(n="."),i===""&&(i=".");var e=q0(i),t=q0(n);if(t&&(n=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),uf(e);if(e||i.match(Ece))return i;if(t&&!t.host&&!t.path)return t.host=i,uf(t);var o=i.charAt(0)==="/"?i:TP(n.replace(/\/+$/,"")+"/"+i);return t?(t.path=o,uf(t)):o}ea.join=XL;ea.isAbsolute=function(n){return n.charAt(0)==="/"||QL.test(n)};function Ice(n,i){n===""&&(n="."),n=n.replace(/\/$/,"");for(var e=0;i.indexOf(n+"/")!==0;){var t=n.lastIndexOf("/");if(t<0||(n=n.slice(0,t),n.match(/^([^\/]+:\/)?\/*$/)))return i;++e}return Array(e+1).join("../")+i.substr(n.length+1)}ea.relative=Ice;var KL=(function(){var n=Object.create(null);return!("__proto__"in n)})();function YL(n){return n}function Ace(n){return ZL(n)?"$"+n:n}ea.toSetString=KL?YL:Ace;function Oce(n){return ZL(n)?n.slice(1):n}ea.fromSetString=KL?YL:Oce;function ZL(n){if(!n)return!1;var i=n.length;if(i<9||n.charCodeAt(i-1)!==95||n.charCodeAt(i-2)!==95||n.charCodeAt(i-3)!==111||n.charCodeAt(i-4)!==116||n.charCodeAt(i-5)!==111||n.charCodeAt(i-6)!==114||n.charCodeAt(i-7)!==112||n.charCodeAt(i-8)!==95||n.charCodeAt(i-9)!==95)return!1;for(var e=i-10;e>=0;e--)if(n.charCodeAt(e)!==36)return!1;return!0}function Nce(n,i,e){var t=Od(n.source,i.source);return t!==0||(t=n.originalLine-i.originalLine,t!==0)||(t=n.originalColumn-i.originalColumn,t!==0||e)||(t=n.generatedColumn-i.generatedColumn,t!==0)||(t=n.generatedLine-i.generatedLine,t!==0)?t:Od(n.name,i.name)}ea.compareByOriginalPositions=Nce;function Fce(n,i,e){var t;return t=n.originalLine-i.originalLine,t!==0||(t=n.originalColumn-i.originalColumn,t!==0||e)||(t=n.generatedColumn-i.generatedColumn,t!==0)||(t=n.generatedLine-i.generatedLine,t!==0)?t:Od(n.name,i.name)}ea.compareByOriginalPositionsNoSource=Fce;function Rce(n,i,e){var t=n.generatedLine-i.generatedLine;return t!==0||(t=n.generatedColumn-i.generatedColumn,t!==0||e)||(t=Od(n.source,i.source),t!==0)||(t=n.originalLine-i.originalLine,t!==0)||(t=n.originalColumn-i.originalColumn,t!==0)?t:Od(n.name,i.name)}ea.compareByGeneratedPositionsDeflated=Rce;function Lce(n,i,e){var t=n.generatedColumn-i.generatedColumn;return t!==0||e||(t=Od(n.source,i.source),t!==0)||(t=n.originalLine-i.originalLine,t!==0)||(t=n.originalColumn-i.originalColumn,t!==0)?t:Od(n.name,i.name)}ea.compareByGeneratedPositionsDeflatedNoLine=Lce;function Od(n,i){return n===i?0:n===null?1:i===null?-1:n>i?1:-1}function Vce(n,i){var e=n.generatedLine-i.generatedLine;return e!==0||(e=n.generatedColumn-i.generatedColumn,e!==0)||(e=Od(n.source,i.source),e!==0)||(e=n.originalLine-i.originalLine,e!==0)||(e=n.originalColumn-i.originalColumn,e!==0)?e:Od(n.name,i.name)}ea.compareByGeneratedPositionsInflated=Vce;function Bce(n){return JSON.parse(n.replace(/^\)]}'[^\n]*\n/,""))}ea.parseSourceMapInput=Bce;function zce(n,i,e){if(i=i||"",n&&(n[n.length-1]!=="/"&&i[0]!=="/"&&(n+="/"),i=n+i),e){var t=q0(e);if(!t)throw new Error("sourceMapURL could not be parsed");if(t.path){var o=t.path.lastIndexOf("/");o>=0&&(t.path=t.path.substring(0,o+1))}i=XL(uf(t),i)}return TP(i)}ea.computeSourceURL=zce});var e7=Cs(JL=>{var EP=ey(),DP=Object.prototype.hasOwnProperty,gu=typeof Map<"u";function Nd(){this._array=[],this._set=gu?new Map:Object.create(null)}Nd.fromArray=function(i,e){for(var t=new Nd,o=0,r=i.length;o<r;o++)t.add(i[o],e);return t};Nd.prototype.size=function(){return gu?this._set.size:Object.getOwnPropertyNames(this._set).length};Nd.prototype.add=function(i,e){var t=gu?i:EP.toSetString(i),o=gu?this.has(i):DP.call(this._set,t),r=this._array.length;(!o||e)&&this._array.push(i),o||(gu?this._set.set(i,r):this._set[t]=r)};Nd.prototype.has=function(i){if(gu)return this._set.has(i);var e=EP.toSetString(i);return DP.call(this._set,e)};Nd.prototype.indexOf=function(i){if(gu){var e=this._set.get(i);if(e>=0)return e}else{var t=EP.toSetString(i);if(DP.call(this._set,t))return this._set[t]}throw new Error('"'+i+'" is not in the set.')};Nd.prototype.at=function(i){if(i>=0&&i<this._array.length)return this._array[i];throw new Error("No element indexed by "+i)};Nd.prototype.toArray=function(){return this._array.slice()};JL.ArraySet=Nd});var i7=Cs(n7=>{var t7=ey();function jce(n,i){var e=n.generatedLine,t=i.generatedLine,o=n.generatedColumn,r=i.generatedColumn;return t>e||t==e&&r>=o||t7.compareByGeneratedPositionsInflated(n,i)<=0}function ty(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ty.prototype.unsortedForEach=function(i,e){this._array.forEach(i,e)};ty.prototype.add=function(i){jce(this._last,i)?(this._last=i,this._array.push(i)):(this._sorted=!1,this._array.push(i))};ty.prototype.toArray=function(){return this._sorted||(this._array.sort(t7.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};n7.MappingList=ty});var r7=Cs(o7=>{var Q0=qL(),ur=ey(),ny=e7().ArraySet,$ce=i7().MappingList;function Cl(n){n||(n={}),this._file=ur.getArg(n,"file",null),this._sourceRoot=ur.getArg(n,"sourceRoot",null),this._skipValidation=ur.getArg(n,"skipValidation",!1),this._ignoreInvalidMapping=ur.getArg(n,"ignoreInvalidMapping",!1),this._sources=new ny,this._names=new ny,this._mappings=new $ce,this._sourcesContents=null}Cl.prototype._version=3;Cl.fromSourceMap=function(i,e){var t=i.sourceRoot,o=new Cl(Object.assign(e||{},{file:i.file,sourceRoot:t}));return i.eachMapping(function(r){var a={generated:{line:r.generatedLine,column:r.generatedColumn}};r.source!=null&&(a.source=r.source,t!=null&&(a.source=ur.relative(t,a.source)),a.original={line:r.originalLine,column:r.originalColumn},r.name!=null&&(a.name=r.name)),o.addMapping(a)}),i.sources.forEach(function(r){var a=r;t!==null&&(a=ur.relative(t,r)),o._sources.has(a)||o._sources.add(a);var c=i.sourceContentFor(r);c!=null&&o.setSourceContent(r,c)}),o};Cl.prototype.addMapping=function(i){var e=ur.getArg(i,"generated"),t=ur.getArg(i,"original",null),o=ur.getArg(i,"source",null),r=ur.getArg(i,"name",null);!this._skipValidation&&this._validateMapping(e,t,o,r)===!1||(o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),r!=null&&(r=String(r),this._names.has(r)||this._names.add(r)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:t!=null&&t.line,originalColumn:t!=null&&t.column,source:o,name:r}))};Cl.prototype.setSourceContent=function(i,e){var t=i;this._sourceRoot!=null&&(t=ur.relative(this._sourceRoot,t)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ur.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[ur.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Cl.prototype.applySourceMap=function(i,e,t){var o=e;if(e==null){if(i.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=i.file}var r=this._sourceRoot;r!=null&&(o=ur.relative(r,o));var a=new ny,c=new ny;this._mappings.unsortedForEach(function(p){if(p.source===o&&p.originalLine!=null){var u=i.originalPositionFor({line:p.originalLine,column:p.originalColumn});u.source!=null&&(p.source=u.source,t!=null&&(p.source=ur.join(t,p.source)),r!=null&&(p.source=ur.relative(r,p.source)),p.originalLine=u.line,p.originalColumn=u.column,u.name!=null&&(p.name=u.name))}var h=p.source;h!=null&&!a.has(h)&&a.add(h);var _=p.name;_!=null&&!c.has(_)&&c.add(_)},this),this._sources=a,this._names=c,i.sources.forEach(function(p){var u=i.sourceContentFor(p);u!=null&&(t!=null&&(p=ur.join(t,p)),r!=null&&(p=ur.relative(r,p)),this.setSourceContent(p,u))},this)};Cl.prototype._validateMapping=function(i,e,t,o){if(e&&typeof e.line!="number"&&typeof e.column!="number"){var r="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(r),!1;throw new Error(r)}if(!(i&&"line"in i&&"column"in i&&i.line>0&&i.column>=0&&!e&&!t&&!o)){if(i&&"line"in i&&"column"in i&&e&&"line"in e&&"column"in e&&i.line>0&&i.column>=0&&e.line>0&&e.column>=0&&t)return;var r="Invalid mapping: "+JSON.stringify({generated:i,source:t,original:e,name:o});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(r),!1;throw new Error(r)}};Cl.prototype._serializeMappings=function(){for(var i=0,e=1,t=0,o=0,r=0,a=0,c="",p,u,h,_,S=this._mappings.toArray(),x=0,b=S.length;x<b;x++){if(u=S[x],p="",u.generatedLine!==e)for(i=0;u.generatedLine!==e;)p+=";",e++;else if(x>0){if(!ur.compareByGeneratedPositionsInflated(u,S[x-1]))continue;p+=","}p+=Q0.encode(u.generatedColumn-i),i=u.generatedColumn,u.source!=null&&(_=this._sources.indexOf(u.source),p+=Q0.encode(_-a),a=_,p+=Q0.encode(u.originalLine-1-o),o=u.originalLine-1,p+=Q0.encode(u.originalColumn-t),t=u.originalColumn,u.name!=null&&(h=this._names.indexOf(u.name),p+=Q0.encode(h-r),r=h)),c+=p}return c};Cl.prototype._generateSourcesContent=function(i,e){return i.map(function(t){if(!this._sourcesContents)return null;e!=null&&(t=ur.relative(e,t));var o=ur.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};Cl.prototype.toJSON=function(){var i={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(i.file=this._file),this._sourceRoot!=null&&(i.sourceRoot=this._sourceRoot),this._sourcesContents&&(i.sourcesContent=this._generateSourcesContent(i.sources,i.sourceRoot)),i};Cl.prototype.toString=function(){return JSON.stringify(this.toJSON())};o7.SourceMapGenerator=Cl});var GA=Cs((t9,ww)=>{(function(n){"use strict";let i="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp(`^${i}\\.${i}\\.${i}\\.${i}$`,"i"),threeOctet:new RegExp(`^${i}\\.${i}\\.${i}$`,"i"),twoOctet:new RegExp(`^${i}\\.${i}$`,"i"),longValue:new RegExp(`^${i}$`,"i")},t=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),r="%[0-9a-z]{1,}",a="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(r,"i"),native:new RegExp(`^(::)?(${a})?([0-9a-f]+)?(::)?(${r})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${i}\\.${i}\\.${i}\\.${i}(${r})?)$`,"i"),transitional:new RegExp(`^((?:${a})|(?:::)(?:${a})?)${i}\\.${i}\\.${i}\\.${i}(${r})?$`,"i")};function p(x,b){if(x.indexOf("::")!==x.lastIndexOf("::"))return null;let M=0,w=-1,y=(x.match(c.zoneIndex)||[])[0],E,I;for(y&&(y=y.substring(1),x=x.replace(/%.+$/,""));(w=x.indexOf(":",w+1))>=0;)M++;if(x.substr(0,2)==="::"&&M--,x.substr(-2,2)==="::"&&M--,M>b)return null;for(I=b-M,E=":";I--;)E+="0:";return x=x.replace("::",E),x[0]===":"&&(x=x.slice(1)),x[x.length-1]===":"&&(x=x.slice(0,-1)),b=(function(){let D=x.split(":"),N=[];for(let P=0;P<D.length;P++)N.push(parseInt(D[P],16));return N})(),{parts:b,zoneId:y}}function u(x,b,M,w){if(x.length!==b.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let y=0,E;for(;w>0;){if(E=M-w,E<0&&(E=0),x[y]>>E!==b[y]>>E)return!1;w-=M,y+=1}return!0}function h(x){if(o.test(x))return parseInt(x,16);if(x[0]==="0"&&!isNaN(parseInt(x[1],10))){if(t.test(x))return parseInt(x,8);throw new Error(`ipaddr: cannot parse ${x} as octal`)}return parseInt(x,10)}function _(x,b){for(;x.length<b;)x=`0${x}`;return x}let S={};S.IPv4=(function(){function x(b){if(b.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let M,w;for(M=0;M<b.length;M++)if(w=b[M],!(0<=w&&w<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=b}return x.prototype.SpecialRanges={unspecified:[[new x([0,0,0,0]),8]],broadcast:[[new x([255,255,255,255]),32]],multicast:[[new x([224,0,0,0]),4]],linkLocal:[[new x([169,254,0,0]),16]],loopback:[[new x([127,0,0,0]),8]],carrierGradeNat:[[new x([100,64,0,0]),10]],private:[[new x([10,0,0,0]),8],[new x([172,16,0,0]),12],[new x([192,168,0,0]),16]],reserved:[[new x([192,0,0,0]),24],[new x([192,0,2,0]),24],[new x([192,88,99,0]),24],[new x([198,18,0,0]),15],[new x([198,51,100,0]),24],[new x([203,0,113,0]),24],[new x([240,0,0,0]),4]],as112:[[new x([192,175,48,0]),24],[new x([192,31,196,0]),24]],amt:[[new x([192,52,193,0]),24]]},x.prototype.kind=function(){return"ipv4"},x.prototype.match=function(b,M){let w;if(M===void 0&&(w=b,b=w[0],M=w[1]),b.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return u(this.octets,b.octets,8,M)},x.prototype.prefixLengthFromSubnetMask=function(){let b=0,M=!1,w={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},y,E,I;for(y=3;y>=0;y-=1)if(E=this.octets[y],E in w){if(I=w[E],M&&I!==0)return null;I!==8&&(M=!0),b+=I}else return null;return 32-b},x.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},x.prototype.toByteArray=function(){return this.octets.slice(0)},x.prototype.toIPv4MappedAddress=function(){return S.IPv6.parse(`::ffff:${this.toString()}`)},x.prototype.toNormalizedString=function(){return this.toString()},x.prototype.toString=function(){return this.octets.join(".")},x})(),S.IPv4.broadcastAddressFromCIDR=function(x){try{let b=this.parseCIDR(x),M=b[0].toByteArray(),w=this.subnetMaskFromPrefixLength(b[1]).toByteArray(),y=[],E=0;for(;E<4;)y.push(parseInt(M[E],10)|parseInt(w[E],10)^255),E++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.isIPv4=function(x){return this.parser(x)!==null},S.IPv4.isValid=function(x){try{return new this(this.parser(x)),!0}catch{return!1}},S.IPv4.isValidCIDR=function(x){try{return this.parseCIDR(x),!0}catch{return!1}},S.IPv4.isValidFourPartDecimal=function(x){return!!(S.IPv4.isValid(x)&&x.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},S.IPv4.isValidCIDRFourPartDecimal=function(x){let b=x.match(/^(.+)\/(\d+)$/);return!S.IPv4.isValidCIDR(x)||!b?!1:S.IPv4.isValidFourPartDecimal(b[1])},S.IPv4.networkAddressFromCIDR=function(x){let b,M,w,y,E;try{for(b=this.parseCIDR(x),w=b[0].toByteArray(),E=this.subnetMaskFromPrefixLength(b[1]).toByteArray(),y=[],M=0;M<4;)y.push(parseInt(w[M],10)&parseInt(E[M],10)),M++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.parse=function(x){let b=this.parser(x);if(b===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(b)},S.IPv4.parseCIDR=function(x){let b;if(b=x.match(/^(.+)\/(\d+)$/)){let M=parseInt(b[2]);if(M>=0&&M<=32){let w=[this.parse(b[1]),M];return Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},S.IPv4.parser=function(x){let b,M,w;if(b=x.match(e.fourOctet))return(function(){let y=b.slice(1,6),E=[];for(let I=0;I<y.length;I++)M=y[I],E.push(h(M));return E})();if(b=x.match(e.longValue)){if(w=h(b[1]),w>4294967295||w<0)throw new Error("ipaddr: address outside defined range");return(function(){let y=[],E;for(E=0;E<=24;E+=8)y.push(w>>E&255);return y})().reverse()}else return(b=x.match(e.twoOctet))?(function(){let y=b.slice(1,4),E=[];if(w=h(y[1]),w>16777215||w<0)throw new Error("ipaddr: address outside defined range");return E.push(h(y[0])),E.push(w>>16&255),E.push(w>>8&255),E.push(w&255),E})():(b=x.match(e.threeOctet))?(function(){let y=b.slice(1,5),E=[];if(w=h(y[2]),w>65535||w<0)throw new Error("ipaddr: address outside defined range");return E.push(h(y[0])),E.push(h(y[1])),E.push(w>>8&255),E.push(w&255),E})():null},S.IPv4.subnetMaskFromPrefixLength=function(x){if(x=parseInt(x),x<0||x>32)throw new Error("ipaddr: invalid IPv4 prefix length");let b=[0,0,0,0],M=0,w=Math.floor(x/8);for(;M<w;)b[M]=255,M++;return w<4&&(b[w]=Math.pow(2,x%8)-1<<8-x%8),new this(b)},S.IPv6=(function(){function x(b,M){let w,y;if(b.length===16)for(this.parts=[],w=0;w<=14;w+=2)this.parts.push(b[w]<<8|b[w+1]);else if(b.length===8)this.parts=b;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(w=0;w<this.parts.length;w++)if(y=this.parts[w],!(0<=y&&y<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");M&&(this.zoneId=M)}return x.prototype.SpecialRanges={unspecified:[new x([0,0,0,0,0,0,0,0]),128],linkLocal:[new x([65152,0,0,0,0,0,0,0]),10],multicast:[new x([65280,0,0,0,0,0,0,0]),8],loopback:[new x([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new x([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new x([0,0,0,0,0,65535,0,0]),96],discard:[new x([256,0,0,0,0,0,0,0]),64],rfc6145:[new x([0,0,0,0,65535,0,0,0]),96],rfc6052:[new x([100,65435,0,0,0,0,0,0]),96],"6to4":[new x([8194,0,0,0,0,0,0,0]),16],teredo:[new x([8193,0,0,0,0,0,0,0]),32],benchmarking:[new x([8193,2,0,0,0,0,0,0]),48],amt:[new x([8193,3,0,0,0,0,0,0]),32],as112v6:[[new x([8193,4,274,0,0,0,0,0]),48],[new x([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new x([8193,16,0,0,0,0,0,0]),28],orchid2:[new x([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new x([8193,48,0,0,0,0,0,0]),28],reserved:[[new x([8193,0,0,0,0,0,0,0]),23],[new x([8193,3512,0,0,0,0,0,0]),32]]},x.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},x.prototype.kind=function(){return"ipv6"},x.prototype.match=function(b,M){let w;if(M===void 0&&(w=b,b=w[0],M=w[1]),b.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return u(this.parts,b.parts,16,M)},x.prototype.prefixLengthFromSubnetMask=function(){let b=0,M=!1,w={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},y,E;for(let I=7;I>=0;I-=1)if(y=this.parts[I],y in w){if(E=w[y],M&&E!==0)return null;E!==16&&(M=!0),b+=E}else return null;return 128-b},x.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},x.prototype.toByteArray=function(){let b,M=[],w=this.parts;for(let y=0;y<w.length;y++)b=w[y],M.push(b>>8),M.push(b&255);return M},x.prototype.toFixedLengthString=function(){let b=function(){let w=[];for(let y=0;y<this.parts.length;y++)w.push(_(this.parts[y].toString(16),4));return w}.call(this).join(":"),M="";return this.zoneId&&(M=`%${this.zoneId}`),b+M},x.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let b=this.parts.slice(-2),M=b[0],w=b[1];return new S.IPv4([M>>8,M&255,w>>8,w&255])},x.prototype.toNormalizedString=function(){let b=function(){let w=[];for(let y=0;y<this.parts.length;y++)w.push(this.parts[y].toString(16));return w}.call(this).join(":"),M="";return this.zoneId&&(M=`%${this.zoneId}`),b+M},x.prototype.toRFC5952String=function(){let b=/((^|:)(0(:|$)){2,})/g,M=this.toNormalizedString(),w=0,y=-1,E;for(;E=b.exec(M);)E[0].length>y&&(w=E.index,y=E[0].length);return y<0?M:`${M.substring(0,w)}::${M.substring(w+y)}`},x.prototype.toString=function(){return this.toRFC5952String()},x})(),S.IPv6.broadcastAddressFromCIDR=function(x){try{let b=this.parseCIDR(x),M=b[0].toByteArray(),w=this.subnetMaskFromPrefixLength(b[1]).toByteArray(),y=[],E=0;for(;E<16;)y.push(parseInt(M[E],10)|parseInt(w[E],10)^255),E++;return new this(y)}catch(b){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${b})`)}},S.IPv6.isIPv6=function(x){return this.parser(x)!==null},S.IPv6.isValid=function(x){if(typeof x=="string"&&x.indexOf(":")===-1)return!1;try{let b=this.parser(x);return new this(b.parts,b.zoneId),!0}catch{return!1}},S.IPv6.isValidCIDR=function(x){if(typeof x=="string"&&x.indexOf(":")===-1)return!1;try{return this.parseCIDR(x),!0}catch{return!1}},S.IPv6.networkAddressFromCIDR=function(x){let b,M,w,y,E;try{for(b=this.parseCIDR(x),w=b[0].toByteArray(),E=this.subnetMaskFromPrefixLength(b[1]).toByteArray(),y=[],M=0;M<16;)y.push(parseInt(w[M],10)&parseInt(E[M],10)),M++;return new this(y)}catch(I){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${I})`)}},S.IPv6.parse=function(x){let b=this.parser(x);if(b.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(b.parts,b.zoneId)},S.IPv6.parseCIDR=function(x){let b,M,w;if((M=x.match(/^(.+)\/(\d+)$/))&&(b=parseInt(M[2]),b>=0&&b<=128))return w=[this.parse(M[1]),b],Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},S.IPv6.parser=function(x){let b,M,w,y,E,I;if(w=x.match(c.deprecatedTransitional))return this.parser(`::ffff:${w[1]}`);if(c.native.test(x))return p(x,8);if((w=x.match(c.transitional))&&(I=w[6]||"",b=w[1],w[1].endsWith("::")||(b=b.slice(0,-1)),b=p(b+I,6),b.parts)){for(E=[parseInt(w[2]),parseInt(w[3]),parseInt(w[4]),parseInt(w[5])],M=0;M<E.length;M++)if(y=E[M],!(0<=y&&y<=255))return null;return b.parts.push(E[0]<<8|E[1]),b.parts.push(E[2]<<8|E[3]),{parts:b.parts,zoneId:b.zoneId}}return null},S.IPv6.subnetMaskFromPrefixLength=function(x){if(x=parseInt(x),x<0||x>128)throw new Error("ipaddr: invalid IPv6 prefix length");let b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M=0,w=Math.floor(x/8);for(;M<w;)b[M]=255,M++;return w<16&&(b[w]=Math.pow(2,x%8)-1<<8-x%8),new this(b)},S.fromByteArray=function(x){let b=x.length;if(b===4)return new S.IPv4(x);if(b===16)return new S.IPv6(x);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},S.isValid=function(x){return S.IPv6.isValid(x)||S.IPv4.isValid(x)},S.isValidCIDR=function(x){return S.IPv6.isValidCIDR(x)||S.IPv4.isValidCIDR(x)},S.parse=function(x){if(S.IPv6.isValid(x))return S.IPv6.parse(x);if(S.IPv4.isValid(x))return S.IPv4.parse(x);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},S.parseCIDR=function(x){try{return S.IPv6.parseCIDR(x)}catch{try{return S.IPv4.parseCIDR(x)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},S.process=function(x){let b=this.parse(x);return b.kind()==="ipv6"&&b.isIPv4MappedAddress()?b.toIPv4Address():b},S.subnetMatch=function(x,b,M){let w,y,E,I;M==null&&(M="unicast");for(y in b)if(Object.prototype.hasOwnProperty.call(b,y)){for(E=b[y],E[0]&&!(E[0]instanceof Array)&&(E=[E]),w=0;w<E.length;w++)if(I=E[w],x.kind()===I[0].kind()&&x.match.apply(x,I))return y}return M},typeof ww<"u"&&ww.exports?ww.exports=S:n.ipaddr=S})(t9)});var d9=Cs((l9,c9)=>{(function(n){if(typeof l9=="object")c9.exports=n();else if(typeof define=="function"&&define.amd)define(n);else{var i;try{i=window}catch{i=self}i.SparkMD5=n()}})(function(n){"use strict";var i=function(y,E){return y+E&4294967295},e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function t(y,E,I,D,N,P){return E=i(i(E,y),i(D,P)),i(E<<N|E>>>32-N,I)}function o(y,E){var I=y[0],D=y[1],N=y[2],P=y[3];I+=(D&N|~D&P)+E[0]-680876936|0,I=(I<<7|I>>>25)+D|0,P+=(I&D|~I&N)+E[1]-389564586|0,P=(P<<12|P>>>20)+I|0,N+=(P&I|~P&D)+E[2]+606105819|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&I)+E[3]-1044525330|0,D=(D<<22|D>>>10)+N|0,I+=(D&N|~D&P)+E[4]-176418897|0,I=(I<<7|I>>>25)+D|0,P+=(I&D|~I&N)+E[5]+1200080426|0,P=(P<<12|P>>>20)+I|0,N+=(P&I|~P&D)+E[6]-1473231341|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&I)+E[7]-45705983|0,D=(D<<22|D>>>10)+N|0,I+=(D&N|~D&P)+E[8]+1770035416|0,I=(I<<7|I>>>25)+D|0,P+=(I&D|~I&N)+E[9]-1958414417|0,P=(P<<12|P>>>20)+I|0,N+=(P&I|~P&D)+E[10]-42063|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&I)+E[11]-1990404162|0,D=(D<<22|D>>>10)+N|0,I+=(D&N|~D&P)+E[12]+1804603682|0,I=(I<<7|I>>>25)+D|0,P+=(I&D|~I&N)+E[13]-40341101|0,P=(P<<12|P>>>20)+I|0,N+=(P&I|~P&D)+E[14]-1502002290|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&I)+E[15]+1236535329|0,D=(D<<22|D>>>10)+N|0,I+=(D&P|N&~P)+E[1]-165796510|0,I=(I<<5|I>>>27)+D|0,P+=(I&N|D&~N)+E[6]-1069501632|0,P=(P<<9|P>>>23)+I|0,N+=(P&D|I&~D)+E[11]+643717713|0,N=(N<<14|N>>>18)+P|0,D+=(N&I|P&~I)+E[0]-373897302|0,D=(D<<20|D>>>12)+N|0,I+=(D&P|N&~P)+E[5]-701558691|0,I=(I<<5|I>>>27)+D|0,P+=(I&N|D&~N)+E[10]+38016083|0,P=(P<<9|P>>>23)+I|0,N+=(P&D|I&~D)+E[15]-660478335|0,N=(N<<14|N>>>18)+P|0,D+=(N&I|P&~I)+E[4]-405537848|0,D=(D<<20|D>>>12)+N|0,I+=(D&P|N&~P)+E[9]+568446438|0,I=(I<<5|I>>>27)+D|0,P+=(I&N|D&~N)+E[14]-1019803690|0,P=(P<<9|P>>>23)+I|0,N+=(P&D|I&~D)+E[3]-187363961|0,N=(N<<14|N>>>18)+P|0,D+=(N&I|P&~I)+E[8]+1163531501|0,D=(D<<20|D>>>12)+N|0,I+=(D&P|N&~P)+E[13]-1444681467|0,I=(I<<5|I>>>27)+D|0,P+=(I&N|D&~N)+E[2]-51403784|0,P=(P<<9|P>>>23)+I|0,N+=(P&D|I&~D)+E[7]+1735328473|0,N=(N<<14|N>>>18)+P|0,D+=(N&I|P&~I)+E[12]-1926607734|0,D=(D<<20|D>>>12)+N|0,I+=(D^N^P)+E[5]-378558|0,I=(I<<4|I>>>28)+D|0,P+=(I^D^N)+E[8]-2022574463|0,P=(P<<11|P>>>21)+I|0,N+=(P^I^D)+E[11]+1839030562|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^I)+E[14]-35309556|0,D=(D<<23|D>>>9)+N|0,I+=(D^N^P)+E[1]-1530992060|0,I=(I<<4|I>>>28)+D|0,P+=(I^D^N)+E[4]+1272893353|0,P=(P<<11|P>>>21)+I|0,N+=(P^I^D)+E[7]-155497632|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^I)+E[10]-1094730640|0,D=(D<<23|D>>>9)+N|0,I+=(D^N^P)+E[13]+681279174|0,I=(I<<4|I>>>28)+D|0,P+=(I^D^N)+E[0]-358537222|0,P=(P<<11|P>>>21)+I|0,N+=(P^I^D)+E[3]-722521979|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^I)+E[6]+76029189|0,D=(D<<23|D>>>9)+N|0,I+=(D^N^P)+E[9]-640364487|0,I=(I<<4|I>>>28)+D|0,P+=(I^D^N)+E[12]-421815835|0,P=(P<<11|P>>>21)+I|0,N+=(P^I^D)+E[15]+530742520|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^I)+E[2]-995338651|0,D=(D<<23|D>>>9)+N|0,I+=(N^(D|~P))+E[0]-198630844|0,I=(I<<6|I>>>26)+D|0,P+=(D^(I|~N))+E[7]+1126891415|0,P=(P<<10|P>>>22)+I|0,N+=(I^(P|~D))+E[14]-1416354905|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~I))+E[5]-57434055|0,D=(D<<21|D>>>11)+N|0,I+=(N^(D|~P))+E[12]+1700485571|0,I=(I<<6|I>>>26)+D|0,P+=(D^(I|~N))+E[3]-1894986606|0,P=(P<<10|P>>>22)+I|0,N+=(I^(P|~D))+E[10]-1051523|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~I))+E[1]-2054922799|0,D=(D<<21|D>>>11)+N|0,I+=(N^(D|~P))+E[8]+1873313359|0,I=(I<<6|I>>>26)+D|0,P+=(D^(I|~N))+E[15]-30611744|0,P=(P<<10|P>>>22)+I|0,N+=(I^(P|~D))+E[6]-1560198380|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~I))+E[13]+1309151649|0,D=(D<<21|D>>>11)+N|0,I+=(N^(D|~P))+E[4]-145523070|0,I=(I<<6|I>>>26)+D|0,P+=(D^(I|~N))+E[11]-1120210379|0,P=(P<<10|P>>>22)+I|0,N+=(I^(P|~D))+E[2]+718787259|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~I))+E[9]-343485551|0,D=(D<<21|D>>>11)+N|0,y[0]=I+y[0]|0,y[1]=D+y[1]|0,y[2]=N+y[2]|0,y[3]=P+y[3]|0}function r(y){var E=[],I;for(I=0;I<64;I+=4)E[I>>2]=y.charCodeAt(I)+(y.charCodeAt(I+1)<<8)+(y.charCodeAt(I+2)<<16)+(y.charCodeAt(I+3)<<24);return E}function a(y){var E=[],I;for(I=0;I<64;I+=4)E[I>>2]=y[I]+(y[I+1]<<8)+(y[I+2]<<16)+(y[I+3]<<24);return E}function c(y){var E=y.length,I=[1732584193,-271733879,-1732584194,271733878],D,N,P,L,re,oe;for(D=64;D<=E;D+=64)o(I,r(y.substring(D-64,D)));for(y=y.substring(D-64),N=y.length,P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],D=0;D<N;D+=1)P[D>>2]|=y.charCodeAt(D)<<(D%4<<3);if(P[D>>2]|=128<<(D%4<<3),D>55)for(o(I,P),D=0;D<16;D+=1)P[D]=0;return L=E*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),re=parseInt(L[2],16),oe=parseInt(L[1],16)||0,P[14]=re,P[15]=oe,o(I,P),I}function p(y){var E=y.length,I=[1732584193,-271733879,-1732584194,271733878],D,N,P,L,re,oe;for(D=64;D<=E;D+=64)o(I,a(y.subarray(D-64,D)));for(y=D-64<E?y.subarray(D-64):new Uint8Array(0),N=y.length,P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],D=0;D<N;D+=1)P[D>>2]|=y[D]<<(D%4<<3);if(P[D>>2]|=128<<(D%4<<3),D>55)for(o(I,P),D=0;D<16;D+=1)P[D]=0;return L=E*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),re=parseInt(L[2],16),oe=parseInt(L[1],16)||0,P[14]=re,P[15]=oe,o(I,P),I}function u(y){var E="",I;for(I=0;I<4;I+=1)E+=e[y>>I*8+4&15]+e[y>>I*8&15];return E}function h(y){var E;for(E=0;E<y.length;E+=1)y[E]=u(y[E]);return y.join("")}h(c("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(i=function(y,E){var I=(y&65535)+(E&65535),D=(y>>16)+(E>>16)+(I>>16);return D<<16|I&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function y(E,I){return E=E|0||0,E<0?Math.max(E+I,0):Math.min(E,I)}ArrayBuffer.prototype.slice=function(E,I){var D=this.byteLength,N=y(E,D),P=D,L,re,oe,G;return I!==n&&(P=y(I,D)),N>P?new ArrayBuffer(0):(L=P-N,re=new ArrayBuffer(L),oe=new Uint8Array(re),G=new Uint8Array(this,N,L),oe.set(G),re)}})();function _(y){return/[\u0080-\uFFFF]/.test(y)&&(y=unescape(encodeURIComponent(y))),y}function S(y,E){var I=y.length,D=new ArrayBuffer(I),N=new Uint8Array(D),P;for(P=0;P<I;P+=1)N[P]=y.charCodeAt(P);return E?N:D}function x(y){return String.fromCharCode.apply(null,new Uint8Array(y))}function b(y,E,I){var D=new Uint8Array(y.byteLength+E.byteLength);return D.set(new Uint8Array(y)),D.set(new Uint8Array(E),y.byteLength),I?D:D.buffer}function M(y){var E=[],I=y.length,D;for(D=0;D<I-1;D+=2)E.push(parseInt(y.substr(D,2),16));return String.fromCharCode.apply(String,E)}function w(){this.reset()}return w.prototype.append=function(y){return this.appendBinary(_(y)),this},w.prototype.appendBinary=function(y){this._buff+=y,this._length+=y.length;var E=this._buff.length,I;for(I=64;I<=E;I+=64)o(this._hash,r(this._buff.substring(I-64,I)));return this._buff=this._buff.substring(I-64),this},w.prototype.end=function(y){var E=this._buff,I=E.length,D,N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P;for(D=0;D<I;D+=1)N[D>>2]|=E.charCodeAt(D)<<(D%4<<3);return this._finish(N,I),P=h(this._hash),y&&(P=M(P)),this.reset(),P},w.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},w.prototype.setState=function(y){return this._buff=y.buff,this._length=y.length,this._hash=y.hash,this},w.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},w.prototype._finish=function(y,E){var I=E,D,N,P;if(y[I>>2]|=128<<(I%4<<3),I>55)for(o(this._hash,y),I=0;I<16;I+=1)y[I]=0;D=this._length*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(D[2],16),P=parseInt(D[1],16)||0,y[14]=N,y[15]=P,o(this._hash,y)},w.hash=function(y,E){return w.hashBinary(_(y),E)},w.hashBinary=function(y,E){var I=c(y),D=h(I);return E?M(D):D},w.ArrayBuffer=function(){this.reset()},w.ArrayBuffer.prototype.append=function(y){var E=b(this._buff.buffer,y,!0),I=E.length,D;for(this._length+=y.byteLength,D=64;D<=I;D+=64)o(this._hash,a(E.subarray(D-64,D)));return this._buff=D-64<I?new Uint8Array(E.buffer.slice(D-64)):new Uint8Array(0),this},w.ArrayBuffer.prototype.end=function(y){var E=this._buff,I=E.length,D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],N,P;for(N=0;N<I;N+=1)D[N>>2]|=E[N]<<(N%4<<3);return this._finish(D,I),P=h(this._hash),y&&(P=M(P)),this.reset(),P},w.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.ArrayBuffer.prototype.getState=function(){var y=w.prototype.getState.call(this);return y.buff=x(y.buff),y},w.ArrayBuffer.prototype.setState=function(y){return y.buff=S(y.buff,!0),w.prototype.setState.call(this,y)},w.ArrayBuffer.prototype.destroy=w.prototype.destroy,w.ArrayBuffer.prototype._finish=w.prototype._finish,w.ArrayBuffer.hash=function(y,E){var I=p(new Uint8Array(y)),D=h(I);return E?M(D):D},w})});var f9=Cs(QA=>{"use strict";(function(){var n=typeof QA<"u"&&QA||typeof define<"u"&&{}||this||window;typeof define<"u"&&define("save-svg-as-png",[],function(){return n}),n.default=n;var i="http://www.w3.org/2000/xmlns/",e="http://www.w3.org/1999/xhtml",t="http://www.w3.org/2000/svg",o='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp "&#160;">]>',r=/url\(["']?(.+?)["']?\)/,a={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},c=function($){return $ instanceof HTMLElement||$ instanceof SVGElement},p=function($){if(!c($))throw new Error("an HTMLElement or SVGElement is required; got "+$)},u=function($){return new Promise(function(ue,be){c($)?ue($):be(new Error("an HTMLElement or SVGElement is required; got "+$))})},h=function($){return $&&$.lastIndexOf("http",0)===0&&$.lastIndexOf(window.location.host)===-1},_=function($){var ue=Object.keys(a).filter(function(be){return $.indexOf("."+be)>0}).map(function(be){return a[be]});return ue?ue[0]:(console.error("Unknown font format for "+$+". Fonts may not be working correctly."),"application/octet-stream")},S=function($){for(var ue="",be=new Uint8Array($),me=0;me<be.byteLength;me++)ue+=String.fromCharCode(be[me]);return window.btoa(ue)},x=function($,ue,be){var me=$.viewBox&&$.viewBox.baseVal&&$.viewBox.baseVal[be]||ue.getAttribute(be)!==null&&!ue.getAttribute(be).match(/%$/)&&parseInt(ue.getAttribute(be))||$.getBoundingClientRect()[be]||parseInt(ue.style[be])||parseInt(window.getComputedStyle($).getPropertyValue(be));return typeof me>"u"||me===null||isNaN(parseFloat(me))?0:me},b=function($,ue,be,me){if($.tagName==="svg")return{width:be||x($,ue,"width"),height:me||x($,ue,"height")};if($.getBBox){var De=$.getBBox(),he=De.x,B=De.y,X=De.width,se=De.height;return{width:he+X,height:B+se}}},M=function($){return decodeURIComponent(encodeURIComponent($).replace(/%([0-9A-F]{2})/g,function(ue,be){var me=String.fromCharCode("0x"+be);return me==="%"?"%25":me}))},w=function($){for(var ue=window.atob($.split(",")[1]),be=$.split(",")[0].split(":")[1].split(";")[0],me=new ArrayBuffer(ue.length),De=new Uint8Array(me),he=0;he<ue.length;he++)De[he]=ue.charCodeAt(he);return new Blob([me],{type:be})},y=function($,ue){if(ue)try{return $.querySelector(ue)||$.parentNode&&$.parentNode.querySelector(ue)}catch(be){console.warn('Invalid CSS selector "'+ue+'"',be)}},E=function($,ue){var be=$.cssText.match(r),me=be&&be[1]||"";if(!(!me||me.match(/^data:/)||me==="about:blank")){var De=me.startsWith("../")?ue+"/../"+me:me.startsWith("./")?ue+"/."+me:me;return{text:$.cssText,format:_(De),url:De}}},I=function($){return Promise.all(Array.from($.querySelectorAll("image")).map(function(ue){var be=ue.getAttributeNS("http://www.w3.org/1999/xlink","href")||ue.getAttribute("href");return be?(h(be)&&(be+=(be.indexOf("?")===-1?"?":"&")+"t="+new Date().valueOf()),new Promise(function(me,De){var he=document.createElement("canvas"),B=new Image;B.crossOrigin="anonymous",B.src=be,B.onerror=function(){return De(new Error("Could not load "+be))},B.onload=function(){he.width=B.width,he.height=B.height,he.getContext("2d").drawImage(B,0,0),ue.setAttributeNS("http://www.w3.org/1999/xlink","href",he.toDataURL("image/png")),me(!0)}})):Promise.resolve(null)}))},D={},N=function($){return Promise.all($.map(function(ue){return new Promise(function(be,me){if(D[ue.url])return be(D[ue.url]);var De=new XMLHttpRequest;De.addEventListener("load",function(){var he=S(De.response),B=ue.text.replace(r,'url("data:'+ue.format+";base64,"+he+'")')+`
`;D[ue.url]=B,be(B)}),De.addEventListener("error",function(he){console.warn("Failed to load font from: "+ue.url,he),D[ue.url]=null,be(null)}),De.addEventListener("abort",function(he){console.warn("Aborted loading font from: "+ue.url,he),be(null)}),De.open("GET",ue.url),De.responseType="arraybuffer",De.send()})})).then(function(ue){return ue.filter(function(be){return be}).join("")})},P=null,L=function(){return P||(P=Array.from(document.styleSheets).map(function($){try{return{rules:$.cssRules,href:$.href}}catch(ue){return console.warn("Stylesheet could not be loaded: "+$.href,ue),{}}}))},re=function($,ue){var be=ue||{},me=be.selectorRemap,De=be.modifyStyle,he=be.modifyCss,B=be.fonts,X=be.excludeUnusedCss,se=he||function(Ke,Qe){var ye=me?me(Ke):Ke,q=De?De(Qe):Qe;return ye+"{"+q+`}
`},ce=[],ke=typeof B>"u",ze=B||[];return L().forEach(function(Ke){var Qe=Ke.rules,ye=Ke.href;Qe&&Array.from(Qe).forEach(function(q){if(typeof q.style<"u")if(y($,q.selectorText))ce.push(se(q.selectorText,q.style.cssText));else if(ke&&q.cssText.match(/^@font-face/)){var Oe=E(q,ye);Oe&&ze.push(Oe)}else X||ce.push(q.cssText)})}),N(ze).then(function(Ke){return ce.join(`
`)+Ke})},oe=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};n.prepareSvg=function(G,$,ue){p(G);var be=$||{},me=be.left,De=me===void 0?0:me,he=be.top,B=he===void 0?0:he,X=be.width,se=be.height,ce=be.scale,ke=ce===void 0?1:ce,ze=be.responsive,Ke=ze===void 0?!1:ze,Qe=be.excludeCss,ye=Qe===void 0?!1:Qe;return I(G).then(function(){var q=G.cloneNode(!0);q.style.backgroundColor=($||{}).backgroundColor||G.style.backgroundColor;var Oe=b(G,q,X,se),We=Oe.width,ct=Oe.height;if(G.tagName!=="svg")if(G.getBBox){q.getAttribute("transform")!=null&&q.setAttribute("transform",q.getAttribute("transform").replace(/translate\(.*?\)/,""));var Tt=document.createElementNS("http://www.w3.org/2000/svg","svg");Tt.appendChild(q),q=Tt}else{console.error("Attempted to render non-SVG element",G);return}if(q.setAttribute("version","1.1"),q.setAttribute("viewBox",[De,B,We,ct].join(" ")),q.getAttribute("xmlns")||q.setAttributeNS(i,"xmlns",t),q.getAttribute("xmlns:xlink")||q.setAttributeNS(i,"xmlns:xlink","http://www.w3.org/1999/xlink"),Ke?(q.removeAttribute("width"),q.removeAttribute("height"),q.setAttribute("preserveAspectRatio","xMinYMin meet")):(q.setAttribute("width",We*ke),q.setAttribute("height",ct*ke)),Array.from(q.querySelectorAll("foreignObject > *")).forEach(function(_o){_o.setAttributeNS(i,"xmlns",_o.tagName==="svg"?t:e)}),ye){var Xn=document.createElement("div");Xn.appendChild(q);var Io=Xn.innerHTML;if(typeof ue=="function")ue(Io,We,ct);else return{src:Io,width:We,height:ct}}else return re(G,$).then(function(_o){var Br=document.createElement("style");Br.setAttribute("type","text/css"),Br.innerHTML=`<![CDATA[
`+_o+`
]]>`;var Rn=document.createElement("defs");Rn.appendChild(Br),q.insertBefore(Rn,q.firstChild);var zd=document.createElement("div");zd.appendChild(q);var Ru=zd.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if(typeof ue=="function")ue(Ru,We,ct);else return{src:Ru,width:We,height:ct}})})},n.svgAsDataUri=function(G,$,ue){return p(G),n.prepareSvg(G,$).then(function(be){var me=be.src,De=be.width,he=be.height,B="data:image/svg+xml;base64,"+window.btoa(M(o+me));return typeof ue=="function"&&ue(B,De,he),B})},n.svgAsPngUri=function(G,$,ue){p(G);var be=$||{},me=be.encoderType,De=me===void 0?"image/png":me,he=be.encoderOptions,B=he===void 0?.8:he,X=be.canvg,se=function(ke){var ze=ke.src,Ke=ke.width,Qe=ke.height,ye=document.createElement("canvas"),q=ye.getContext("2d"),Oe=window.devicePixelRatio||1;ye.width=Ke*Oe,ye.height=Qe*Oe,ye.style.width=ye.width+"px",ye.style.height=ye.height+"px",q.setTransform(Oe,0,0,Oe,0,0),X?X(ye,ze):q.drawImage(ze,0,0);var We=void 0;try{We=ye.toDataURL(De,B)}catch(ct){if(typeof SecurityError<"u"&&ct instanceof SecurityError||ct.name==="SecurityError"){console.error("Rendered SVG images cannot be downloaded in this browser.");return}else throw ct}return typeof ue=="function"&&ue(We,ye.width,ye.height),Promise.resolve(We)};return X?n.prepareSvg(G,$).then(se):n.svgAsDataUri(G,$).then(function(ce){return new Promise(function(ke,ze){var Ke=new Image;Ke.onload=function(){return ke(se({src:Ke,width:Ke.width,height:Ke.height}))},Ke.onerror=function(){ze(`There was an error loading the data URI as an image on the following SVG
`+window.atob(ce.slice(26))+`Open the following link to see browser's diagnosis
`+ce)},Ke.src=ce})})},n.download=function(G,$,ue){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(w($),G);else{var be=document.createElement("a");if("download"in be){be.download=G,be.style.display="none",document.body.appendChild(be);try{var me=w($),De=URL.createObjectURL(me);be.href=De,be.onclick=function(){return requestAnimationFrame(function(){return URL.revokeObjectURL(De)})}}catch(he){console.error(he),console.warn("Error while getting object URL. Falling back to string URL."),be.href=$}be.click(),document.body.removeChild(be)}else ue&&ue.popup&&(ue.popup.document.title=G,ue.popup.location.replace($))}},n.saveSvg=function(G,$,ue){var be=oe();return u(G).then(function(me){return n.svgAsDataUri(me,ue||{})}).then(function(me){return n.download($,me,be)})},n.saveSvgAsPng=function(G,$,ue){var be=oe();return u(G).then(function(me){return n.svgAsPngUri(me,ue||{})}).then(function(me){return n.download($,me,be)})}})()});var eO=Cs((T2,JA)=>{(function(n,i){if(typeof T2=="object"&&typeof JA=="object")JA.exports=i();else if(typeof define=="function"&&define.amd)define([],i);else{var e=i();for(var t in e)(typeof T2=="object"?T2:n)[t]=e[t]}})(globalThis,()=>(()=>{"use strict";var n={4567:function(o,r,a){var c=this&&this.__decorate||function(w,y,E,I){var D,N=arguments.length,P=N<3?y:I===null?I=Object.getOwnPropertyDescriptor(y,E):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,y,E,I);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(y,E,P):D(y,E))||P);return N>3&&P&&Object.defineProperty(y,E,P),P},p=this&&this.__param||function(w,y){return function(E,I){y(E,I,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;let u=a(9042),h=a(9924),_=a(844),S=a(4725),x=a(2585),b=a(3656),M=r.AccessibilityManager=class extends _.Disposable{constructor(w,y,E,I){super(),this._terminal=w,this._coreBrowserService=E,this._renderService=I,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new h.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(D=>this._handleResize(D.rows))),this.register(this._terminal.onRender(D=>this._refreshRows(D.start,D.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(D=>this._handleChar(D))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(D=>this._handleTab(D))),this.register(this._terminal.onKey(D=>this._handleKey(D.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,b.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,_.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(w){for(let y=0;y<w;y++)this._handleChar(" ")}_handleChar(w){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){let E=this._terminal.buffer,I=E.lines.length.toString();for(let D=w;D<=y;D++){let N=E.lines.get(E.ydisp+D),P=[],L=N?.translateToString(!0,void 0,void 0,P)||"",re=(E.ydisp+D+1).toString(),oe=this._rowElements[D];oe&&(L.length===0?(oe.innerText="\xA0",this._rowColumns.set(oe,[0,1])):(oe.textContent=L,this._rowColumns.set(oe,P)),oe.setAttribute("aria-posinset",re),oe.setAttribute("aria-setsize",I))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){let E=w.target,I=this._rowElements[y===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==I)return;let D,N;if(y===0?(D=E,N=this._rowElements.pop(),this._rowContainer.removeChild(N)):(D=this._rowElements.shift(),N=E,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),N.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){let P=this._createAccessibilityTreeNode();this._rowElements.unshift(P),this._rowContainer.insertAdjacentElement("afterbegin",P)}else{let P=this._createAccessibilityTreeNode();this._rowElements.push(P),this._rowContainer.appendChild(P)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},E={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===E.node&&y.offset>E.offset)&&([y,E]=[E,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;let I=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(I)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:I,offset:I.textContent?.length??0}),!this._rowContainer.contains(E.node))return;let D=({node:L,offset:re})=>{let oe=L instanceof Text?L.parentNode:L,G=parseInt(oe?.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;let $=this._rowColumns.get(oe);if(!$)return console.warn("columns is null. Race condition?"),null;let ue=re<$.length?$[re]:$.slice(-1)[0]+1;return ue>=this._terminal.cols&&(++G,ue=0),{row:G,column:ue}},N=D(y),P=D(E);if(N&&P){if(N.row>P.row||N.row===P.row&&N.column>=P.column)throw new Error("invalid range");this._terminal.select(N.column,N.row,(P.row-N.row)*this._terminal.cols-N.column+P.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>w;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w<this._terminal.rows;w++)this._refreshRowDimensions(this._rowElements[w])}}_refreshRowDimensions(w){w.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=M=c([p(1,x.IInstantiationService),p(2,S.ICoreBrowserService),p(3,S.IRenderService)],M)},3614:(o,r)=>{function a(h){return h.replace(/\r?\n/g,"\r")}function c(h,_){return _?"\x1B[200~"+h+"\x1B[201~":h}function p(h,_,S,x){h=c(h=a(h),S.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(h,!0),_.value=""}function u(h,_,S){let x=S.getBoundingClientRect(),b=h.clientX-x.left-10,M=h.clientY-x.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${b}px`,_.style.top=`${M}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=c,r.copyHandler=function(h,_){h.clipboardData&&h.clipboardData.setData("text/plain",_.selectionText),h.preventDefault()},r.handlePasteEvent=function(h,_,S,x){h.stopPropagation(),h.clipboardData&&p(h.clipboardData.getData("text/plain"),_,S,x)},r.paste=p,r.moveTextAreaUnderMouseCursor=u,r.rightClickHandler=function(h,_,S,x,b){u(h,_,S),b&&x.rightClickSelect(h),_.value=x.selectionText,_.select()}},7239:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;let c=a(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(p,u,h){this._css.set(p,u,h)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,h){this._color.set(p,u,h)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,c,p,u){a.addEventListener(c,p,u);let h=!1;return{dispose:()=>{h||(h=!0,a.removeEventListener(c,p,u))}}}},3551:function(o,r,a){var c=this&&this.__decorate||function(M,w,y,E){var I,D=arguments.length,N=D<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,w,y,E);else for(var P=M.length-1;P>=0;P--)(I=M[P])&&(N=(D<3?I(N):D>3?I(w,y,N):I(w,y))||N);return D>3&&N&&Object.defineProperty(w,y,N),N},p=this&&this.__param||function(M,w){return function(y,E){w(y,E,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;let u=a(3656),h=a(8460),_=a(844),S=a(2585),x=a(4725),b=r.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(M,w,y,E,I){super(),this._element=M,this._mouseService=w,this._renderService=y,this._bufferService=E,this._linkProviderService=I,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new h.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new h.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(M){this._lastMouseEvent=M;let w=this._positionFromMouseEvent(M,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;let y=M.composedPath();for(let E=0;E<y.length;E++){let I=y[E];if(I.classList.contains("xterm"))break;if(I.classList.contains("xterm-hover"))return}this._lastBufferCell&&w.x===this._lastBufferCell.x&&w.y===this._lastBufferCell.y||(this._handleHover(w),this._lastBufferCell=w)}_handleHover(M){if(this._activeLine!==M.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(M,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,M)||(this._clearCurrentLink(),this._askForLink(M,!0))}_askForLink(M,w){this._activeProviderReplies&&w||(this._activeProviderReplies?.forEach(E=>{E?.forEach(I=>{I.link.dispose&&I.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=M.y);let y=!1;for(let[E,I]of this._linkProviderService.linkProviders.entries())w?this._activeProviderReplies?.get(E)&&(y=this._checkLinkProviderResult(E,M,y)):I.provideLinks(M.y,D=>{if(this._isMouseOut)return;let N=D?.map(P=>({link:P}));this._activeProviderReplies?.set(E,N),y=this._checkLinkProviderResult(E,M,y),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(M.y,this._activeProviderReplies)})}_removeIntersectingLinks(M,w){let y=new Set;for(let E=0;E<w.size;E++){let I=w.get(E);if(I)for(let D=0;D<I.length;D++){let N=I[D],P=N.link.range.start.y<M?0:N.link.range.start.x,L=N.link.range.end.y>M?this._bufferService.cols:N.link.range.end.x;for(let re=P;re<=L;re++){if(y.has(re)){I.splice(D--,1);break}y.add(re)}}}}_checkLinkProviderResult(M,w,y){if(!this._activeProviderReplies)return y;let E=this._activeProviderReplies.get(M),I=!1;for(let D=0;D<M;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(I=!0);if(!I&&E){let D=E.find(N=>this._linkAtPosition(N.link,w));D&&(y=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let D=0;D<this._activeProviderReplies.size;D++){let N=this._activeProviderReplies.get(D)?.find(P=>this._linkAtPosition(P.link,w));if(N){y=!0,this._handleNewLink(N);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(M){if(!this._currentLink)return;let w=this._positionFromMouseEvent(M,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(M,this._currentLink.link.text)}_clearCurrentLink(M,w){this._currentLink&&this._lastMouseEvent&&(!M||!w||this._currentLink.link.range.start.y>=M&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(M){if(!this._lastMouseEvent)return;let w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(M.link,w)&&(this._currentLink=M,this._currentLink.state={decorations:{underline:M.link.decorations===void 0||M.link.decorations.underline,pointerCursor:M.link.decorations===void 0||M.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,M.link,this._lastMouseEvent),M.link.decorations={},Object.defineProperties(M.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:y=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:y=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(M.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(y=>{if(!this._currentLink)return;let E=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,I=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=I&&(this._clearCurrentLink(E,I),this._lastMouseEvent)){let D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}})))}_linkHover(M,w,y){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&M.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(M,w){let y=M.range,E=this._bufferService.buffer.ydisp,I=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-E-1,y.end.x,y.end.y-E-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(I)}_linkLeave(M,w,y){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&M.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(M,w){let y=M.range.start.y*this._bufferService.cols+M.range.start.x,E=M.range.end.y*this._bufferService.cols+M.range.end.x,I=w.y*this._bufferService.cols+w.x;return y<=I&&I<=E}_positionFromMouseEvent(M,w,y){let E=y.getCoords(M,w,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(M,w,y,E,I){return{x1:M,y1:w,x2:y,y2:E,cols:this._bufferService.cols,fg:I}}};r.Linkifier=b=c([p(1,x.IMouseService),p(2,x.IRenderService),p(3,S.IBufferService),p(4,x.ILinkProviderService)],b)},9042:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,r,a){var c=this&&this.__decorate||function(x,b,M,w){var y,E=arguments.length,I=E<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(x,b,M,w);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(I=(E<3?y(I):E>3?y(b,M,I):y(b,M))||I);return E>3&&I&&Object.defineProperty(b,M,I),I},p=this&&this.__param||function(x,b){return function(M,w){b(M,w,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;let u=a(511),h=a(2585),_=r.OscLinkProvider=class{constructor(x,b,M){this._bufferService=x,this._optionsService=b,this._oscLinkService=M}provideLinks(x,b){let M=this._bufferService.buffer.lines.get(x-1);if(!M)return void b(void 0);let w=[],y=this._optionsService.rawOptions.linkHandler,E=new u.CellData,I=M.getTrimmedLength(),D=-1,N=-1,P=!1;for(let L=0;L<I;L++)if(N!==-1||M.hasContent(L)){if(M.loadCell(L,E),E.hasExtendedAttrs()&&E.extended.urlId){if(N===-1){N=L,D=E.extended.urlId;continue}P=E.extended.urlId!==D}else N!==-1&&(P=!0);if(P||N!==-1&&L===I-1){let re=this._oscLinkService.getLinkData(D)?.uri;if(re){let oe={start:{x:N+1,y:x},end:{x:L+(P||L!==I-1?0:1),y:x}},G=!1;if(!y?.allowNonHttpProtocols)try{let $=new URL(re);["http:","https:"].includes($.protocol)||(G=!0)}catch{G=!0}G||w.push({text:re,range:oe,activate:($,ue)=>y?y.activate($,ue,oe):S(0,ue),hover:($,ue)=>y?.hover?.($,ue,oe),leave:($,ue)=>y?.leave?.($,ue,oe)})}P=!1,E.hasExtendedAttrs()&&E.extended.urlId?(N=L,D=E.extended.urlId):(N=-1,D=-1)}}b(w)}};function S(x,b){if(confirm(`Do you want to navigate to ${b}?
WARNING: This link could potentially be dangerous`)){let M=window.open();if(M){try{M.opener=null}catch{}M.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=_=c([p(0,h.IBufferService),p(1,h.IOptionsService),p(2,h.IOscLinkService)],_)},6193:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,c,p){this._rowCount=p,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;let c=a(3614),p=a(3656),u=a(3551),h=a(9042),_=a(3730),S=a(1680),x=a(3107),b=a(5744),M=a(2950),w=a(1296),y=a(428),E=a(4269),I=a(5114),D=a(8934),N=a(3230),P=a(9312),L=a(4725),re=a(6731),oe=a(8055),G=a(8969),$=a(8460),ue=a(844),be=a(6114),me=a(8437),De=a(2584),he=a(7399),B=a(5941),X=a(9074),se=a(2585),ce=a(5435),ke=a(4567),ze=a(779);class Ke extends G.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ye={}){super(ye),this.browser=be,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new ue.MutableDisposable),this._onCursorMove=this.register(new $.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new $.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new $.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new $.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new $.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new $.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new $.EventEmitter),this._onBlur=this.register(new $.EventEmitter),this._onA11yCharEmitter=this.register(new $.EventEmitter),this._onA11yTabEmitter=this.register(new $.EventEmitter),this._onWillOpen=this.register(new $.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(X.DecorationService),this._instantiationService.setService(se.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ze.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((q,Oe)=>this.refresh(q,Oe))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(q=>this._reportWindowsOptions(q))),this.register(this._inputHandler.onColor(q=>this._handleColorEvent(q))),this.register((0,$.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,$.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(q=>this._afterResize(q.cols,q.rows))),this.register((0,ue.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(ye){if(this._themeService)for(let q of ye){let Oe,We="";switch(q.index){case 256:Oe="foreground",We="10";break;case 257:Oe="background",We="11";break;case 258:Oe="cursor",We="12";break;default:Oe="ansi",We="4;"+q.index}switch(q.type){case 0:let ct=oe.color.toColorRGB(Oe==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[Oe]);this.coreService.triggerDataEvent(`${De.C0.ESC}]${We};${(0,B.toRgbString)(ct)}${De.C1_ESCAPED.ST}`);break;case 1:if(Oe==="ansi")this._themeService.modifyColors(Tt=>Tt.ansi[q.index]=oe.channels.toColor(...q.color));else{let Tt=Oe;this._themeService.modifyColors(Xn=>Xn[Tt]=oe.channels.toColor(...q.color))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ye){ye?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ke.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ye){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(De.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(De.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let ye=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(ye);if(!q)return;let Oe=Math.min(this.buffer.x,this.cols-1),We=this._renderService.dimensions.css.cell.height,ct=q.getWidth(Oe),Tt=this._renderService.dimensions.css.cell.width*ct,Xn=this.buffer.y*this._renderService.dimensions.css.cell.height,Io=Oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Io+"px",this.textarea.style.top=Xn+"px",this.textarea.style.width=Tt+"px",this.textarea.style.height=We+"px",this.textarea.style.lineHeight=We+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",q=>{this.hasSelection()&&(0,c.copyHandler)(q,this._selectionService)}));let ye=q=>(0,c.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",ye)),this.register((0,p.addDisposableDomListener)(this.element,"paste",ye)),be.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",q=>{q.button===2&&(0,c.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",q=>{(0,c.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),be.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",q=>{q.button===1&&(0,c.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",ye=>this._keyUp(ye),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",ye=>this._keyDown(ye),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",ye=>this._keyPress(ye),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",ye=>this._compositionHelper.compositionupdate(ye))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,p.addDisposableDomListener)(this.textarea,"input",ye=>this._inputEvent(ye),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(ye){if(!ye)throw new Error("Terminal requires a parent element.");if(ye.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ye.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ye.appendChild(this.element);let q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",Oe=>this.updateCursorStyle(Oe))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",h.promptLabel),be.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(I.CoreBrowserService,this.textarea,ye.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",Oe=>this._handleTextAreaFocus(Oe))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(re.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(N.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(Oe=>this._onRender.fire(Oe))),this.onResize(Oe=>this._renderService.resize(Oe.cols,Oe.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(M.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(Oe=>this.scrollLines(Oe.amount,Oe.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(P.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(Oe=>this.scrollLines(Oe.amount,Oe.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(Oe=>this._renderService.handleSelectionChanged(Oe.start,Oe.end,Oe.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(Oe=>{this.textarea.value=Oe,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(Oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",Oe=>this._selectionService.handleMouseDown(Oe))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(ke.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",Oe=>this._handleScreenReaderModeOptionChange(Oe))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",Oe=>{!this._overviewRulerRenderer&&Oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let ye=this,q=this.element;function Oe(Tt){let Xn=ye._mouseService.getMouseReportCoords(Tt,ye.screenElement);if(!Xn)return!1;let Io,_o;switch(Tt.overrideType||Tt.type){case"mousemove":_o=32,Tt.buttons===void 0?(Io=3,Tt.button!==void 0&&(Io=Tt.button<3?Tt.button:3)):Io=1&Tt.buttons?0:4&Tt.buttons?1:2&Tt.buttons?2:3;break;case"mouseup":_o=0,Io=Tt.button<3?Tt.button:3;break;case"mousedown":_o=1,Io=Tt.button<3?Tt.button:3;break;case"wheel":if(ye._customWheelEventHandler&&ye._customWheelEventHandler(Tt)===!1||ye.viewport.getLinesScrolled(Tt)===0)return!1;_o=Tt.deltaY<0?0:1,Io=4;break;default:return!1}return!(_o===void 0||Io===void 0||Io>4)&&ye.coreMouseService.triggerMouseEvent({col:Xn.col,row:Xn.row,x:Xn.x,y:Xn.y,button:Io,action:_o,ctrl:Tt.ctrlKey,alt:Tt.altKey,shift:Tt.shiftKey})}let We={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ct={mouseup:Tt=>(Oe(Tt),Tt.buttons||(this._document.removeEventListener("mouseup",We.mouseup),We.mousedrag&&this._document.removeEventListener("mousemove",We.mousedrag)),this.cancel(Tt)),wheel:Tt=>(Oe(Tt),this.cancel(Tt,!0)),mousedrag:Tt=>{Tt.buttons&&Oe(Tt)},mousemove:Tt=>{Tt.buttons||Oe(Tt)}};this.register(this.coreMouseService.onProtocolChange(Tt=>{Tt?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Tt)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Tt?We.mousemove||(q.addEventListener("mousemove",ct.mousemove),We.mousemove=ct.mousemove):(q.removeEventListener("mousemove",We.mousemove),We.mousemove=null),16&Tt?We.wheel||(q.addEventListener("wheel",ct.wheel,{passive:!1}),We.wheel=ct.wheel):(q.removeEventListener("wheel",We.wheel),We.wheel=null),2&Tt?We.mouseup||(We.mouseup=ct.mouseup):(this._document.removeEventListener("mouseup",We.mouseup),We.mouseup=null),4&Tt?We.mousedrag||(We.mousedrag=ct.mousedrag):(this._document.removeEventListener("mousemove",We.mousedrag),We.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",Tt=>{if(Tt.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Tt))return Oe(Tt),We.mouseup&&this._document.addEventListener("mouseup",We.mouseup),We.mousedrag&&this._document.addEventListener("mousemove",We.mousedrag),this.cancel(Tt)})),this.register((0,p.addDisposableDomListener)(q,"wheel",Tt=>{if(!We.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Tt)===!1)return!1;if(!this.buffer.hasScrollback){let Xn=this.viewport.getLinesScrolled(Tt);if(Xn===0)return;let Io=De.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Tt.deltaY<0?"A":"B"),_o="";for(let Br=0;Br<Math.abs(Xn);Br++)_o+=Io;return this.coreService.triggerDataEvent(_o,!0),this.cancel(Tt,!0)}return this.viewport.handleWheel(Tt)?this.cancel(Tt):void 0}},{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",Tt=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Tt),this.cancel(Tt)},{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",Tt=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Tt)?void 0:this.cancel(Tt)},{passive:!1}))}refresh(ye,q){this._renderService?.refreshRows(ye,q)}updateCursorStyle(ye){this._selectionService?.shouldColumnSelect(ye)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ye,q,Oe=0){Oe===1?(super.scrollLines(ye,q,Oe),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(ye)}paste(ye){(0,c.paste)(ye,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ye){this._customKeyEventHandler=ye}attachCustomWheelEventHandler(ye){this._customWheelEventHandler=ye}registerLinkProvider(ye){return this._linkProviderService.registerLinkProvider(ye)}registerCharacterJoiner(ye){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let q=this._characterJoinerService.register(ye);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(ye){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ye)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ye){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ye)}registerDecoration(ye){return this._decorationService.registerDecoration(ye)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ye,q,Oe){this._selectionService.setSelection(ye,q,Oe)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(ye,q){this._selectionService?.selectLines(ye,q)}_keyDown(ye){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ye)===!1)return!1;let q=this.browser.isMac&&this.options.macOptionIsMeta&&ye.altKey;if(!q&&!this._compositionHelper.keydown(ye))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||ye.key!=="Dead"&&ye.key!=="AltGraph"||(this._unprocessedDeadKey=!0);let Oe=(0,he.evaluateKeyboardEvent)(ye,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ye),Oe.type===3||Oe.type===2){let We=this.rows-1;return this.scrollLines(Oe.type===2?-We:We),this.cancel(ye,!0)}return Oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ye)||(Oe.cancel&&this.cancel(ye,!0),!Oe.key||!!(ye.key&&!ye.ctrlKey&&!ye.altKey&&!ye.metaKey&&ye.key.length===1&&ye.key.charCodeAt(0)>=65&&ye.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Oe.key!==De.C0.ETX&&Oe.key!==De.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Oe.key,domEvent:ye}),this._showCursor(),this.coreService.triggerDataEvent(Oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||ye.altKey||ye.ctrlKey?this.cancel(ye,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ye,q){let Oe=ye.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||ye.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||ye.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?Oe:Oe&&(!q.keyCode||q.keyCode>47)}_keyUp(ye){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ye)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(ye)||this.focus(),this.updateCursorStyle(ye),this._keyPressHandled=!1)}_keyPress(ye){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ye)===!1)return!1;if(this.cancel(ye),ye.charCode)q=ye.charCode;else if(ye.which===null||ye.which===void 0)q=ye.keyCode;else{if(ye.which===0||ye.charCode===0)return!1;q=ye.which}return!(!q||(ye.altKey||ye.ctrlKey||ye.metaKey)&&!this._isThirdLevelShift(this.browser,ye)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:ye}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ye){if(ye.data&&ye.inputType==="insertText"&&(!ye.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let q=ye.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(ye),!0}return!1}resize(ye,q){ye!==this.cols||q!==this.rows?super.resize(ye,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ye,q){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let ye=1;ye<this.rows;ye++)this.buffer.lines.push(this.buffer.getBlankLine(me.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let ye=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=ye,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(De.C0.ESC+"[I"):this.coreService.triggerDataEvent(De.C0.ESC+"[O")}_reportWindowsOptions(ye){if(this._renderService)switch(ye){case ce.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let q=this._renderService.dimensions.css.canvas.width.toFixed(0),Oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${De.C0.ESC}[4;${Oe};${q}t`);break;case ce.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let We=this._renderService.dimensions.css.cell.width.toFixed(0),ct=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${De.C0.ESC}[6;${ct};${We}t`)}}cancel(ye,q){if(this.options.cancelEvents||q)return ye.preventDefault(),ye.stopPropagation(),!1}}r.Terminal=Ke},9924:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,p){this._rowCount=p,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;let u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){let h=u-this._lastRefreshMs,_=this._debounceThresholdMS-h;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(o,r,a){var c=this&&this.__decorate||function(M,w,y,E){var I,D=arguments.length,N=D<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,w,y,E);else for(var P=M.length-1;P>=0;P--)(I=M[P])&&(N=(D<3?I(N):D>3?I(w,y,N):I(w,y))||N);return D>3&&N&&Object.defineProperty(w,y,N),N},p=this&&this.__param||function(M,w){return function(y,E){w(y,E,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;let u=a(3656),h=a(4725),_=a(8460),S=a(844),x=a(2585),b=r.Viewport=class extends S.Disposable{constructor(M,w,y,E,I,D,N,P){super(),this._viewportElement=M,this._scrollArea=w,this._bufferService=y,this._optionsService=E,this._charSizeService=I,this._renderService=D,this._coreBrowserService=N,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(L=>this._renderDimensions=L)),this._handleThemeChange(P.colors),this.register(P.onChangeColors(L=>this._handleThemeChange(L))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(M){this._viewportElement.style.backgroundColor=M.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(M){if(M)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let M=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==M&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=M),this._refreshAnimationFrame=null}syncScrollArea(M=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(M);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(M)}_handleScroll(M){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let M=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(M*(this._smoothScrollState.target-this._smoothScrollState.origin)),M<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(M,w){let y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y<this._lastRecordedBufferHeight)||(M.cancelable&&M.preventDefault(),!1)}handleWheel(M){let w=this._getPixelsScrolled(M);return w!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+w:this._smoothScrollState.target+=w,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=w,this._bubbleScroll(M,w))}scrollLines(M){if(M!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let w=M*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+w,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:M,suppressScrollEvent:!1})}_getPixelsScrolled(M){if(M.deltaY===0||M.shiftKey)return 0;let w=this._applyScrollModifier(M.deltaY,M);return M.deltaMode===WheelEvent.DOM_DELTA_LINE?w*=this._currentRowHeight:M.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._currentRowHeight*this._bufferService.rows),w}getBufferElements(M,w){let y,E="",I=[],D=w??this._bufferService.buffer.lines.length,N=this._bufferService.buffer.lines;for(let P=M;P<D;P++){let L=N.get(P);if(!L)continue;let re=N.get(P+1)?.isWrapped;if(E+=L.translateToString(!re),!re||P===N.length-1){let oe=document.createElement("div");oe.textContent=E,I.push(oe),E.length>0&&(y=oe),E=""}}return{bufferElements:I,cursorElement:y}}getLinesScrolled(M){if(M.deltaY===0||M.shiftKey)return 0;let w=this._applyScrollModifier(M.deltaY,M);return M.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):M.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(M,w){let y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?M*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:M*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(M){this._lastTouchY=M.touches[0].pageY}handleTouchMove(M){let w=this._lastTouchY-M.touches[0].pageY;return this._lastTouchY=M.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(M,w))}};r.Viewport=b=c([p(2,x.IBufferService),p(3,x.IOptionsService),p(4,h.ICharSizeService),p(5,h.IRenderService),p(6,h.ICoreBrowserService),p(7,h.IThemeService)],b)},3107:function(o,r,a){var c=this&&this.__decorate||function(x,b,M,w){var y,E=arguments.length,I=E<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(x,b,M,w);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(I=(E<3?y(I):E>3?y(b,M,I):y(b,M))||I);return E>3&&I&&Object.defineProperty(b,M,I),I},p=this&&this.__param||function(x,b){return function(M,w){b(M,w,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;let u=a(4725),h=a(844),_=a(2585),S=r.BufferDecorationRenderer=class extends h.Disposable{constructor(x,b,M,w,y){super(),this._screenElement=x,this._bufferService=b,this._coreBrowserService=M,this._decorationService=w,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(E=>this._removeDecoration(E))),this.register((0,h.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){let b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",x?.options?.layer==="top"),b.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let M=x.options.x??0;return M&&M>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(x,b),b}_refreshStyle(x){let b=x.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let M=this._decorationElements.get(x);M||(M=this._createElement(x),x.element=M,this._decorationElements.set(x,M),this._container.appendChild(M),x.onDispose(()=>{this._decorationElements.delete(x),M.remove()})),M.style.top=b*this._renderService.dimensions.css.cell.height+"px",M.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(M)}}_refreshXPosition(x,b=x.element){if(!b)return;let M=x.options.x??0;(x.options.anchor||"left")==="right"?b.style.right=M?M*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=M?M*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){this._decorationElements.get(x)?.remove(),this._decorationElements.delete(x),x.dispose()}};r.BufferDecorationRenderer=S=c([p(1,_.IBufferService),p(2,u.ICoreBrowserService),p(3,_.IDecorationService),p(4,u.IRenderService)],S)},5871:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(let c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,p){return c>=a.startBufferLine-this._linePadding[p||"full"]&&c<=a.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(o,r,a){var c=this&&this.__decorate||function(y,E,I,D){var N,P=arguments.length,L=P<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,I):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,E,I,D);else for(var re=y.length-1;re>=0;re--)(N=y[re])&&(L=(P<3?N(L):P>3?N(E,I,L):N(E,I))||L);return P>3&&L&&Object.defineProperty(E,I,L),L},p=this&&this.__param||function(y,E){return function(I,D){E(I,D,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;let u=a(5871),h=a(4725),_=a(844),S=a(2585),x={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},M={full:0,left:0,center:0,right:0},w=r.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,I,D,N,P,L){super(),this._viewportElement=y,this._screenElement=E,this._bufferService=I,this._decorationService=D,this._renderService=N,this._optionsService=P,this._coreBrowserService=L,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let re=this._canvas.getContext("2d");if(!re)throw new Error("Ctx cannot be null");this._ctx=re,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)(()=>{this._canvas?.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){let y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=E,b.right=y,this._refreshDrawHeightConstants(),M.full=0,M.left=0,M.center=b.left,M.right=b.left+b.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);let y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);x.left=E,x.center=E,x.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;let y=this._colorZoneStore.zones;for(let E of y)E.position!=="full"&&this._renderColorZone(E);for(let E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(M[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-x[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=w=c([p(2,S.IBufferService),p(3,S.IDecorationService),p(4,h.IRenderService),p(5,S.IOptionsService),p(6,h.ICoreBrowserService)],w)},2950:function(o,r,a){var c=this&&this.__decorate||function(x,b,M,w){var y,E=arguments.length,I=E<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(x,b,M,w);else for(var D=x.length-1;D>=0;D--)(y=x[D])&&(I=(E<3?y(I):E>3?y(b,M,I):y(b,M))||I);return E>3&&I&&Object.defineProperty(b,M,I),I},p=this&&this.__param||function(x,b){return function(M,w){b(M,w,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;let u=a(4725),h=a(2585),_=a(2584),S=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,b,M,w,y,E){this._textarea=x,this._compositionView=b,this._bufferService=M,this._optionsService=w,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){let b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let M;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,M=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),M.length>0&&this._coreService.triggerDataEvent(M,!0)}},0)}else{this._isSendingComposition=!1;let b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){let x=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let b=this._textarea.value,M=b.replace(x,"");this._dataAlreadySent=M,b.length>x.length?this._coreService.triggerDataEvent(M,!0):b.length<x.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):b.length===x.length&&b!==x&&this._coreService.triggerDataEvent(b,!0)}},0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),M=this._renderService.dimensions.css.cell.height,w=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=w+"px",this._compositionView.style.height=M+"px",this._compositionView.style.lineHeight=M+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=w+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}x||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=S=c([p(2,h.IBufferService),p(3,h.IOptionsService),p(4,h.ICoreService),p(5,u.IRenderService)],S)},9806:(o,r)=>{function a(c,p,u){let h=u.getBoundingClientRect(),_=c.getComputedStyle(u),S=parseInt(_.getPropertyValue("padding-left")),x=parseInt(_.getPropertyValue("padding-top"));return[p.clientX-h.left-S,p.clientY-h.top-x]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=a,r.getCoords=function(c,p,u,h,_,S,x,b,M){if(!S)return;let w=a(c,p,u);return w?(w[0]=Math.ceil((w[0]+(M?x/2:0))/x),w[1]=Math.ceil(w[1]/b),w[0]=Math.min(Math.max(w[0],1),h+(M?1:0)),w[1]=Math.min(Math.max(w[1],1),_),w):void 0}},9504:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;let c=a(2584);function p(b,M,w,y){let E=b-u(b,w),I=M-u(M,w),D=Math.abs(E-I)-(function(N,P,L){let re=0,oe=N-u(N,L),G=P-u(P,L);for(let $=0;$<Math.abs(oe-G);$++){let ue=h(N,P)==="A"?-1:1;L.buffer.lines.get(oe+ue*$)?.isWrapped&&re++}return re})(b,M,w);return x(D,S(h(b,M),y))}function u(b,M){let w=0,y=M.buffer.lines.get(b),E=y?.isWrapped;for(;E&&b>=0&&b<M.rows;)w++,y=M.buffer.lines.get(--b),E=y?.isWrapped;return w}function h(b,M){return b>M?"A":"B"}function _(b,M,w,y,E,I){let D=b,N=M,P="";for(;D!==w||N!==y;)D+=E?1:-1,E&&D>I.cols-1?(P+=I.buffer.translateBufferLineToString(N,!1,b,D),D=0,b=0,N++):!E&&D<0&&(P+=I.buffer.translateBufferLineToString(N,!1,0,b+1),D=I.cols-1,b=D,N--);return P+I.buffer.translateBufferLineToString(N,!1,b,D)}function S(b,M){let w=M?"O":"[";return c.C0.ESC+w+b}function x(b,M){b=Math.floor(b);let w="";for(let y=0;y<b;y++)w+=M;return w}r.moveToCellSequence=function(b,M,w,y){let E=w.buffer.x,I=w.buffer.y;if(!w.buffer.hasScrollback)return(function(P,L,re,oe,G,$){return p(L,oe,G,$).length===0?"":x(_(P,L,P,L-u(L,G),!1,G).length,S("D",$))})(E,I,0,M,w,y)+p(I,M,w,y)+(function(P,L,re,oe,G,$){let ue;ue=p(L,oe,G,$).length>0?oe-u(oe,G):L;let be=oe,me=(function(De,he,B,X,se,ce){let ke;return ke=p(B,X,se,ce).length>0?X-u(X,se):he,De<B&&ke<=X||De>=B&&ke<X?"C":"D"})(P,L,re,oe,G,$);return x(_(P,ue,re,be,me==="C",G).length,S(me,$))})(E,I,b,M,w,y);let D;if(I===M)return D=E>b?"D":"C",x(Math.abs(E-b),S(D,y));D=I>M?"D":"C";let N=Math.abs(I-M);return x((function(P,L){return L.cols-P})(I>M?b:E,w)+(N-1)*w.cols+1+((I>M?E:b)-1),S(D,y))}},1296:function(o,r,a){var c=this&&this.__decorate||function($,ue,be,me){var De,he=arguments.length,B=he<3?ue:me===null?me=Object.getOwnPropertyDescriptor(ue,be):me;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate($,ue,be,me);else for(var X=$.length-1;X>=0;X--)(De=$[X])&&(B=(he<3?De(B):he>3?De(ue,be,B):De(ue,be))||B);return he>3&&B&&Object.defineProperty(ue,be,B),B},p=this&&this.__param||function($,ue){return function(be,me){ue(be,me,$)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;let u=a(3787),h=a(2550),_=a(2223),S=a(6171),x=a(6052),b=a(4725),M=a(8055),w=a(8460),y=a(844),E=a(2585),I="xterm-dom-renderer-owner-",D="xterm-rows",N="xterm-fg-",P="xterm-bg-",L="xterm-focus",re="xterm-selection",oe=1,G=r.DomRenderer=class extends y.Disposable{constructor($,ue,be,me,De,he,B,X,se,ce,ke,ze,Ke){super(),this._terminal=$,this._document=ue,this._element=be,this._screenElement=me,this._viewportElement=De,this._helperContainer=he,this._linkifier2=B,this._charSizeService=se,this._optionsService=ce,this._bufferService=ke,this._coreBrowserService=ze,this._themeService=Ke,this._terminalClass=oe++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(re),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Qe=>this._injectCss(Qe))),this._injectCss(this._themeService.colors),this._rowFactory=X.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(I+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Qe=>this._handleLinkHover(Qe))),this.register(this._linkifier2.onHideLinkUnderline(Qe=>this._handleLinkLeave(Qe))),this.register((0,y.toDisposable)(()=>{this._element.classList.remove(I+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new h.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let $=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*$,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*$),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/$),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/$),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let be of this._rowElements)be.style.width=`${this.dimensions.css.canvas.width}px`,be.style.height=`${this.dimensions.css.cell.height}px`,be.style.lineHeight=`${this.dimensions.css.cell.height}px`,be.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let ue=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=ue,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss($){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let ue=`${this._terminalSelector} .${D} { color: ${$.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;ue+=`${this._terminalSelector} .${D} .xterm-dim { color: ${M.color.multiplyOpacity($.foreground,.5).css};}`,ue+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let be=`blink_underline_${this._terminalClass}`,me=`blink_bar_${this._terminalClass}`,De=`blink_block_${this._terminalClass}`;ue+=`@keyframes ${be} { 50% { border-bottom-style: hidden; }}`,ue+=`@keyframes ${me} { 50% { box-shadow: none; }}`,ue+=`@keyframes ${De} { 0% { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css}; } 50% { background-color: inherit; color: ${$.cursor.css}; }}`,ue+=`${this._terminalSelector} .${D}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${be} 1s step-end infinite;}${this._terminalSelector} .${D}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${me} 1s step-end infinite;}${this._terminalSelector} .${D}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${De} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${$.cursor.css} !important; color: ${$.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${$.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${$.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${$.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,ue+=`${this._terminalSelector} .${re} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${re} div { position: absolute; background-color: ${$.selectionBackgroundOpaque.css};}${this._terminalSelector} .${re} div { position: absolute; background-color: ${$.selectionInactiveBackgroundOpaque.css};}`;for(let[he,B]of $.ansi.entries())ue+=`${this._terminalSelector} .${N}${he} { color: ${B.css}; }${this._terminalSelector} .${N}${he}.xterm-dim { color: ${M.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${P}${he} { background-color: ${B.css}; }`;ue+=`${this._terminalSelector} .${N}${_.INVERTED_DEFAULT_COLOR} { color: ${M.color.opaque($.background).css}; }${this._terminalSelector} .${N}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${M.color.multiplyOpacity(M.color.opaque($.background),.5).css}; }${this._terminalSelector} .${P}${_.INVERTED_DEFAULT_COLOR} { background-color: ${$.foreground.css}; }`,this._themeStyleElement.textContent=ue}_setDefaultSpacing(){let $=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${$}px`,this._rowFactory.defaultSpacing=$}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements($,ue){for(let be=this._rowElements.length;be<=ue;be++){let me=this._document.createElement("div");this._rowContainer.appendChild(me),this._rowElements.push(me)}for(;this._rowElements.length>ue;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize($,ue){this._refreshRowElements($,ue),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged($,ue,be){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged($,ue,be),this.renderRows(0,this._bufferService.rows-1),!$||!ue)return;this._selectionRenderModel.update(this._terminal,$,ue,be);let me=this._selectionRenderModel.viewportStartRow,De=this._selectionRenderModel.viewportEndRow,he=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(he>=this._bufferService.rows||B<0)return;let X=this._document.createDocumentFragment();if(be){let se=$[0]>ue[0];X.appendChild(this._createSelectionElement(he,se?ue[0]:$[0],se?$[0]:ue[0],B-he+1))}else{let se=me===he?$[0]:0,ce=he===De?ue[0]:this._bufferService.cols;X.appendChild(this._createSelectionElement(he,se,ce));let ke=B-he-1;if(X.appendChild(this._createSelectionElement(he+1,0,this._bufferService.cols,ke)),he!==B){let ze=De===B?ue[0]:this._bufferService.cols;X.appendChild(this._createSelectionElement(B,0,ze))}}this._selectionContainer.appendChild(X)}_createSelectionElement($,ue,be,me=1){let De=this._document.createElement("div"),he=ue*this.dimensions.css.cell.width,B=this.dimensions.css.cell.width*(be-ue);return he+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-he),De.style.height=me*this.dimensions.css.cell.height+"px",De.style.top=$*this.dimensions.css.cell.height+"px",De.style.left=`${he}px`,De.style.width=`${B}px`,De}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let $ of this._rowElements)$.replaceChildren()}renderRows($,ue){let be=this._bufferService.buffer,me=be.ybase+be.y,De=Math.min(be.x,this._bufferService.cols-1),he=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,X=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=$;se<=ue;se++){let ce=se+be.ydisp,ke=this._rowElements[se],ze=be.lines.get(ce);if(!ke||!ze)break;ke.replaceChildren(...this._rowFactory.createRow(ze,ce,ce===me,B,X,De,he,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${I}${this._terminalClass}`}_handleLinkHover($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!0)}_handleLinkLeave($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!1)}_setCellUnderline($,ue,be,me,De,he){be<0&&($=0),me<0&&(ue=0);let B=this._bufferService.rows-1;be=Math.max(Math.min(be,B),0),me=Math.max(Math.min(me,B),0),De=Math.min(De,this._bufferService.cols);let X=this._bufferService.buffer,se=X.ybase+X.y,ce=Math.min(X.x,De-1),ke=this._optionsService.rawOptions.cursorBlink,ze=this._optionsService.rawOptions.cursorStyle,Ke=this._optionsService.rawOptions.cursorInactiveStyle;for(let Qe=be;Qe<=me;++Qe){let ye=Qe+X.ydisp,q=this._rowElements[Qe],Oe=X.lines.get(ye);if(!q||!Oe)break;q.replaceChildren(...this._rowFactory.createRow(Oe,ye,ye===se,ze,Ke,ce,ke,this.dimensions.css.cell.width,this._widthCache,he?Qe===be?$:0:-1,he?(Qe===me?ue:De)-1:-1))}}};r.DomRenderer=G=c([p(7,E.IInstantiationService),p(8,b.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],G)},3787:function(o,r,a){var c=this&&this.__decorate||function(D,N,P,L){var re,oe=arguments.length,G=oe<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,P):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(D,N,P,L);else for(var $=D.length-1;$>=0;$--)(re=D[$])&&(G=(oe<3?re(G):oe>3?re(N,P,G):re(N,P))||G);return oe>3&&G&&Object.defineProperty(N,P,G),G},p=this&&this.__param||function(D,N){return function(P,L){N(P,L,D)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;let u=a(2223),h=a(643),_=a(511),S=a(2585),x=a(8055),b=a(4725),M=a(4269),w=a(6171),y=a(3734),E=r.DomRendererRowFactory=class{constructor(D,N,P,L,re,oe,G){this._document=D,this._characterJoinerService=N,this._optionsService=P,this._coreBrowserService=L,this._coreService=re,this._decorationService=oe,this._themeService=G,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,N,P){this._selectionStart=D,this._selectionEnd=N,this._columnSelectMode=P}createRow(D,N,P,L,re,oe,G,$,ue,be,me){let De=[],he=this._characterJoinerService.getJoinedCharacters(N),B=this._themeService.colors,X,se=D.getNoBgTrimmedLength();P&&se<oe+1&&(se=oe+1);let ce=0,ke="",ze=0,Ke=0,Qe=0,ye=!1,q=0,Oe=!1,We=0,ct=[],Tt=be!==-1&&me!==-1;for(let Xn=0;Xn<se;Xn++){D.loadCell(Xn,this._workCell);let Io=this._workCell.getWidth();if(Io===0)continue;let _o=!1,Br=Xn,Rn=this._workCell;if(he.length>0&&Xn===he[0][0]){_o=!0;let Go=he.shift();Rn=new M.JoinedCellData(this._workCell,D.translateToString(!0,Go[0],Go[1]),Go[1]-Go[0]),Br=Go[1]-1,Io=Rn.getWidth()}let zd=this._isCellInSelection(Xn,N),Ru=P&&Xn===oe,ek=Tt&&Xn>=be&&Xn<=me,tk=!1;this._decorationService.forEachDecorationAtCell(Xn,N,void 0,Go=>{tk=!0});let Qv=Rn.getChars()||h.WHITESPACE_CELL_CHAR;if(Qv===" "&&(Rn.isUnderline()||Rn.isOverline())&&(Qv="\xA0"),We=Io*$-ue.get(Qv,Rn.isBold(),Rn.isItalic()),X){if(ce&&(zd&&Oe||!zd&&!Oe&&Rn.bg===ze)&&(zd&&Oe&&B.selectionForeground||Rn.fg===Ke)&&Rn.extended.ext===Qe&&ek===ye&&We===q&&!Ru&&!_o&&!tk){Rn.isInvisible()?ke+=h.WHITESPACE_CELL_CHAR:ke+=Qv,ce++;continue}ce&&(X.textContent=ke),X=this._document.createElement("span"),ce=0,ke=""}else X=this._document.createElement("span");if(ze=Rn.bg,Ke=Rn.fg,Qe=Rn.extended.ext,ye=ek,q=We,Oe=zd,_o&&oe>=Xn&&oe<=Br&&(oe=Xn),!this._coreService.isCursorHidden&&Ru&&this._coreService.isCursorInitialized){if(ct.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&ct.push("xterm-cursor-blink"),ct.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(re)switch(re){case"outline":ct.push("xterm-cursor-outline");break;case"block":ct.push("xterm-cursor-block");break;case"bar":ct.push("xterm-cursor-bar");break;case"underline":ct.push("xterm-cursor-underline")}}if(Rn.isBold()&&ct.push("xterm-bold"),Rn.isItalic()&&ct.push("xterm-italic"),Rn.isDim()&&ct.push("xterm-dim"),ke=Rn.isInvisible()?h.WHITESPACE_CELL_CHAR:Rn.getChars()||h.WHITESPACE_CELL_CHAR,Rn.isUnderline()&&(ct.push(`xterm-underline-${Rn.extended.underlineStyle}`),ke===" "&&(ke="\xA0"),!Rn.isUnderlineColorDefault()))if(Rn.isUnderlineColorRGB())X.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Rn.getUnderlineColor()).join(",")})`;else{let Go=Rn.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Rn.isBold()&&Go<8&&(Go+=8),X.style.textDecorationColor=B.ansi[Go].css}Rn.isOverline()&&(ct.push("xterm-overline"),ke===" "&&(ke="\xA0")),Rn.isStrikethrough()&&ct.push("xterm-strikethrough"),ek&&(X.style.textDecoration="underline");let Vs=Rn.getFgColor(),Ig=Rn.getFgColorMode(),tc=Rn.getBgColor(),Ag=Rn.getBgColorMode(),nk=!!Rn.isInverse();if(nk){let Go=Vs;Vs=tc,tc=Go;let e$=Ig;Ig=Ag,Ag=e$}let jd,Xv,$d,Og=!1;switch(this._decorationService.forEachDecorationAtCell(Xn,N,void 0,Go=>{Go.options.layer!=="top"&&Og||(Go.backgroundColorRGB&&(Ag=50331648,tc=Go.backgroundColorRGB.rgba>>8&16777215,jd=Go.backgroundColorRGB),Go.foregroundColorRGB&&(Ig=50331648,Vs=Go.foregroundColorRGB.rgba>>8&16777215,Xv=Go.foregroundColorRGB),Og=Go.options.layer==="top")}),!Og&&zd&&(jd=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,tc=jd.rgba>>8&16777215,Ag=50331648,Og=!0,B.selectionForeground&&(Ig=50331648,Vs=B.selectionForeground.rgba>>8&16777215,Xv=B.selectionForeground)),Og&&ct.push("xterm-decoration-top"),Ag){case 16777216:case 33554432:$d=B.ansi[tc],ct.push(`xterm-bg-${tc}`);break;case 50331648:$d=x.channels.toColor(tc>>16,tc>>8&255,255&tc),this._addStyle(X,`background-color:#${I((tc>>>0).toString(16),"0",6)}`);break;default:nk?($d=B.foreground,ct.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):$d=B.background}switch(jd||Rn.isDim()&&(jd=x.color.multiplyOpacity($d,.5)),Ig){case 16777216:case 33554432:Rn.isBold()&&Vs<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Vs+=8),this._applyMinimumContrast(X,$d,B.ansi[Vs],Rn,jd,void 0)||ct.push(`xterm-fg-${Vs}`);break;case 50331648:let Go=x.channels.toColor(Vs>>16&255,Vs>>8&255,255&Vs);this._applyMinimumContrast(X,$d,Go,Rn,jd,Xv)||this._addStyle(X,`color:#${I(Vs.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(X,$d,B.foreground,Rn,jd,Xv)||nk&&ct.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}ct.length&&(X.className=ct.join(" "),ct.length=0),Ru||_o||tk?X.textContent=ke:ce++,We!==this.defaultSpacing&&(X.style.letterSpacing=`${We}px`),De.push(X),Xn=Br}return X&&ce&&(X.textContent=ke),De}_applyMinimumContrast(D,N,P,L,re,oe){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(L.getCode()))return!1;let G=this._getContrastCache(L),$;if(re||oe||($=G.getColor(N.rgba,P.rgba)),$===void 0){let ue=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);$=x.color.ensureContrastRatio(re||N,oe||P,ue),G.setColor((re||N).rgba,(oe||P).rgba,$??null)}return!!$&&(this._addStyle(D,`color:${$.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,N){D.setAttribute("style",`${D.getAttribute("style")||""}${N};`)}_isCellInSelection(D,N){let P=this._selectionStart,L=this._selectionEnd;return!(!P||!L)&&(this._columnSelectMode?P[0]<=L[0]?D>=P[0]&&N>=P[1]&&D<L[0]&&N<=L[1]:D<P[0]&&N>=P[1]&&D>=L[0]&&N<=L[1]:N>P[1]&&N<L[1]||P[1]===L[1]&&N===P[1]&&D>=P[0]&&D<L[0]||P[1]<L[1]&&N===L[1]&&D<L[0]||P[1]<L[1]&&N===P[1]&&D>=P[0])}};function I(D,N,P){for(;D.length<P;)D=N+D;return D}r.DomRendererRowFactory=E=c([p(1,b.ICharacterJoinerService),p(2,S.IOptionsService),p(3,b.ICoreBrowserService),p(4,S.ICoreService),p(5,S.IDecorationService),p(6,b.IThemeService)],E)},2550:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let p=a.createElement("span");p.classList.add("xterm-char-measure-element");let u=a.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";let h=a.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontStyle="italic";let _=a.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[p,u,h,_],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(h),this._container.appendChild(_),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,c,p,u){a===this._font&&c===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=a,this._fontSize=c,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(a,c,p){let u=0;if(!c&&!p&&a.length===1&&(u=a.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];let S=this._measure(a,0);return S>0&&(this._flat[u]=S),S}let h=a;c&&(h+="B"),p&&(h+="I");let _=this._holey.get(h);if(_===void 0){let S=0;c&&(S|=1),p&&(S|=2),_=this._measure(a,S),_>0&&this._holey.set(h,_)}return _}_measure(a,c){let p=this._measureElements[c];return p.textContent=a.repeat(32),p.offsetWidth/32}}},2223:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;let c=a(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(o,r)=>{function a(p){return 57508<=p&&p<=57558}function c(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},r.isPowerlineGlyph=a,r.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},r.isEmoji=c,r.allowRescaling=function(p,u,h,_){return u===1&&h>Math.ceil(1.5*_)&&p!==void 0&&p>255&&!c(p)&&!a(p)&&!(function(S){return 57344<=S&&S<=63743})(p)},r.treatGlyphAsBackgroundColor=function(p){return a(p)||(function(u){return 9472<=u&&u<=9631})(p)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(p,u,h=0){return(p-(2*Math.round(u)-h))%(2*Math.round(u))}},6052:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,u,h,_=!1){if(this.selectionStart=u,this.selectionEnd=h,!u||!h||u[0]===h[0]&&u[1]===h[1])return void this.clear();let S=p.buffers.active.ydisp,x=u[1]-S,b=h[1]-S,M=Math.max(x,0),w=Math.min(b,p.rows-1);M>=p.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=x,this.viewportEndRow=b,this.viewportCappedStartRow=M,this.viewportCappedEndRow=w,this.startCol=u[0],this.endCol=h[0])}isCellSelected(p,u,h){return!!this.hasSelection&&(h-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&h>=this.viewportCappedStartRow&&u<this.endCol&&h<=this.viewportCappedEndRow:u<this.startCol&&h>=this.viewportCappedStartRow&&u>=this.endCol&&h<=this.viewportCappedEndRow:h>this.viewportStartRow&&h<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&h===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportStartRow&&u>=this.startCol)}}r.createSelectionRenderModel=function(){return new a}},456:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,r,a){var c=this&&this.__decorate||function(w,y,E,I){var D,N=arguments.length,P=N<3?y:I===null?I=Object.getOwnPropertyDescriptor(y,E):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,y,E,I);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(y,E,P):D(y,E))||P);return N>3&&P&&Object.defineProperty(y,E,P),P},p=this&&this.__param||function(w,y){return function(E,I){y(E,I,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;let u=a(2585),h=a(8460),_=a(844),S=r.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new h.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new M(this._optionsService))}catch{this._measureStrategy=this.register(new b(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){let w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};r.CharSizeService=S=c([p(2,u.IOptionsService)],S);class x extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,E){y!==void 0&&y>0&&E!==void 0&&E>0&&(this._result.width=y,this._result.height=E)}}class b extends x{constructor(y,E,I){super(),this._document=y,this._parentElement=E,this._optionsService=I,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class M extends x{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(o,r,a){var c=this&&this.__decorate||function(M,w,y,E){var I,D=arguments.length,N=D<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,w,y,E);else for(var P=M.length-1;P>=0;P--)(I=M[P])&&(N=(D<3?I(N):D>3?I(w,y,N):I(w,y))||N);return D>3&&N&&Object.defineProperty(w,y,N),N},p=this&&this.__param||function(M,w){return function(y,E){w(y,E,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;let u=a(3734),h=a(643),_=a(511),S=a(2585);class x extends u.AttributeData{constructor(w,y,E){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=x;let b=r.CharacterJoinerService=class A9{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(w){let y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===w)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(w){if(this._characterJoiners.length===0)return[];let y=this._bufferService.buffer.lines.get(w);if(!y||y.length===0)return[];let E=[],I=y.translateToString(!0),D=0,N=0,P=0,L=y.getFg(0),re=y.getBg(0);for(let oe=0;oe<y.getTrimmedLength();oe++)if(y.loadCell(oe,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==re){if(oe-D>1){let G=this._getJoinedRanges(I,P,N,y,D);for(let $=0;$<G.length;$++)E.push(G[$])}D=oe,P=N,L=this._workCell.fg,re=this._workCell.bg}N+=this._workCell.getChars().length||h.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){let oe=this._getJoinedRanges(I,P,N,y,D);for(let G=0;G<oe.length;G++)E.push(oe[G])}return E}_getJoinedRanges(w,y,E,I,D){let N=w.substring(y,E),P=[];try{P=this._characterJoiners[0].handler(N)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{let re=this._characterJoiners[L].handler(N);for(let oe=0;oe<re.length;oe++)A9._mergeRanges(P,re[oe])}catch(re){console.error(re)}return this._stringRangesToCellRanges(P,I,D),P}_stringRangesToCellRanges(w,y,E){let I=0,D=!1,N=0,P=w[I];if(P){for(let L=E;L<this._bufferService.cols;L++){let re=y.getWidth(L),oe=y.getString(L).length||h.WHITESPACE_CELL_CHAR.length;if(re!==0){if(!D&&P[0]<=N&&(P[0]=L,D=!0),P[1]<=N){if(P[1]=L,P=w[++I],!P)break;P[0]<=N?(P[0]=L,D=!0):D=!1}N+=oe}}P&&(P[1]=this._bufferService.cols)}}static _mergeRanges(w,y){let E=!1;for(let I=0;I<w.length;I++){let D=w[I];if(E){if(y[1]<=D[0])return w[I-1][1]=y[1],w;if(y[1]<=D[1])return w[I-1][1]=Math.max(y[1],D[1]),w.splice(I,1),w;w.splice(I,1),I--}else{if(y[1]<=D[0])return w.splice(I,0,y),w;if(y[1]<=D[1])return D[0]=Math.min(y[0],D[0]),w;y[0]<D[1]&&(D[0]=Math.min(y[0],D[0]),E=!0)}}return E?w[w.length-1][1]=y[1]:w.push(y),w}};r.CharacterJoinerService=b=c([p(0,S.IBufferService)],b)},5114:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;let c=a(844),p=a(8460),u=a(3656);class h extends c.Disposable{constructor(x,b,M){super(),this._textarea=x,this._window=b,this.mainDocument=M,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(w=>this._screenDprMonitor.setWindow(w))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}r.CoreBrowserService=h;class _ extends c.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;let c=a(844);class p extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(h){return this.linkProviders.push(h),{dispose:()=>{let _=this.linkProviders.indexOf(h);_!==-1&&this.linkProviders.splice(_,1)}}}}r.LinkProviderService=p},8934:function(o,r,a){var c=this&&this.__decorate||function(S,x,b,M){var w,y=arguments.length,E=y<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,b):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,x,b,M);else for(var I=S.length-1;I>=0;I--)(w=S[I])&&(E=(y<3?w(E):y>3?w(x,b,E):w(x,b))||E);return y>3&&E&&Object.defineProperty(x,b,E),E},p=this&&this.__param||function(S,x){return function(b,M){x(b,M,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;let u=a(4725),h=a(9806),_=r.MouseService=class{constructor(S,x){this._renderService=S,this._charSizeService=x}getCoords(S,x,b,M,w){return(0,h.getCoords)(window,S,x,b,M,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(S,x){let b=(0,h.getCoordsRelativeToElement)(window,S,x);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};r.MouseService=_=c([p(0,u.IRenderService),p(1,u.ICharSizeService)],_)},3230:function(o,r,a){var c=this&&this.__decorate||function(w,y,E,I){var D,N=arguments.length,P=N<3?y:I===null?I=Object.getOwnPropertyDescriptor(y,E):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,y,E,I);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(y,E,P):D(y,E))||P);return N>3&&P&&Object.defineProperty(y,E,P),P},p=this&&this.__param||function(w,y){return function(E,I){y(E,I,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;let u=a(6193),h=a(4725),_=a(8460),S=a(844),x=a(7226),b=a(2585),M=r.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,E,I,D,N,P,L){super(),this._rowCount=w,this._charSizeService=I,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new S.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((re,oe)=>this._renderRows(re,oe),P),this.register(this._renderDebouncer),this.register(P.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(N.onResize(()=>this._fullRefresh())),this.register(N.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(E.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(D.onDecorationRegistered(()=>this._fullRefresh())),this.register(D.onDecorationRemoved(()=>this._fullRefresh())),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(N.cols,N.rows),this._fullRefresh()})),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(N.buffer.y,N.buffer.y,!0))),this.register(L.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(P.window,y),this.register(P.onWindowChange(re=>this._registerIntersectionObserver(re,y)))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){let E=new w.IntersectionObserver(I=>this._handleIntersectionChange(I[I.length-1]),{threshold:0});E.observe(y),this._observerDisposable.value=(0,S.toDisposable)(()=>E.disconnect())}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(w,y)):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(w,y,E){this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(w,y,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=M=c([p(2,b.IOptionsService),p(3,h.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,h.ICoreBrowserService),p(7,h.IThemeService)],M)},9312:function(o,r,a){var c=this&&this.__decorate||function(P,L,re,oe){var G,$=arguments.length,ue=$<3?L:oe===null?oe=Object.getOwnPropertyDescriptor(L,re):oe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ue=Reflect.decorate(P,L,re,oe);else for(var be=P.length-1;be>=0;be--)(G=P[be])&&(ue=($<3?G(ue):$>3?G(L,re,ue):G(L,re))||ue);return $>3&&ue&&Object.defineProperty(L,re,ue),ue},p=this&&this.__param||function(P,L){return function(re,oe){L(re,oe,P)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;let u=a(9806),h=a(9504),_=a(456),S=a(4725),x=a(8460),b=a(844),M=a(6114),w=a(4841),y=a(511),E=a(2585),I="\xA0",D=new RegExp(I,"g"),N=r.SelectionService=class extends b.Disposable{constructor(P,L,re,oe,G,$,ue,be,me){super(),this._element=P,this._screenElement=L,this._linkifier=re,this._bufferService=oe,this._coreService=G,this._mouseService=$,this._optionsService=ue,this._renderService=be,this._coreBrowserService=me,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=De=>this._handleMouseMove(De),this._mouseUpListener=De=>this._handleMouseUp(De),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(De=>this._handleTrim(De)),this.register(this._bufferService.buffers.onBufferActivate(De=>this._handleBufferActivate(De))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let P=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!P||!L||P[0]===L[0]&&P[1]===L[1])}get selectionText(){let P=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!P||!L)return"";let re=this._bufferService.buffer,oe=[];if(this._activeSelectionMode===3){if(P[0]===L[0])return"";let G=P[0]<L[0]?P[0]:L[0],$=P[0]<L[0]?L[0]:P[0];for(let ue=P[1];ue<=L[1];ue++){let be=re.translateBufferLineToString(ue,!0,G,$);oe.push(be)}}else{let G=P[1]===L[1]?L[0]:void 0;oe.push(re.translateBufferLineToString(P[1],!0,P[0],G));for(let $=P[1]+1;$<=L[1]-1;$++){let ue=re.lines.get($),be=re.translateBufferLineToString($,!0);ue?.isWrapped?oe[oe.length-1]+=be:oe.push(be)}if(P[1]!==L[1]){let $=re.lines.get(L[1]),ue=re.translateBufferLineToString(L[1],!0,0,L[0]);$&&$.isWrapped?oe[oe.length-1]+=ue:oe.push(ue)}}return oe.map(G=>G.replace(D," ")).join(M.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(P){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),M.isLinux&&P&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(P){let L=this._getMouseBufferCoords(P),re=this._model.finalSelectionStart,oe=this._model.finalSelectionEnd;return!!(re&&oe&&L)&&this._areCoordsInSelection(L,re,oe)}isCellInSelection(P,L){let re=this._model.finalSelectionStart,oe=this._model.finalSelectionEnd;return!(!re||!oe)&&this._areCoordsInSelection([P,L],re,oe)}_areCoordsInSelection(P,L,re){return P[1]>L[1]&&P[1]<re[1]||L[1]===re[1]&&P[1]===L[1]&&P[0]>=L[0]&&P[0]<re[0]||L[1]<re[1]&&P[1]===re[1]&&P[0]<re[0]||L[1]<re[1]&&P[1]===L[1]&&P[0]>=L[0]}_selectWordAtCursor(P,L){let re=this._linkifier.currentLink?.link?.range;if(re)return this._model.selectionStart=[re.start.x-1,re.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(re,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let oe=this._getMouseBufferCoords(P);return!!oe&&(this._selectWordAt(oe,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(P,L){this._model.clearSelection(),P=Math.max(P,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,P],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(P){this._model.handleTrim(P)&&this.refresh()}_getMouseBufferCoords(P){let L=this._mouseService.getCoords(P,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(P){let L=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,P,this._screenElement)[1],re=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=re?0:(L>re&&(L-=re),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(P){return M.isMac?P.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:P.shiftKey}handleMouseDown(P){if(this._mouseDownTimeStamp=P.timeStamp,(P.button!==2||!this.hasSelection)&&P.button===0){if(!this._enabled){if(!this.shouldForceSelection(P))return;P.stopPropagation()}P.preventDefault(),this._dragScrollAmount=0,this._enabled&&P.shiftKey?this._handleIncrementalClick(P):P.detail===1?this._handleSingleClick(P):P.detail===2?this._handleDoubleClick(P):P.detail===3&&this._handleTripleClick(P),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(P){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(P))}_handleSingleClick(P){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(P)?3:0,this._model.selectionStart=this._getMouseBufferCoords(P),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(P){this._selectWordAtCursor(P,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(P){let L=this._getMouseBufferCoords(P);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(P){return P.altKey&&!(M.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(P){if(P.stopImmediatePropagation(),!this._model.selectionStart)return;let L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(P),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(P),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let re=this._bufferService.buffer;if(this._model.selectionEnd[1]<re.lines.length){let oe=re.lines.get(this._model.selectionEnd[1]);oe&&oe.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let P=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(P.ydisp+this._bufferService.rows,P.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=P.ydisp),this.refresh()}}_handleMouseUp(P){let L=P.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&P.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let re=this._mouseService.getCoords(P,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(re&&re[0]!==void 0&&re[1]!==void 0){let oe=(0,h.moveToCellSequence)(re[0]-1,re[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(oe,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let P=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,re=!(!P||!L||P[0]===L[0]&&P[1]===L[1]);re?P&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&P[0]===this._oldSelectionStart[0]&&P[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(P,L,re)):this._oldHasSelection&&this._fireOnSelectionChange(P,L,re)}_fireOnSelectionChange(P,L,re){this._oldSelectionStart=P,this._oldSelectionEnd=L,this._oldHasSelection=re,this._onSelectionChange.fire()}_handleBufferActivate(P){this.clearSelection(),this._trimListener.dispose(),this._trimListener=P.activeBuffer.lines.onTrim(L=>this._handleTrim(L))}_convertViewportColToCharacterIndex(P,L){let re=L;for(let oe=0;L>=oe;oe++){let G=P.loadCell(oe,this._workCell).getChars().length;this._workCell.getWidth()===0?re--:G>1&&L!==oe&&(re+=G-1)}return re}setSelection(P,L,re){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[P,L],this._model.selectionStartLength=re,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(P){this._isClickInSelection(P)||(this._selectWordAtCursor(P,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(P,L,re=!0,oe=!0){if(P[0]>=this._bufferService.cols)return;let G=this._bufferService.buffer,$=G.lines.get(P[1]);if(!$)return;let ue=G.translateBufferLineToString(P[1],!1),be=this._convertViewportColToCharacterIndex($,P[0]),me=be,De=P[0]-be,he=0,B=0,X=0,se=0;if(ue.charAt(be)===" "){for(;be>0&&ue.charAt(be-1)===" ";)be--;for(;me<ue.length&&ue.charAt(me+1)===" ";)me++}else{let ze=P[0],Ke=P[0];$.getWidth(ze)===0&&(he++,ze--),$.getWidth(Ke)===2&&(B++,Ke++);let Qe=$.getString(Ke).length;for(Qe>1&&(se+=Qe-1,me+=Qe-1);ze>0&&be>0&&!this._isCharWordSeparator($.loadCell(ze-1,this._workCell));){$.loadCell(ze-1,this._workCell);let ye=this._workCell.getChars().length;this._workCell.getWidth()===0?(he++,ze--):ye>1&&(X+=ye-1,be-=ye-1),be--,ze--}for(;Ke<$.length&&me+1<ue.length&&!this._isCharWordSeparator($.loadCell(Ke+1,this._workCell));){$.loadCell(Ke+1,this._workCell);let ye=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,Ke++):ye>1&&(se+=ye-1,me+=ye-1),me++,Ke++}}me++;let ce=be+De-he+X,ke=Math.min(this._bufferService.cols,me-be+he+B-X-se);if(L||ue.slice(be,me).trim()!==""){if(re&&ce===0&&$.getCodePoint(0)!==32){let ze=G.lines.get(P[1]-1);if(ze&&$.isWrapped&&ze.getCodePoint(this._bufferService.cols-1)!==32){let Ke=this._getWordAt([this._bufferService.cols-1,P[1]-1],!1,!0,!1);if(Ke){let Qe=this._bufferService.cols-Ke.start;ce-=Qe,ke+=Qe}}}if(oe&&ce+ke===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){let ze=G.lines.get(P[1]+1);if(ze?.isWrapped&&ze.getCodePoint(0)!==32){let Ke=this._getWordAt([0,P[1]+1],!1,!1,!0);Ke&&(ke+=Ke.length)}}return{start:ce,length:ke}}}_selectWordAt(P,L){let re=this._getWordAt(P,L);if(re){for(;re.start<0;)re.start+=this._bufferService.cols,P[1]--;this._model.selectionStart=[re.start,P[1]],this._model.selectionStartLength=re.length}}_selectToWordAt(P){let L=this._getWordAt(P,!0);if(L){let re=P[1];for(;L.start<0;)L.start+=this._bufferService.cols,re--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,re++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,re]}}_isCharWordSeparator(P){return P.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(P.getChars())>=0}_selectLineAt(P){let L=this._bufferService.buffer.getWrappedRangeForLine(P),re={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(re,this._bufferService.cols)}};r.SelectionService=N=c([p(3,E.IBufferService),p(4,E.ICoreService),p(5,S.IMouseService),p(6,E.IOptionsService),p(7,S.IRenderService),p(8,S.ICoreBrowserService)],N)},4725:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;let c=a(8343);r.ICharSizeService=(0,c.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),r.IMouseService=(0,c.createDecorator)("MouseService"),r.IRenderService=(0,c.createDecorator)("RenderService"),r.ISelectionService=(0,c.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,c.createDecorator)("ThemeService"),r.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(o,r,a){var c=this&&this.__decorate||function(N,P,L,re){var oe,G=arguments.length,$=G<3?P:re===null?re=Object.getOwnPropertyDescriptor(P,L):re;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,P,L,re);else for(var ue=N.length-1;ue>=0;ue--)(oe=N[ue])&&($=(G<3?oe($):G>3?oe(P,L,$):oe(P,L))||$);return G>3&&$&&Object.defineProperty(P,L,$),$},p=this&&this.__param||function(N,P){return function(L,re){P(L,re,N)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;let u=a(7239),h=a(8055),_=a(8460),S=a(844),x=a(2585),b=h.css.toColor("#ffffff"),M=h.css.toColor("#000000"),w=h.css.toColor("#ffffff"),y=h.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let N=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],P=[0,95,135,175,215,255];for(let L=0;L<216;L++){let re=P[L/36%6|0],oe=P[L/6%6|0],G=P[L%6];N.push({css:h.channels.toCss(re,oe,G),rgba:h.channels.toRgba(re,oe,G)})}for(let L=0;L<24;L++){let re=8+10*L;N.push({css:h.channels.toCss(re,re,re),rgba:h.channels.toRgba(re,re,re)})}return N})());let I=r.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(N){super(),this._optionsService=N,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:M,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:h.color.blend(M,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:h.color.blend(M,E),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(N={}){let P=this._colors;if(P.foreground=D(N.foreground,b),P.background=D(N.background,M),P.cursor=D(N.cursor,w),P.cursorAccent=D(N.cursorAccent,y),P.selectionBackgroundTransparent=D(N.selectionBackground,E),P.selectionBackgroundOpaque=h.color.blend(P.background,P.selectionBackgroundTransparent),P.selectionInactiveBackgroundTransparent=D(N.selectionInactiveBackground,P.selectionBackgroundTransparent),P.selectionInactiveBackgroundOpaque=h.color.blend(P.background,P.selectionInactiveBackgroundTransparent),P.selectionForeground=N.selectionForeground?D(N.selectionForeground,h.NULL_COLOR):void 0,P.selectionForeground===h.NULL_COLOR&&(P.selectionForeground=void 0),h.color.isOpaque(P.selectionBackgroundTransparent)&&(P.selectionBackgroundTransparent=h.color.opacity(P.selectionBackgroundTransparent,.3)),h.color.isOpaque(P.selectionInactiveBackgroundTransparent)&&(P.selectionInactiveBackgroundTransparent=h.color.opacity(P.selectionInactiveBackgroundTransparent,.3)),P.ansi=r.DEFAULT_ANSI_COLORS.slice(),P.ansi[0]=D(N.black,r.DEFAULT_ANSI_COLORS[0]),P.ansi[1]=D(N.red,r.DEFAULT_ANSI_COLORS[1]),P.ansi[2]=D(N.green,r.DEFAULT_ANSI_COLORS[2]),P.ansi[3]=D(N.yellow,r.DEFAULT_ANSI_COLORS[3]),P.ansi[4]=D(N.blue,r.DEFAULT_ANSI_COLORS[4]),P.ansi[5]=D(N.magenta,r.DEFAULT_ANSI_COLORS[5]),P.ansi[6]=D(N.cyan,r.DEFAULT_ANSI_COLORS[6]),P.ansi[7]=D(N.white,r.DEFAULT_ANSI_COLORS[7]),P.ansi[8]=D(N.brightBlack,r.DEFAULT_ANSI_COLORS[8]),P.ansi[9]=D(N.brightRed,r.DEFAULT_ANSI_COLORS[9]),P.ansi[10]=D(N.brightGreen,r.DEFAULT_ANSI_COLORS[10]),P.ansi[11]=D(N.brightYellow,r.DEFAULT_ANSI_COLORS[11]),P.ansi[12]=D(N.brightBlue,r.DEFAULT_ANSI_COLORS[12]),P.ansi[13]=D(N.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),P.ansi[14]=D(N.brightCyan,r.DEFAULT_ANSI_COLORS[14]),P.ansi[15]=D(N.brightWhite,r.DEFAULT_ANSI_COLORS[15]),N.extendedAnsi){let L=Math.min(P.ansi.length-16,N.extendedAnsi.length);for(let re=0;re<L;re++)P.ansi[re+16]=D(N.extendedAnsi[re],r.DEFAULT_ANSI_COLORS[re+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(N){this._restoreColor(N),this._onChangeColors.fire(this.colors)}_restoreColor(N){if(N!==void 0)switch(N){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[N]=this._restoreColors.ansi[N]}else for(let P=0;P<this._restoreColors.ansi.length;++P)this._colors.ansi[P]=this._restoreColors.ansi[P]}modifyColors(N){N(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function D(N,P){if(N!==void 0)try{return h.css.toColor(N)}catch{}return P}r.ThemeService=I=c([p(0,x.IOptionsService)],I)},6349:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;let c=a(8460),p=a(844);class u extends p.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;let S=new Array(_);for(let x=0;x<Math.min(_,this.length);x++)S[x]=this._array[this._getCyclicIndex(x)];this._array=S,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let S=this._length;S<_;S++)this._array[S]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,S){this._array[this._getCyclicIndex(_)]=S}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,S,...x){if(S){for(let b=_;b<this._length-S;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+S)];this._length-=S,this.onDeleteEmitter.fire({index:_,amount:S})}for(let b=this._length-1;b>=_;b--)this._array[this._getCyclicIndex(b+x.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<x.length;b++)this._array[this._getCyclicIndex(_+b)]=x[b];if(x.length&&this.onInsertEmitter.fire({index:_,amount:x.length}),this._length+x.length>this._maxLength){let b=this._length+x.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=x.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,S,x){if(!(S<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let M=S-1;M>=0;M--)this.set(_+M+x,this.get(_+M));let b=_+S+x-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<S;b++)this.set(_+b+x,this.get(_+b))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}r.CircularList=u},1439:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function a(c,p=5){if(typeof c!="object")return c;let u=Array.isArray(c)?[]:{};for(let h in c)u[h]=p<=1?c[h]:c[h]&&a(c[h],p-1);return u}},8055:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let a=0,c=0,p=0,u=0;var h,_,S,x,b;function M(y){let E=y.toString(16);return E.length<2?"0"+E:E}function w(y,E){return y<E?(E+.05)/(y+.05):(y+.05)/(E+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(E,I,D,N){return N!==void 0?`#${M(E)}${M(I)}${M(D)}${M(N)}`:`#${M(E)}${M(I)}${M(D)}`},y.toRgba=function(E,I,D,N=255){return(E<<24|I<<16|D<<8|N)>>>0},y.toColor=function(E,I,D,N){return{css:y.toCss(E,I,D,N),rgba:y.toRgba(E,I,D,N)}}})(h||(r.channels=h={})),(function(y){function E(I,D){return u=Math.round(255*D),[a,c,p]=b.toChannels(I.rgba),{css:h.toCss(a,c,p,u),rgba:h.toRgba(a,c,p,u)}}y.blend=function(I,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};let N=D.rgba>>24&255,P=D.rgba>>16&255,L=D.rgba>>8&255,re=I.rgba>>24&255,oe=I.rgba>>16&255,G=I.rgba>>8&255;return a=re+Math.round((N-re)*u),c=oe+Math.round((P-oe)*u),p=G+Math.round((L-G)*u),{css:h.toCss(a,c,p),rgba:h.toRgba(a,c,p)}},y.isOpaque=function(I){return(255&I.rgba)==255},y.ensureContrastRatio=function(I,D,N){let P=b.ensureContrastRatio(I.rgba,D.rgba,N);if(P)return h.toColor(P>>24&255,P>>16&255,P>>8&255)},y.opaque=function(I){let D=(255|I.rgba)>>>0;return[a,c,p]=b.toChannels(D),{css:h.toCss(a,c,p),rgba:D}},y.opacity=E,y.multiplyOpacity=function(I,D){return u=255&I.rgba,E(I,u*D/255)},y.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}})(_||(r.color=_={})),(function(y){let E,I;try{let D=document.createElement("canvas");D.width=1,D.height=1;let N=D.getContext("2d",{willReadFrequently:!0});N&&(E=N,E.globalCompositeOperation="copy",I=E.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return a=parseInt(D.slice(1,2).repeat(2),16),c=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),h.toColor(a,c,p);case 5:return a=parseInt(D.slice(1,2).repeat(2),16),c=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),u=parseInt(D.slice(4,5).repeat(2),16),h.toColor(a,c,p,u);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}let N=D.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return a=parseInt(N[1]),c=parseInt(N[2]),p=parseInt(N[3]),u=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),h.toColor(a,c,p,u);if(!E||!I)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=I,E.fillStyle=D,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[a,c,p,u]=E.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:h.toRgba(a,c,p,u),css:D}}})(S||(r.css=S={})),(function(y){function E(I,D,N){let P=I/255,L=D/255,re=N/255;return .2126*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(re<=.03928?re/12.92:Math.pow((re+.055)/1.055,2.4))}y.relativeLuminance=function(I){return E(I>>16&255,I>>8&255,255&I)},y.relativeLuminance2=E})(x||(r.rgb=x={})),(function(y){function E(D,N,P){let L=D>>24&255,re=D>>16&255,oe=D>>8&255,G=N>>24&255,$=N>>16&255,ue=N>>8&255,be=w(x.relativeLuminance2(G,$,ue),x.relativeLuminance2(L,re,oe));for(;be<P&&(G>0||$>0||ue>0);)G-=Math.max(0,Math.ceil(.1*G)),$-=Math.max(0,Math.ceil(.1*$)),ue-=Math.max(0,Math.ceil(.1*ue)),be=w(x.relativeLuminance2(G,$,ue),x.relativeLuminance2(L,re,oe));return(G<<24|$<<16|ue<<8|255)>>>0}function I(D,N,P){let L=D>>24&255,re=D>>16&255,oe=D>>8&255,G=N>>24&255,$=N>>16&255,ue=N>>8&255,be=w(x.relativeLuminance2(G,$,ue),x.relativeLuminance2(L,re,oe));for(;be<P&&(G<255||$<255||ue<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),$=Math.min(255,$+Math.ceil(.1*(255-$))),ue=Math.min(255,ue+Math.ceil(.1*(255-ue))),be=w(x.relativeLuminance2(G,$,ue),x.relativeLuminance2(L,re,oe));return(G<<24|$<<16|ue<<8|255)>>>0}y.blend=function(D,N){if(u=(255&N)/255,u===1)return N;let P=N>>24&255,L=N>>16&255,re=N>>8&255,oe=D>>24&255,G=D>>16&255,$=D>>8&255;return a=oe+Math.round((P-oe)*u),c=G+Math.round((L-G)*u),p=$+Math.round((re-$)*u),h.toRgba(a,c,p)},y.ensureContrastRatio=function(D,N,P){let L=x.relativeLuminance(D>>8),re=x.relativeLuminance(N>>8);if(w(L,re)<P){if(re<L){let $=E(D,N,P),ue=w(L,x.relativeLuminance($>>8));if(ue<P){let be=I(D,N,P);return ue>w(L,x.relativeLuminance(be>>8))?$:be}return $}let oe=I(D,N,P),G=w(L,x.relativeLuminance(oe>>8));if(G<P){let $=E(D,N,P);return G>w(L,x.relativeLuminance($>>8))?oe:$}return oe}},y.reduceLuminance=E,y.increaseLuminance=I,y.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(b||(r.rgba=b={})),r.toPaddedHex=M,r.contrastRatio=w},8969:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;let c=a(844),p=a(2585),u=a(4348),h=a(7866),_=a(744),S=a(7302),x=a(6975),b=a(8460),M=a(1753),w=a(1480),y=a(7994),E=a(9282),I=a(5435),D=a(5981),N=a(2660),P=!1;class L extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event(oe=>{this._onScrollApi?.fire(oe.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(oe){for(let G in oe)this.optionsService.options[G]=oe[G]}constructor(oe){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new S.OptionsService(oe)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(h.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(M.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(N.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new I.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new D.WriteBuffer((G,$)=>this._inputHandler.parse(G,$))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(oe,G){this._writeBuffer.write(oe,G)}writeSync(oe,G){this._logService.logLevel<=p.LogLevelEnum.WARN&&!P&&(this._logService.warn("writeSync is unreliable and will be removed soon."),P=!0),this._writeBuffer.writeSync(oe,G)}input(oe,G=!0){this.coreService.triggerDataEvent(oe,G)}resize(oe,G){isNaN(oe)||isNaN(G)||(oe=Math.max(oe,_.MINIMUM_COLS),G=Math.max(G,_.MINIMUM_ROWS),this._bufferService.resize(oe,G))}scroll(oe,G=!1){this._bufferService.scroll(oe,G)}scrollLines(oe,G,$){this._bufferService.scrollLines(oe,G,$)}scrollPages(oe){this.scrollLines(oe*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(oe){let G=oe-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(oe,G){return this._inputHandler.registerEscHandler(oe,G)}registerDcsHandler(oe,G){return this._inputHandler.registerDcsHandler(oe,G)}registerCsiHandler(oe,G){return this._inputHandler.registerCsiHandler(oe,G)}registerOscHandler(oe,G){return this._inputHandler.registerOscHandler(oe,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let oe=!1,G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?oe=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(oe=!0),oe?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let oe=[];oe.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),oe.push(this.registerCsiHandler({final:"H"},()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(let G of oe)G.dispose()})}}}r.CoreTerminal=L},8460:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){let p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(a,c){return a(p=>c.fire(p))},r.runAndSubscribe=function(a,c){return c(void 0),a(p=>c(p))}},5435:function(o,r,a){var c=this&&this.__decorate||function(he,B,X,se){var ce,ke=arguments.length,ze=ke<3?B:se===null?se=Object.getOwnPropertyDescriptor(B,X):se;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ze=Reflect.decorate(he,B,X,se);else for(var Ke=he.length-1;Ke>=0;Ke--)(ce=he[Ke])&&(ze=(ke<3?ce(ze):ke>3?ce(B,X,ze):ce(B,X))||ze);return ke>3&&ze&&Object.defineProperty(B,X,ze),ze},p=this&&this.__param||function(he,B){return function(X,se){B(X,se,he)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;let u=a(2584),h=a(7116),_=a(2015),S=a(844),x=a(482),b=a(8437),M=a(8460),w=a(643),y=a(511),E=a(3734),I=a(2585),D=a(1480),N=a(6242),P=a(6351),L=a(5941),re={"(":0,")":1,"*":2,"+":3,"-":1,".":2},oe=131072;function G(he,B){if(he>24)return B.setWinLines||!1;switch(he){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var $;(function(he){he[he.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",he[he.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})($||(r.WindowsOptionsReportType=$={}));let ue=0;class be extends S.Disposable{getAttrData(){return this._curAttrData}constructor(B,X,se,ce,ke,ze,Ke,Qe,ye=new _.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=X,this._coreService=se,this._logService=ce,this._optionsService=ke,this._oscLinkService=ze,this._coreMouseService=Ke,this._unicodeService=Qe,this._parser=ye,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new M.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new M.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new M.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new M.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new M.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new M.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new M.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new M.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new M.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new M.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new M.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new me(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(q=>this._activeBuffer=q.activeBuffer)),this._parser.setCsiHandlerFallback((q,Oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:Oe.toArray()})}),this._parser.setEscHandlerFallback(q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})}),this._parser.setExecuteHandlerFallback(q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})}),this._parser.setOscHandlerFallback((q,Oe,We)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:Oe,data:We})}),this._parser.setDcsHandlerFallback((q,Oe,We)=>{Oe==="HOOK"&&(We=We.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:Oe,payload:We})}),this._parser.setPrintHandler((q,Oe,We)=>this.print(q,Oe,We)),this._parser.registerCsiHandler({final:"@"},q=>this.insertChars(q)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},q=>this.scrollLeft(q)),this._parser.registerCsiHandler({final:"A"},q=>this.cursorUp(q)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},q=>this.scrollRight(q)),this._parser.registerCsiHandler({final:"B"},q=>this.cursorDown(q)),this._parser.registerCsiHandler({final:"C"},q=>this.cursorForward(q)),this._parser.registerCsiHandler({final:"D"},q=>this.cursorBackward(q)),this._parser.registerCsiHandler({final:"E"},q=>this.cursorNextLine(q)),this._parser.registerCsiHandler({final:"F"},q=>this.cursorPrecedingLine(q)),this._parser.registerCsiHandler({final:"G"},q=>this.cursorCharAbsolute(q)),this._parser.registerCsiHandler({final:"H"},q=>this.cursorPosition(q)),this._parser.registerCsiHandler({final:"I"},q=>this.cursorForwardTab(q)),this._parser.registerCsiHandler({final:"J"},q=>this.eraseInDisplay(q,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},q=>this.eraseInDisplay(q,!0)),this._parser.registerCsiHandler({final:"K"},q=>this.eraseInLine(q,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},q=>this.eraseInLine(q,!0)),this._parser.registerCsiHandler({final:"L"},q=>this.insertLines(q)),this._parser.registerCsiHandler({final:"M"},q=>this.deleteLines(q)),this._parser.registerCsiHandler({final:"P"},q=>this.deleteChars(q)),this._parser.registerCsiHandler({final:"S"},q=>this.scrollUp(q)),this._parser.registerCsiHandler({final:"T"},q=>this.scrollDown(q)),this._parser.registerCsiHandler({final:"X"},q=>this.eraseChars(q)),this._parser.registerCsiHandler({final:"Z"},q=>this.cursorBackwardTab(q)),this._parser.registerCsiHandler({final:"`"},q=>this.charPosAbsolute(q)),this._parser.registerCsiHandler({final:"a"},q=>this.hPositionRelative(q)),this._parser.registerCsiHandler({final:"b"},q=>this.repeatPrecedingCharacter(q)),this._parser.registerCsiHandler({final:"c"},q=>this.sendDeviceAttributesPrimary(q)),this._parser.registerCsiHandler({prefix:">",final:"c"},q=>this.sendDeviceAttributesSecondary(q)),this._parser.registerCsiHandler({final:"d"},q=>this.linePosAbsolute(q)),this._parser.registerCsiHandler({final:"e"},q=>this.vPositionRelative(q)),this._parser.registerCsiHandler({final:"f"},q=>this.hVPosition(q)),this._parser.registerCsiHandler({final:"g"},q=>this.tabClear(q)),this._parser.registerCsiHandler({final:"h"},q=>this.setMode(q)),this._parser.registerCsiHandler({prefix:"?",final:"h"},q=>this.setModePrivate(q)),this._parser.registerCsiHandler({final:"l"},q=>this.resetMode(q)),this._parser.registerCsiHandler({prefix:"?",final:"l"},q=>this.resetModePrivate(q)),this._parser.registerCsiHandler({final:"m"},q=>this.charAttributes(q)),this._parser.registerCsiHandler({final:"n"},q=>this.deviceStatus(q)),this._parser.registerCsiHandler({prefix:"?",final:"n"},q=>this.deviceStatusPrivate(q)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},q=>this.softReset(q)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},q=>this.setCursorStyle(q)),this._parser.registerCsiHandler({final:"r"},q=>this.setScrollRegion(q)),this._parser.registerCsiHandler({final:"s"},q=>this.saveCursor(q)),this._parser.registerCsiHandler({final:"t"},q=>this.windowOptions(q)),this._parser.registerCsiHandler({final:"u"},q=>this.restoreCursor(q)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},q=>this.insertColumns(q)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},q=>this.deleteColumns(q)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},q=>this.selectProtected(q)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},q=>this.requestMode(q,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},q=>this.requestMode(q,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new N.OscHandler(q=>(this.setTitle(q),this.setIconName(q),!0))),this._parser.registerOscHandler(1,new N.OscHandler(q=>this.setIconName(q))),this._parser.registerOscHandler(2,new N.OscHandler(q=>this.setTitle(q))),this._parser.registerOscHandler(4,new N.OscHandler(q=>this.setOrReportIndexedColor(q))),this._parser.registerOscHandler(8,new N.OscHandler(q=>this.setHyperlink(q))),this._parser.registerOscHandler(10,new N.OscHandler(q=>this.setOrReportFgColor(q))),this._parser.registerOscHandler(11,new N.OscHandler(q=>this.setOrReportBgColor(q))),this._parser.registerOscHandler(12,new N.OscHandler(q=>this.setOrReportCursorColor(q))),this._parser.registerOscHandler(104,new N.OscHandler(q=>this.restoreIndexedColor(q))),this._parser.registerOscHandler(110,new N.OscHandler(q=>this.restoreFgColor(q))),this._parser.registerOscHandler(111,new N.OscHandler(q=>this.restoreBgColor(q))),this._parser.registerOscHandler(112,new N.OscHandler(q=>this.restoreCursorColor(q))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let q in h.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},()=>this.selectCharset("("+q)),this._parser.registerEscHandler({intermediates:")",final:q},()=>this.selectCharset(")"+q)),this._parser.registerEscHandler({intermediates:"*",final:q},()=>this.selectCharset("*"+q)),this._parser.registerEscHandler({intermediates:"+",final:q},()=>this.selectCharset("+"+q)),this._parser.registerEscHandler({intermediates:"-",final:q},()=>this.selectCharset("-"+q)),this._parser.registerEscHandler({intermediates:".",final:q},()=>this.selectCharset("."+q)),this._parser.registerEscHandler({intermediates:"/",final:q},()=>this.selectCharset("/"+q));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(q=>(this._logService.error("Parsing error: ",q),q)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new P.DcsHandler((q,Oe)=>this.requestStatusString(q,Oe)))}_preserveStack(B,X,se,ce){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=X,this._parseStack.decodedLength=se,this._parseStack.position=ce}_logSlowResolvingAsync(B){this._logService.logLevel<=I.LogLevelEnum.WARN&&Promise.race([B,new Promise((X,se)=>setTimeout(()=>se("#SLOW_TIMEOUT"),5e3))]).catch(X=>{if(X!=="#SLOW_TIMEOUT")throw X;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,X){let se,ce=this._activeBuffer.x,ke=this._activeBuffer.y,ze=0,Ke=this._parseStack.paused;if(Ke){if(se=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,X))return this._logSlowResolvingAsync(se),se;ce=this._parseStack.cursorStartX,ke=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>oe&&(ze=this._parseStack.position+oe)}if(this._logService.logLevel<=I.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,q=>String.fromCharCode(q)).join("")}"`),typeof B=="string"?B.split("").map(q=>q.charCodeAt(0)):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<oe&&(this._parseBuffer=new Uint32Array(Math.min(B.length,oe))),Ke||this._dirtyRowTracker.clearRange(),B.length>oe)for(let q=ze;q<B.length;q+=oe){let Oe=q+oe<B.length?q+oe:B.length,We=typeof B=="string"?this._stringDecoder.decode(B.substring(q,Oe),this._parseBuffer):this._utf8Decoder.decode(B.subarray(q,Oe),this._parseBuffer);if(se=this._parser.parse(this._parseBuffer,We))return this._preserveStack(ce,ke,We,q),this._logSlowResolvingAsync(se),se}else if(!Ke){let q=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(se=this._parser.parse(this._parseBuffer,q))return this._preserveStack(ce,ke,q,0),this._logSlowResolvingAsync(se),se}this._activeBuffer.x===ce&&this._activeBuffer.y===ke||this._onCursorMove.fire();let Qe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),ye=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);ye<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(ye,this._bufferService.rows-1),Math.min(Qe,this._bufferService.rows-1))}print(B,X,se){let ce,ke,ze=this._charsetService.charset,Ke=this._optionsService.rawOptions.screenReaderMode,Qe=this._bufferService.cols,ye=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,Oe=this._curAttrData,We=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&se-X>0&&We.getWidth(this._activeBuffer.x-1)===2&&We.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Oe);let ct=this._parser.precedingJoinState;for(let Tt=X;Tt<se;++Tt){if(ce=B[Tt],ce<127&&ze){let Br=ze[String.fromCharCode(ce)];Br&&(ce=Br.charCodeAt(0))}let Xn=this._unicodeService.charProperties(ce,ct);ke=D.UnicodeService.extractWidth(Xn);let Io=D.UnicodeService.extractShouldJoin(Xn),_o=Io?D.UnicodeService.extractWidth(ct):0;if(ct=Xn,Ke&&this._onA11yChar.fire((0,x.stringFromCodePoint)(ce)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ke-_o>Qe){if(ye){let Br=We,Rn=this._activeBuffer.x-_o;for(this._activeBuffer.x=_o,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),We=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),_o>0&&We instanceof b.BufferLine&&We.copyCellsFrom(Br,Rn,0,_o,!1);Rn<Qe;)Br.setCellFromCodepoint(Rn++,0,1,Oe)}else if(this._activeBuffer.x=Qe-1,ke===2)continue}if(Io&&this._activeBuffer.x){let Br=We.getWidth(this._activeBuffer.x-1)?1:2;We.addCodepointToCell(this._activeBuffer.x-Br,ce,ke);for(let Rn=ke-_o;--Rn>=0;)We.setCellFromCodepoint(this._activeBuffer.x++,0,0,Oe)}else if(q&&(We.insertCells(this._activeBuffer.x,ke-_o,this._activeBuffer.getNullCell(Oe)),We.getWidth(Qe-1)===2&&We.setCellFromCodepoint(Qe-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,Oe)),We.setCellFromCodepoint(this._activeBuffer.x++,ce,ke,Oe),ke>0)for(;--ke;)We.setCellFromCodepoint(this._activeBuffer.x++,0,0,Oe)}this._parser.precedingJoinState=ct,this._activeBuffer.x<Qe&&se-X>0&&We.getWidth(this._activeBuffer.x)===0&&!We.hasContent(this._activeBuffer.x)&&We.setCellFromCodepoint(this._activeBuffer.x,0,1,Oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,X){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,X):this._parser.registerCsiHandler(B,se=>!G(se.params[0],this._optionsService.rawOptions.windowOptions)||X(se))}registerDcsHandler(B,X){return this._parser.registerDcsHandler(B,new P.DcsHandler(X))}registerEscHandler(B,X){return this._parser.registerEscHandler(B,X)}registerOscHandler(B,X){return this._parser.registerOscHandler(B,new N.OscHandler(X))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(B,X){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+X):(this._activeBuffer.x=B,this._activeBuffer.y=X),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,X){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+X)}cursorUp(B){let X=this._activeBuffer.y-this._activeBuffer.scrollTop;return X>=0?this._moveCursor(0,-Math.min(X,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){let X=this._activeBuffer.scrollBottom-this._activeBuffer.y;return X>=0?this._moveCursor(0,Math.min(X,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){let X=B.params[0];return X===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:X===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let X=B.params[0]||1;for(;X--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let X=B.params[0]||1;for(;X--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){let X=B.params[0];return X===1&&(this._curAttrData.bg|=536870912),X!==2&&X!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,X,se,ce=!1,ke=!1){let ze=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ze.replaceCells(X,se,this._activeBuffer.getNullCell(this._eraseAttrData()),ke),ce&&(ze.isWrapped=!1)}_resetBufferLine(B,X=!1){let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);se&&(se.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),X),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),se.isWrapped=!1)}eraseInDisplay(B,X=!1){let se;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(se=this._activeBuffer.y,this._dirtyRowTracker.markDirty(se),this._eraseInBufferLine(se++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,X);se<this._bufferService.rows;se++)this._resetBufferLine(se,X);this._dirtyRowTracker.markDirty(se);break;case 1:for(se=this._activeBuffer.y,this._dirtyRowTracker.markDirty(se),this._eraseInBufferLine(se,0,this._activeBuffer.x+1,!0,X),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(se+1).isWrapped=!1);se--;)this._resetBufferLine(se,X);this._dirtyRowTracker.markDirty(0);break;case 2:for(se=this._bufferService.rows,this._dirtyRowTracker.markDirty(se-1);se--;)this._resetBufferLine(se,X);this._dirtyRowTracker.markDirty(0);break;case 3:let ce=this._activeBuffer.lines.length-this._bufferService.rows;ce>0&&(this._activeBuffer.lines.trimStart(ce),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-ce,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-ce,0),this._onScroll.fire(0))}return!0}eraseInLine(B,X=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,X);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,X);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,X)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let X=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let se=this._activeBuffer.ybase+this._activeBuffer.y,ce=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ke=this._bufferService.rows-1+this._activeBuffer.ybase-ce+1;for(;X--;)this._activeBuffer.lines.splice(ke-1,1),this._activeBuffer.lines.splice(se,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let X=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let se=this._activeBuffer.ybase+this._activeBuffer.y,ce;for(ce=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ce=this._bufferService.rows-1+this._activeBuffer.ybase-ce;X--;)this._activeBuffer.lines.splice(se,1),this._activeBuffer.lines.splice(ce,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();let X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return X&&(X.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();let X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return X&&(X.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let X=B.params[0]||1;for(;X--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(B){let X=B.params[0]||1;for(;X--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let X=B.params[0]||1;for(let se=this._activeBuffer.scrollTop;se<=this._activeBuffer.scrollBottom;++se){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+se);ce.deleteCells(0,X,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let X=B.params[0]||1;for(let se=this._activeBuffer.scrollTop;se<=this._activeBuffer.scrollBottom;++se){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+se);ce.insertCells(0,X,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let X=B.params[0]||1;for(let se=this._activeBuffer.scrollTop;se<=this._activeBuffer.scrollBottom;++se){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+se);ce.insertCells(this._activeBuffer.x,X,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let X=B.params[0]||1;for(let se=this._activeBuffer.scrollTop;se<=this._activeBuffer.scrollBottom;++se){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+se);ce.deleteCells(this._activeBuffer.x,X,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();let X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return X&&(X.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){let X=this._parser.precedingJoinState;if(!X)return!0;let se=B.params[0]||1,ce=D.UnicodeService.extractWidth(X),ke=this._activeBuffer.x-ce,ze=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ke),Ke=new Uint32Array(ze.length*se),Qe=0;for(let q=0;q<ze.length;){let Oe=ze.codePointAt(q)||0;Ke[Qe++]=Oe,q+=Oe>65535?2:1}let ye=Qe;for(let q=1;q<se;++q)Ke.copyWithin(ye,0,Qe),ye+=Qe;return this.print(Ke,0,ye),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let X=0;X<B.length;X++)switch(B.params[X]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let X=0;X<B.length;X++)switch(B.params[X]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,h.DEFAULT_CHARSET),this._charsetService.setgCharset(1,h.DEFAULT_CHARSET),this._charsetService.setgCharset(2,h.DEFAULT_CHARSET),this._charsetService.setgCharset(3,h.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(B){for(let X=0;X<B.length;X++)switch(B.params[X]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let X=0;X<B.length;X++)switch(B.params[X]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),B.params[X]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(B,X){let se=this._coreService.decPrivateModes,{activeProtocol:ce,activeEncoding:ke}=this._coreMouseService,ze=this._coreService,{buffers:Ke,cols:Qe}=this._bufferService,{active:ye,alt:q}=Ke,Oe=this._optionsService.rawOptions,We=Io=>Io?1:2,ct=B.params[0];return Tt=ct,Xn=X?ct===2?4:ct===4?We(ze.modes.insertMode):ct===12?3:ct===20?We(Oe.convertEol):0:ct===1?We(se.applicationCursorKeys):ct===3?Oe.windowOptions.setWinLines?Qe===80?2:Qe===132?1:0:0:ct===6?We(se.origin):ct===7?We(se.wraparound):ct===8?3:ct===9?We(ce==="X10"):ct===12?We(Oe.cursorBlink):ct===25?We(!ze.isCursorHidden):ct===45?We(se.reverseWraparound):ct===66?We(se.applicationKeypad):ct===67?4:ct===1e3?We(ce==="VT200"):ct===1002?We(ce==="DRAG"):ct===1003?We(ce==="ANY"):ct===1004?We(se.sendFocus):ct===1005?4:ct===1006?We(ke==="SGR"):ct===1015?4:ct===1016?We(ke==="SGR_PIXELS"):ct===1048?1:ct===47||ct===1047||ct===1049?We(ye===q):ct===2004?We(se.bracketedPasteMode):0,ze.triggerDataEvent(`${u.C0.ESC}[${X?"":"?"}${Tt};${Xn}$y`),!0;var Tt,Xn}_updateAttrColor(B,X,se,ce,ke){return X===2?(B|=50331648,B&=-16777216,B|=E.AttributeData.fromColorRGB([se,ce,ke])):X===5&&(B&=-50331904,B|=33554432|255&se),B}_extractColor(B,X,se){let ce=[0,0,-1,0,0,0],ke=0,ze=0;do{if(ce[ze+ke]=B.params[X+ze],B.hasSubParams(X+ze)){let Ke=B.getSubParams(X+ze),Qe=0;do ce[1]===5&&(ke=1),ce[ze+Qe+1+ke]=Ke[Qe];while(++Qe<Ke.length&&Qe+ze+1+ke<ce.length);break}if(ce[1]===5&&ze+ke>=2||ce[1]===2&&ze+ke>=5)break;ce[1]&&(ke=1)}while(++ze+X<B.length&&ze+ke<ce.length);for(let Ke=2;Ke<ce.length;++Ke)ce[Ke]===-1&&(ce[Ke]=0);switch(ce[0]){case 38:se.fg=this._updateAttrColor(se.fg,ce[1],ce[3],ce[4],ce[5]);break;case 48:se.bg=this._updateAttrColor(se.bg,ce[1],ce[3],ce[4],ce[5]);break;case 58:se.extended=se.extended.clone(),se.extended.underlineColor=this._updateAttrColor(se.extended.underlineColor,ce[1],ce[3],ce[4],ce[5])}return ze}_processUnderline(B,X){X.extended=X.extended.clone(),(!~B||B>5)&&(B=1),X.extended.underlineStyle=B,X.fg|=268435456,B===0&&(X.fg&=-268435457),X.updateExtended()}_processSGR0(B){B.fg=b.DEFAULT_ATTR_DATA.fg,B.bg=b.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;let X=B.length,se,ce=this._curAttrData;for(let ke=0;ke<X;ke++)se=B.params[ke],se>=30&&se<=37?(ce.fg&=-50331904,ce.fg|=16777216|se-30):se>=40&&se<=47?(ce.bg&=-50331904,ce.bg|=16777216|se-40):se>=90&&se<=97?(ce.fg&=-50331904,ce.fg|=16777224|se-90):se>=100&&se<=107?(ce.bg&=-50331904,ce.bg|=16777224|se-100):se===0?this._processSGR0(ce):se===1?ce.fg|=134217728:se===3?ce.bg|=67108864:se===4?(ce.fg|=268435456,this._processUnderline(B.hasSubParams(ke)?B.getSubParams(ke)[0]:1,ce)):se===5?ce.fg|=536870912:se===7?ce.fg|=67108864:se===8?ce.fg|=1073741824:se===9?ce.fg|=2147483648:se===2?ce.bg|=134217728:se===21?this._processUnderline(2,ce):se===22?(ce.fg&=-134217729,ce.bg&=-134217729):se===23?ce.bg&=-67108865:se===24?(ce.fg&=-268435457,this._processUnderline(0,ce)):se===25?ce.fg&=-536870913:se===27?ce.fg&=-67108865:se===28?ce.fg&=-1073741825:se===29?ce.fg&=2147483647:se===39?(ce.fg&=-67108864,ce.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):se===49?(ce.bg&=-67108864,ce.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):se===38||se===48||se===58?ke+=this._extractColor(B,ke,ce):se===53?ce.bg|=1073741824:se===55?ce.bg&=-1073741825:se===59?(ce.extended=ce.extended.clone(),ce.extended.underlineColor=-1,ce.updateExtended()):se===100?(ce.fg&=-67108864,ce.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,ce.bg&=-67108864,ce.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",se);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:let X=this._activeBuffer.y+1,se=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${X};${se}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){let X=this._activeBuffer.y+1,se=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${X};${se}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(B){let X=B.params[0]||1;switch(X){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}let se=X%2==1;return this._optionsService.options.cursorBlink=se,!0}setScrollRegion(B){let X=B.params[0]||1,se;return(B.length<2||(se=B.params[1])>this._bufferService.rows||se===0)&&(se=this._bufferService.rows),se>X&&(this._activeBuffer.scrollTop=X-1,this._activeBuffer.scrollBottom=se-1,this._setCursor(0,0)),!0}windowOptions(B){if(!G(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;let X=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:X!==2&&this._onRequestWindowsOptionsReport.fire($.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire($.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:X!==0&&X!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),X!==0&&X!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:X!==0&&X!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),X!==0&&X!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(B){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){let X=[],se=B.split(";");for(;se.length>1;){let ce=se.shift(),ke=se.shift();if(/^\d+$/.exec(ce)){let ze=parseInt(ce);if(De(ze))if(ke==="?")X.push({type:0,index:ze});else{let Ke=(0,L.parseColor)(ke);Ke&&X.push({type:1,index:ze,color:Ke})}}}return X.length&&this._onColor.fire(X),!0}setHyperlink(B){let X=B.split(";");return!(X.length<2)&&(X[1]?this._createHyperlink(X[0],X[1]):!X[0]&&this._finishHyperlink())}_createHyperlink(B,X){this._getCurrentLinkId()&&this._finishHyperlink();let se=B.split(":"),ce,ke=se.findIndex(ze=>ze.startsWith("id="));return ke!==-1&&(ce=se[ke].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:ce,uri:X}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,X){let se=B.split(";");for(let ce=0;ce<se.length&&!(X>=this._specialColors.length);++ce,++X)if(se[ce]==="?")this._onColor.fire([{type:0,index:this._specialColors[X]}]);else{let ke=(0,L.parseColor)(se[ce]);ke&&this._onColor.fire([{type:1,index:this._specialColors[X],color:ke}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;let X=[],se=B.split(";");for(let ce=0;ce<se.length;++ce)if(/^\d+$/.exec(se[ce])){let ke=parseInt(se[ce]);De(ke)&&X.push({type:2,index:ke})}return X.length&&this._onColor.fire(X),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,h.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(re[B[0]],h.CHARSETS[B[1]]||h.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){let B=new y.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let X=0;X<this._bufferService.rows;++X){let se=this._activeBuffer.ybase+this._activeBuffer.y+X,ce=this._activeBuffer.lines.get(se);ce&&(ce.fill(B),ce.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,X){let se=this._bufferService.buffer,ce=this._optionsService.rawOptions;return(ke=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${ke}${u.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${se.scrollTop+1};${se.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[ce.cursorStyle]-(ce.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,X){this._dirtyRowTracker.markRangeDirty(B,X)}}r.InputHandler=be;let me=class{constructor(he){this._bufferService=he,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(he){he<this.start?this.start=he:he>this.end&&(this.end=he)}markRangeDirty(he,B){he>B&&(ue=he,he=B,B=ue),he<this.start&&(this.start=he),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function De(he){return 0<=he&&he<256}me=c([p(0,I.IBufferService)],me)},844:(o,r)=>{function a(c){for(let p of c)p.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){let p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){this._isDisposed||c===this._value||(this._value?.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=a,r.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(p,u,h){this._data[p]||(this._data[p]={}),this._data[p][u]=h}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}r.TwoKeyMap=a,r.FourKeyMap=class{constructor(){this._data=new a}set(c,p,u,h,_){this._data.get(c,p)||this._data.set(c,p,new a),this._data.get(c,p).set(u,h,_)}get(c,p,u,h){return this._data.get(c,p)?.get(u,h)}clear(){this._data.clear()}}},6114:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;let a=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=a.includes("Firefox"),r.isLegacyEdge=a.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(a),r.getSafariVersion=function(){if(!r.isSafari)return 0;let p=a.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(a)},6106:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let a=0;r.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;let p=this._getKey(c);if(p===void 0||(a=this._search(p),a===-1)||this._getKey(this._array[a])!==p)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===p);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,p){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do p(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let p=0,u=this._array.length-1;for(;u>=p;){let h=p+u>>1,_=this._getKey(this._array[h]);if(_>c)u=h-1;else{if(!(_<c)){for(;h>0&&this._getKey(this._array[h-1])===c;)h--;return h}p=h+1}}return p}}},7226:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;let c=a(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let S=0,x=0,b=_.timeRemaining(),M=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),x=Math.max(S,x),M=_.timeRemaining(),1.5*x>M)return b-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-S))}ms`),void this._start();b=M}this.clear()}}class u extends p{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){let S=Date.now()+_;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}r.PriorityTaskQueue=u,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(h){return requestIdleCallback(h)}_cancelCallback(h){cancelIdleCallback(h)}}:u,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(h){this._queue.clear(),this._queue.enqueue(h)}flush(){this._queue.flush()}}},9282:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;let c=a(643);r.updateWindowsModeWrappedState=function(p){let u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),h=u?.get(p.cols-1),_=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);_&&h&&(_.isWrapped=h[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&h[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){let u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){let u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,h=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=h}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},9092:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;let c=a(6349),p=a(7226),u=a(3734),h=a(8437),_=a(4634),S=a(511),x=a(643),b=a(4863),M=a(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(w,y,E){this._hasScrollback=w,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=h.DEFAULT_ATTR_DATA.clone(),this.savedCharset=M.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new h.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let w=this.ybase+this.y-this.ydisp;return w>=0&&w<this._rows}_getCorrectBufferLength(w){if(!this._hasScrollback)return w;let y=w+this._optionsService.rawOptions.scrollback;return y>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=h.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){let E=this.getNullCell(h.DEFAULT_ATTR_DATA),I=0,D=this._getCorrectBufferLength(y);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<w)for(let P=0;P<this.lines.length;P++)I+=+this.lines.get(P).resize(w,E);let N=0;if(this._rows<y)for(let P=this._rows;P<y;P++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new h.BufferLine(w,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+N+1?(this.ybase--,N++,this.ydisp>0&&this.ydisp--):this.lines.push(new h.BufferLine(w,E)));else for(let P=this._rows;P>y;P--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){let P=this.lines.length-D;P>0&&(this.lines.trimStart(P),this.ybase=Math.max(this.ybase-P,0),this.ydisp=Math.max(this.ydisp-P,0),this.savedY=Math.max(this.savedY-P,0)),this.lines.maxLength=D}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),N&&(this.y+=N),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let N=0;N<this.lines.length;N++)I+=+this.lines.get(N).resize(w,E);this._cols=w,this._rows=y,this._memoryCleanupQueue.clear(),I>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return w}get _isReflowEnabled(){let w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){let E=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(h.DEFAULT_ATTR_DATA));if(E.length>0){let I=(0,_.reflowLargerCreateNewLayout)(this.lines,E);(0,_.reflowLargerApplyNewLayout)(this.lines,I.layout),this._reflowLargerAdjustViewport(w,y,I.countRemoved)}}_reflowLargerAdjustViewport(w,y,E){let I=this.getNullCell(h.DEFAULT_ATTR_DATA),D=E;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new h.BufferLine(w,I))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(w,y){let E=this.getNullCell(h.DEFAULT_ATTR_DATA),I=[],D=0;for(let N=this.lines.length-1;N>=0;N--){let P=this.lines.get(N);if(!P||!P.isWrapped&&P.getTrimmedLength()<=w)continue;let L=[P];for(;P.isWrapped&&N>0;)P=this.lines.get(--N),L.unshift(P);let re=this.ybase+this.y;if(re>=N&&re<N+L.length)continue;let oe=L[L.length-1].getTrimmedLength(),G=(0,_.reflowSmallerGetNewLineLengths)(L,this._cols,w),$=G.length-L.length,ue;ue=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);let be=[];for(let se=0;se<$;se++){let ce=this.getBlankLine(h.DEFAULT_ATTR_DATA,!0);be.push(ce)}be.length>0&&(I.push({start:N+L.length+D,newLines:be}),D+=be.length),L.push(...be);let me=G.length-1,De=G[me];De===0&&(me--,De=G[me]);let he=L.length-$-1,B=oe;for(;he>=0;){let se=Math.min(B,De);if(L[me]===void 0)break;if(L[me].copyCellsFrom(L[he],B-se,De-se,se,!0),De-=se,De===0&&(me--,De=G[me]),B-=se,B===0){he--;let ce=Math.max(he,0);B=(0,_.getWrappedLineTrimmedLength)(L,ce,this._cols)}}for(let se=0;se<L.length;se++)G[se]<w&&L[se].setCell(G[se],E);let X=$-ue;for(;X-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+y-1)}if(I.length>0){let N=[],P=[];for(let me=0;me<this.lines.length;me++)P.push(this.lines.get(me));let L=this.lines.length,re=L-1,oe=0,G=I[oe];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let $=0;for(let me=Math.min(this.lines.maxLength-1,L+D-1);me>=0;me--)if(G&&G.start>re+$){for(let De=G.newLines.length-1;De>=0;De--)this.lines.set(me--,G.newLines[De]);me++,N.push({index:re+1,amount:G.newLines.length}),$+=G.newLines.length,G=I[++oe]}else this.lines.set(me,P[re--]);let ue=0;for(let me=N.length-1;me>=0;me--)N[me].index+=ue,this.lines.onInsertEmitter.fire(N[me]),ue+=N[me].amount;let be=Math.max(0,L+D-this.lines.maxLength);be>0&&this.lines.onTrimEmitter.fire(be)}}translateBufferLineToString(w,y,E=0,I){let D=this.lines.get(w);return D?D.translateToString(y,E,I):""}getWrappedRangeForLine(w){let y=w,E=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(w){for(w!=null?this.tabs[w]||(w=this.prevStop(w)):(this.tabs={},w=0);w<this._cols;w+=this._optionsService.rawOptions.tabStopWidth)this.tabs[w]=!0}prevStop(w){for(w==null&&(w=this.x);!this.tabs[--w]&&w>0;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w<this._cols;);return w>=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===w&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let w=0;w<this.markers.length;w++)this.markers[w].dispose(),this.markers.splice(w--,1);this._isClearing=!1}addMarker(w){let y=new b.Marker(w);return this.markers.push(y),y.register(this.lines.onTrim(E=>{y.line-=E,y.line<0&&y.dispose()})),y.register(this.lines.onInsert(E=>{y.line>=E.index&&(y.line+=E.amount)})),y.register(this.lines.onDelete(E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)})),y.register(y.onDispose(()=>this._removeMarker(y))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;let c=a(3734),p=a(511),u=a(643),h=a(482);r.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class S{constructor(b,M,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);let y=M||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let E=0;E<b;++E)this.setCell(E,y);this.length=b}get(b){let M=this._data[3*b+0],w=2097151&M;return[this._data[3*b+1],2097152&M?this._combined[b]:w?(0,h.stringFromCodePoint)(w):"",M>>22,2097152&M?this._combined[b].charCodeAt(this._combined[b].length-1):w]}set(b,M){this._data[3*b+1]=M[u.CHAR_DATA_ATTR_INDEX],M[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=M[1],this._data[3*b+0]=2097152|b|M[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=M[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|M[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){let M=this._data[3*b+0];return 2097152&M?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&M}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){let M=this._data[3*b+0];return 2097152&M?this._combined[b]:2097151&M?(0,h.stringFromCodePoint)(2097151&M):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,M){return _=3*b,M.content=this._data[_+0],M.fg=this._data[_+1],M.bg=this._data[_+2],2097152&M.content&&(M.combinedData=this._combined[b]),268435456&M.bg&&(M.extended=this._extendedAttrs[b]),M}setCell(b,M){2097152&M.content&&(this._combined[b]=M.combinedData),268435456&M.bg&&(this._extendedAttrs[b]=M.extended),this._data[3*b+0]=M.content,this._data[3*b+1]=M.fg,this._data[3*b+2]=M.bg}setCellFromCodepoint(b,M,w,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=M|w<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,M,w){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,h.stringFromCodePoint)(M):2097151&y?(this._combined[b]=(0,h.stringFromCodePoint)(2097151&y)+(0,h.stringFromCodePoint)(M),y&=-2097152,y|=2097152):y=M|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*b+0]=y}insertCells(b,M,w){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,w),M<this.length-b){let y=new p.CellData;for(let E=this.length-b-M-1;E>=0;--E)this.setCell(b+M+E,this.loadCell(b+E,y));for(let E=0;E<M;++E)this.setCell(b+E,w)}else for(let y=b;y<this.length;++y)this.setCell(y,w);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,w)}deleteCells(b,M,w){if(b%=this.length,M<this.length-b){let y=new p.CellData;for(let E=0;E<this.length-b-M;++E)this.setCell(b+E,this.loadCell(b+M+E,y));for(let E=this.length-M;E<this.length;++E)this.setCell(E,w)}else for(let y=b;y<this.length;++y)this.setCell(y,w);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,w),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,w)}replaceCells(b,M,w,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,w),M<this.length&&this.getWidth(M-1)===2&&!this.isProtected(M)&&this.setCellFromCodepoint(M,0,1,w);b<M&&b<this.length;)this.isProtected(b)||this.setCell(b,w),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,w),M<this.length&&this.getWidth(M-1)===2&&this.setCellFromCodepoint(M,0,1,w);b<M&&b<this.length;)this.setCell(b++,w)}resize(b,M){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let w=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{let y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,M)}else{this._data=this._data.subarray(0,w);let y=Object.keys(this._combined);for(let I=0;I<y.length;I++){let D=parseInt(y[I],10);D>=b&&delete this._combined[D]}let E=Object.keys(this._extendedAttrs);for(let I=0;I<E.length;I++){let D=parseInt(E[I],10);D>=b&&delete this._extendedAttrs[D]}}return this.length=b,4*w*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,M=!1){if(M)for(let w=0;w<this.length;++w)this.isProtected(w)||this.setCell(w,b);else{this._combined={},this._extendedAttrs={};for(let w=0;w<this.length;++w)this.setCell(w,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(let M in b._combined)this._combined[M]=b._combined[M];this._extendedAttrs={};for(let M in b._extendedAttrs)this._extendedAttrs[M]=b._extendedAttrs[M];this.isWrapped=b.isWrapped}clone(){let b=new S(0);b._data=new Uint32Array(this._data),b.length=this.length;for(let M in this._combined)b._combined[M]=this._combined[M];for(let M in this._extendedAttrs)b._extendedAttrs[M]=this._extendedAttrs[M];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,M,w,y,E){let I=b._data;if(E)for(let N=y-1;N>=0;N--){for(let P=0;P<3;P++)this._data[3*(w+N)+P]=I[3*(M+N)+P];268435456&I[3*(M+N)+2]&&(this._extendedAttrs[w+N]=b._extendedAttrs[M+N])}else for(let N=0;N<y;N++){for(let P=0;P<3;P++)this._data[3*(w+N)+P]=I[3*(M+N)+P];268435456&I[3*(M+N)+2]&&(this._extendedAttrs[w+N]=b._extendedAttrs[M+N])}let D=Object.keys(b._combined);for(let N=0;N<D.length;N++){let P=parseInt(D[N],10);P>=M&&(this._combined[P-M+w]=b._combined[P])}}translateToString(b,M,w,y){M=M??0,w=w??this.length,b&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let E="";for(;M<w;){let I=this._data[3*M+0],D=2097151&I,N=2097152&I?this._combined[M]:D?(0,h.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(E+=N,y)for(let P=0;P<N.length;++P)y.push(M);M+=I>>22||1}return y&&y.push(M),E}}r.BufferLine=S},4841:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(o,r)=>{function a(c,p,u){if(p===c.length-1)return c[p].getTrimmedLength();let h=!c[p].hasContent(u-1)&&c[p].getWidth(u-1)===1,_=c[p+1].getWidth(0)===2;return h&&_?u-1:u}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(c,p,u,h,_){let S=[];for(let x=0;x<c.length-1;x++){let b=x,M=c.get(++b);if(!M.isWrapped)continue;let w=[c.get(x)];for(;b<c.length&&M.isWrapped;)w.push(M),M=c.get(++b);if(h>=x&&h<b){x+=w.length-1;continue}let y=0,E=a(w,y,p),I=1,D=0;for(;I<w.length;){let P=a(w,I,p),L=P-D,re=u-E,oe=Math.min(L,re);w[y].copyCellsFrom(w[I],D,E,oe,!1),E+=oe,E===u&&(y++,E=0),D+=oe,D===P&&(I++,D=0),E===0&&y!==0&&w[y-1].getWidth(u-1)===2&&(w[y].copyCellsFrom(w[y-1],u-1,E++,1,!1),w[y-1].setCell(u-1,_))}w[y].replaceCells(E,u,_);let N=0;for(let P=w.length-1;P>0&&(P>y||w[P].getTrimmedLength()===0);P--)N++;N>0&&(S.push(x+w.length-N),S.push(N)),x+=w.length-1}return S},r.reflowLargerCreateNewLayout=function(c,p){let u=[],h=0,_=p[h],S=0;for(let x=0;x<c.length;x++)if(_===x){let b=p[++h];c.onDeleteEmitter.fire({index:x-S,amount:b}),x+=b-1,S+=b,_=p[++h]}else u.push(x);return{layout:u,countRemoved:S}},r.reflowLargerApplyNewLayout=function(c,p){let u=[];for(let h=0;h<p.length;h++)u.push(c.get(p[h]));for(let h=0;h<u.length;h++)c.set(h,u[h]);c.length=p.length},r.reflowSmallerGetNewLineLengths=function(c,p,u){let h=[],_=c.map((M,w)=>a(c,w,p)).reduce((M,w)=>M+w),S=0,x=0,b=0;for(;b<_;){if(_-b<u){h.push(_-b);break}S+=u;let M=a(c,x,p);S>M&&(S-=M,x++);let w=c[x].getWidth(S-1)===2;w&&S--;let y=w?u-1:u;h.push(y),b+=y}return h},r.getWrappedLineTrimmedLength=a},5295:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;let c=a(8460),p=a(844),u=a(9092);class h extends p.Disposable{constructor(S,x){super(),this._optionsService=S,this._bufferService=x,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(S,x){this._normal.resize(S,x),this._alt.resize(S,x),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}r.BufferSet=h},511:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;let c=a(482),p=a(643),u=a(3734);class h extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){let x=new h;return x.setFromCharData(S),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(S[p.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(S[p.CHAR_DATA_CHAR_INDEX].length===2){let b=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){let M=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=M&&M<=57343?this.content=1024*(b-55296)+M-56320+65536|S[p.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[p.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=S[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=h},643:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;let c=a(8460),p=a(844);class u{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}r.Marker=u,u._nextId=1},7116:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},r.CHARSETS.A={"#":"\xA3"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},r.CHARSETS.C=r.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},r.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},r.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},r.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},r.CHARSETS.E=r.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},r.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},r.CHARSETS.H=r.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(o,r)=>{var a,c,p;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL="\x7F"})(a||(r.C0=a={})),(function(u){u.PAD="\x80",u.HOP="\x81",u.BPH="\x82",u.NBH="\x83",u.IND="\x84",u.NEL="\x85",u.SSA="\x86",u.ESA="\x87",u.HTS="\x88",u.HTJ="\x89",u.VTS="\x8A",u.PLD="\x8B",u.PLU="\x8C",u.RI="\x8D",u.SS2="\x8E",u.SS3="\x8F",u.DCS="\x90",u.PU1="\x91",u.PU2="\x92",u.STS="\x93",u.CCH="\x94",u.MW="\x95",u.SPA="\x96",u.EPA="\x97",u.SOS="\x98",u.SGCI="\x99",u.SCI="\x9A",u.CSI="\x9B",u.ST="\x9C",u.OSC="\x9D",u.PM="\x9E",u.APC="\x9F"})(c||(r.C1=c={})),(function(u){u.ST=`${a.ESC}\\`})(p||(r.C1_ESCAPED=p={}))},7399:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;let c=a(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(u,h,_,S){let x={type:0,cancel:!1,key:void 0},b=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?x.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?x.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?x.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(x.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:x.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(x.key=c.C0.ESC+x.key);break;case 9:if(u.shiftKey){x.key=c.C0.ESC+"[Z";break}x.key=c.C0.HT,x.cancel=!0;break;case 13:x.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,x.cancel=!0;break;case 27:x.key=c.C0.ESC,u.altKey&&(x.key=c.C0.ESC+c.C0.ESC),x.cancel=!0;break;case 37:if(u.metaKey)break;b?(x.key=c.C0.ESC+"[1;"+(b+1)+"D",x.key===c.C0.ESC+"[1;3D"&&(x.key=c.C0.ESC+(_?"b":"[1;5D"))):x.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;b?(x.key=c.C0.ESC+"[1;"+(b+1)+"C",x.key===c.C0.ESC+"[1;3C"&&(x.key=c.C0.ESC+(_?"f":"[1;5C"))):x.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;b?(x.key=c.C0.ESC+"[1;"+(b+1)+"A",_||x.key!==c.C0.ESC+"[1;3A"||(x.key=c.C0.ESC+"[1;5A")):x.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;b?(x.key=c.C0.ESC+"[1;"+(b+1)+"B",_||x.key!==c.C0.ESC+"[1;3B"||(x.key=c.C0.ESC+"[1;5B")):x.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(x.key=c.C0.ESC+"[2~");break;case 46:x.key=b?c.C0.ESC+"[3;"+(b+1)+"~":c.C0.ESC+"[3~";break;case 36:x.key=b?c.C0.ESC+"[1;"+(b+1)+"H":h?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:x.key=b?c.C0.ESC+"[1;"+(b+1)+"F":h?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?x.type=2:u.ctrlKey?x.key=c.C0.ESC+"[5;"+(b+1)+"~":x.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?x.type=3:u.ctrlKey?x.key=c.C0.ESC+"[6;"+(b+1)+"~":x.key=c.C0.ESC+"[6~";break;case 112:x.key=b?c.C0.ESC+"[1;"+(b+1)+"P":c.C0.ESC+"OP";break;case 113:x.key=b?c.C0.ESC+"[1;"+(b+1)+"Q":c.C0.ESC+"OQ";break;case 114:x.key=b?c.C0.ESC+"[1;"+(b+1)+"R":c.C0.ESC+"OR";break;case 115:x.key=b?c.C0.ESC+"[1;"+(b+1)+"S":c.C0.ESC+"OS";break;case 116:x.key=b?c.C0.ESC+"[15;"+(b+1)+"~":c.C0.ESC+"[15~";break;case 117:x.key=b?c.C0.ESC+"[17;"+(b+1)+"~":c.C0.ESC+"[17~";break;case 118:x.key=b?c.C0.ESC+"[18;"+(b+1)+"~":c.C0.ESC+"[18~";break;case 119:x.key=b?c.C0.ESC+"[19;"+(b+1)+"~":c.C0.ESC+"[19~";break;case 120:x.key=b?c.C0.ESC+"[20;"+(b+1)+"~":c.C0.ESC+"[20~";break;case 121:x.key=b?c.C0.ESC+"[21;"+(b+1)+"~":c.C0.ESC+"[21~";break;case 122:x.key=b?c.C0.ESC+"[23;"+(b+1)+"~":c.C0.ESC+"[23~";break;case 123:x.key=b?c.C0.ESC+"[24;"+(b+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(_&&!S||!u.altKey||u.metaKey)!_||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?x.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(x.key=c.C0.US),u.key==="@"&&(x.key=c.C0.NUL)):u.keyCode===65&&(x.type=1);else{let M=p[u.keyCode],w=M?.[u.shiftKey?1:0];if(w)x.key=c.C0.ESC+w;else if(u.keyCode>=65&&u.keyCode<=90){let y=u.ctrlKey?u.keyCode-64:u.keyCode+32,E=String.fromCharCode(y);u.shiftKey&&(E=E.toUpperCase()),x.key=c.C0.ESC+E}else if(u.keyCode===32)x.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let y=u.code.slice(3,4);u.shiftKey||(y=y.toLowerCase()),x.key=c.C0.ESC+y,x.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?x.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?x.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?x.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?x.key=c.C0.DEL:u.keyCode===219?x.key=c.C0.ESC:u.keyCode===220?x.key=c.C0.FS:u.keyCode===221&&(x.key=c.C0.GS)}return x}},482:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},r.utf32ToString=function(a,c=0,p=a.length){let u="";for(let h=c;h<p;++h){let _=a[h];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){let p=a.length;if(!p)return 0;let u=0,h=0;if(this._interim){let _=a.charCodeAt(h++);56320<=_&&_<=57343?c[u++]=1024*(this._interim-55296)+_-56320+65536:(c[u++]=this._interim,c[u++]=_),this._interim=0}for(let _=h;_<p;++_){let S=a.charCodeAt(_);if(55296<=S&&S<=56319){if(++_>=p)return this._interim=S,u;let x=a.charCodeAt(_);56320<=x&&x<=57343?c[u++]=1024*(S-55296)+x-56320+65536:(c[u++]=S,c[u++]=x)}else S!==65279&&(c[u++]=S)}return u}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){let p=a.length;if(!p)return 0;let u,h,_,S,x=0,b=0,M=0;if(this.interim[0]){let E=!1,I=this.interim[0];I&=(224&I)==192?31:(240&I)==224?15:7;let D,N=0;for(;(D=63&this.interim[++N])&&N<4;)I<<=6,I|=D;let P=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=P-N;for(;M<L;){if(M>=p)return 0;if(D=a[M++],(192&D)!=128){M--,E=!0;break}this.interim[N++]=D,I<<=6,I|=63&D}E||(P===2?I<128?M--:c[x++]=I:P===3?I<2048||I>=55296&&I<=57343||I===65279||(c[x++]=I):I<65536||I>1114111||(c[x++]=I)),this.interim.fill(0)}let w=p-4,y=M;for(;y<p;){for(;!(!(y<w)||128&(u=a[y])||128&(h=a[y+1])||128&(_=a[y+2])||128&(S=a[y+3]));)c[x++]=u,c[x++]=h,c[x++]=_,c[x++]=S,y+=4;if(u=a[y++],u<128)c[x++]=u;else if((224&u)==192){if(y>=p)return this.interim[0]=u,x;if(h=a[y++],(192&h)!=128){y--;continue}if(b=(31&u)<<6|63&h,b<128){y--;continue}c[x++]=b}else if((240&u)==224){if(y>=p)return this.interim[0]=u,x;if(h=a[y++],(192&h)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=h,x;if(_=a[y++],(192&_)!=128){y--;continue}if(b=(15&u)<<12|(63&h)<<6|63&_,b<2048||b>=55296&&b<=57343||b===65279)continue;c[x++]=b}else if((248&u)==240){if(y>=p)return this.interim[0]=u,x;if(h=a[y++],(192&h)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=h,x;if(_=a[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=h,this.interim[2]=_,x;if(S=a[y++],(192&S)!=128){y--;continue}if(b=(7&u)<<18|(63&h)<<12|(63&_)<<6|63&S,b<65536||b>1114111)continue;c[x++]=b}}return x}}},225:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;let c=a(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],h;r.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let _=0;_<p.length;++_)h.fill(0,p[_][0],p[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?h[_]:(function(S,x){let b,M=0,w=x.length-1;if(S<x[0][0]||S>x[w][1])return!1;for(;w>=M;)if(b=M+w>>1,S>x[b][1])M=b+1;else{if(!(S<x[b][0]))return!0;w=b-1}return!1})(_,u)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,S){let x=this.wcwidth(_),b=x===0&&S!==0;if(b){let M=c.UnicodeService.extractWidth(S);M===0?b=!1:M>x&&(x=M)}return c.UnicodeService.createPropertyValue(0,x,b)}}},5981:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;let c=a(8460),p=a(844);class u extends p.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);let b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,S){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(S),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(S)}_innerWrite(_=0,S=!0){let x=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let b=this._writeBuffer[this._bufferOffset],M=this._action(b,S);if(M){let y=E=>Date.now()-x>=12?setTimeout(()=>this._innerWrite(0,E)):this._innerWrite(x,E);return void M.catch(E=>(queueMicrotask(()=>{throw E}),Promise.resolve(!1))).then(y)}let w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}r.WriteBuffer=u},5941:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;let a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function p(u,h){let _=u.toString(16),S=_.length<2?"0"+_:_;switch(h){case 4:return _[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}r.parseColor=function(u){if(!u)return;let h=u.toLowerCase();if(h.indexOf("rgb:")===0){h=h.slice(4);let _=a.exec(h);if(_){let S=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/S*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/S*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/S*255)]}}else if(h.indexOf("#")===0&&(h=h.slice(1),c.exec(h)&&[3,6,9,12].includes(h.length))){let _=h.length/3,S=[0,0,0];for(let x=0;x<3;++x){let b=parseInt(h.slice(_*x,_*x+_),16);S[x]=_===1?b<<4:_===2?b:_===3?b>>4:b>>8}return S}},r.toRgbString=function(u,h=16){let[_,S,x]=u;return`rgb:${p(_,h)}/${p(S,h)}/${p(x,h)}`}},5770:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;let c=a(482),p=a(8742),u=a(5770),h=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=h,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}registerHandler(S,x){this._handlers[S]===void 0&&(this._handlers[S]=[]);let b=this._handlers[S];return b.push(x),{dispose:()=>{let M=b.indexOf(x);M!==-1&&b.splice(M,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=h,this._ident=0}hook(S,x){if(this.reset(),this._ident=S,this._active=this._handlers[S]||h,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(S,x,b){if(this._active.length)for(let M=this._active.length-1;M>=0;M--)this._active[M].put(S,x,b);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(S,x,b))}unhook(S,x=!0){if(this._active.length){let b=!1,M=this._active.length-1,w=!1;if(this._stack.paused&&(M=this._stack.loopPosition-1,b=x,w=this._stack.fallThrough,this._stack.paused=!1),!w&&b===!1){for(;M>=0&&(b=this._active[M].unhook(S),b!==!0);M--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=M,this._stack.fallThrough=!1,b;M--}for(;M>=0;M--)if(b=this._active[M].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=M,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",S);this._active=h,this._ident=0}};let _=new p.Params;_.addParam(0),r.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=_,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():_,this._data="",this._hitLimit=!1}put(S,x,b){this._hitLimit||(this._data+=(0,c.utf32ToString)(S,x,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let x=!1;if(this._hitLimit)x=!1;else if(S&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then(b=>(this._params=_,this._data="",this._hitLimit=!1,b));return this._params=_,this._data="",this._hitLimit=!1,x}}},2015:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;let c=a(844),p=a(8742),u=a(6242),h=a(6351);class _{constructor(M){this.table=new Uint8Array(M)}setDefault(M,w){this.table.fill(M<<4|w)}add(M,w,y,E){this.table[w<<8|M]=y<<4|E}addMany(M,w,y,E){for(let I=0;I<M.length;I++)this.table[w<<8|M[I]]=y<<4|E}}r.TransitionTable=_;let S=160;r.VT500_TRANSITION_TABLE=(function(){let b=new _(4095),M=Array.apply(null,Array(256)).map((N,P)=>P),w=(N,P)=>M.slice(N,P),y=w(32,127),E=w(0,24);E.push(25),E.push.apply(E,w(28,32));let I=w(0,14),D;for(D in b.setDefault(1,0),b.addMany(y,0,2,0),I)b.addMany([24,26,153,154],D,3,0),b.addMany(w(128,144),D,3,0),b.addMany(w(144,152),D,3,0),b.add(156,D,0,0),b.add(27,D,11,1),b.add(157,D,4,8),b.addMany([152,158,159],D,0,7),b.add(155,D,11,3),b.add(144,D,11,9);return b.addMany(E,0,3,0),b.addMany(E,1,3,1),b.add(127,1,0,1),b.addMany(E,8,0,8),b.addMany(E,3,3,3),b.add(127,3,0,3),b.addMany(E,4,3,4),b.add(127,4,0,4),b.addMany(E,6,3,6),b.addMany(E,5,3,5),b.add(127,5,0,5),b.addMany(E,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(w(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(E,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(w(64,127),3,7,0),b.addMany(w(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(w(48,60),4,8,4),b.addMany(w(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(w(32,64),6,0,6),b.add(127,6,0,6),b.addMany(w(64,127),6,0,0),b.addMany(w(32,48),3,9,5),b.addMany(w(32,48),5,9,5),b.addMany(w(48,64),5,0,6),b.addMany(w(64,127),5,7,0),b.addMany(w(32,48),4,9,5),b.addMany(w(32,48),1,9,2),b.addMany(w(32,48),2,9,2),b.addMany(w(48,127),2,10,0),b.addMany(w(48,80),1,10,0),b.addMany(w(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(w(96,127),1,10,0),b.add(80,1,11,9),b.addMany(E,9,0,9),b.add(127,9,0,9),b.addMany(w(28,32),9,0,9),b.addMany(w(32,48),9,9,12),b.addMany(w(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(E,11,0,11),b.addMany(w(32,128),11,0,11),b.addMany(w(28,32),11,0,11),b.addMany(E,10,0,10),b.add(127,10,0,10),b.addMany(w(28,32),10,0,10),b.addMany(w(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(w(32,48),10,9,12),b.addMany(E,12,0,12),b.add(127,12,0,12),b.addMany(w(28,32),12,0,12),b.addMany(w(32,48),12,9,12),b.addMany(w(48,64),12,0,11),b.addMany(w(64,127),12,12,13),b.addMany(w(64,127),10,12,13),b.addMany(w(64,127),9,12,13),b.addMany(E,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(S,0,2,0),b.add(S,8,5,8),b.add(S,6,0,6),b.add(S,11,0,11),b.add(S,13,13,13),b})();class x extends c.Disposable{constructor(M=r.VT500_TRANSITION_TABLE){super(),this._transitions=M,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,E)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new h.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(M,w=[64,126]){let y=0;if(M.prefix){if(M.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=M.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(M.intermediates){if(M.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let I=0;I<M.intermediates.length;++I){let D=M.intermediates.charCodeAt(I);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=D}}if(M.final.length!==1)throw new Error("final must be a single byte");let E=M.final.charCodeAt(0);if(w[0]>E||E>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=E,y}identToString(M){let w=[];for(;M;)w.push(String.fromCharCode(255&M)),M>>=8;return w.reverse().join("")}setPrintHandler(M){this._printHandler=M}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(M,w){let y=this._identifier(M,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);let E=this._escHandlers[y];return E.push(w),{dispose:()=>{let I=E.indexOf(w);I!==-1&&E.splice(I,1)}}}clearEscHandler(M){this._escHandlers[this._identifier(M,[48,126])]&&delete this._escHandlers[this._identifier(M,[48,126])]}setEscHandlerFallback(M){this._escHandlerFb=M}setExecuteHandler(M,w){this._executeHandlers[M.charCodeAt(0)]=w}clearExecuteHandler(M){this._executeHandlers[M.charCodeAt(0)]&&delete this._executeHandlers[M.charCodeAt(0)]}setExecuteHandlerFallback(M){this._executeHandlerFb=M}registerCsiHandler(M,w){let y=this._identifier(M);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);let E=this._csiHandlers[y];return E.push(w),{dispose:()=>{let I=E.indexOf(w);I!==-1&&E.splice(I,1)}}}clearCsiHandler(M){this._csiHandlers[this._identifier(M)]&&delete this._csiHandlers[this._identifier(M)]}setCsiHandlerFallback(M){this._csiHandlerFb=M}registerDcsHandler(M,w){return this._dcsParser.registerHandler(this._identifier(M),w)}clearDcsHandler(M){this._dcsParser.clearHandler(this._identifier(M))}setDcsHandlerFallback(M){this._dcsParser.setHandlerFallback(M)}registerOscHandler(M,w){return this._oscParser.registerHandler(M,w)}clearOscHandler(M){this._oscParser.clearHandler(M)}setOscHandlerFallback(M){this._oscParser.setHandlerFallback(M)}setErrorHandler(M){this._errorHandler=M}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(M,w,y,E,I){this._parseStack.state=M,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=I}parse(M,w,y){let E,I=0,D=0,N=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,N=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let P=this._parseStack.handlers,L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&L>-1){for(;L>=0&&(E=P[L](this._params),E!==!0);L--)if(E instanceof Promise)return this._parseStack.handlerPos=L,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&L>-1){for(;L>=0&&(E=P[L](),E!==!0);L--)if(E instanceof Promise)return this._parseStack.handlerPos=L,E}this._parseStack.handlers=[];break;case 6:if(I=M[this._parseStack.chunkPos],E=this._dcsParser.unhook(I!==24&&I!==26,y),E)return E;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(I=M[this._parseStack.chunkPos],E=this._oscParser.end(I!==24&&I!==26,y),E)return E;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,N=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let P=N;P<w;++P){switch(I=M[P],D=this._transitions.table[this.currentState<<8|(I<160?I:S)],D>>4){case 2:for(let $=P+1;;++$){if($>=w||(I=M[$])<32||I>126&&I<S){this._printHandler(M,P,$),P=$-1;break}if(++$>=w||(I=M[$])<32||I>126&&I<S){this._printHandler(M,P,$),P=$-1;break}if(++$>=w||(I=M[$])<32||I>126&&I<S){this._printHandler(M,P,$),P=$-1;break}if(++$>=w||(I=M[$])<32||I>126&&I<S){this._printHandler(M,P,$),P=$-1;break}}break;case 3:this._executeHandlers[I]?this._executeHandlers[I]():this._executeHandlerFb(I),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:P,code:I,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let L=this._csiHandlers[this._collect<<8|I],re=L?L.length-1:-1;for(;re>=0&&(E=L[re](this._params),E!==!0);re--)if(E instanceof Promise)return this._preserveStack(3,L,re,D,P),E;re<0&&this._csiHandlerFb(this._collect<<8|I,this._params),this.precedingJoinState=0;break;case 8:do switch(I){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(I-48)}while(++P<w&&(I=M[P])>47&&I<60);P--;break;case 9:this._collect<<=8,this._collect|=I;break;case 10:let oe=this._escHandlers[this._collect<<8|I],G=oe?oe.length-1:-1;for(;G>=0&&(E=oe[G](),E!==!0);G--)if(E instanceof Promise)return this._preserveStack(4,oe,G,D,P),E;G<0&&this._escHandlerFb(this._collect<<8|I),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|I,this._params);break;case 13:for(let $=P+1;;++$)if($>=w||(I=M[$])===24||I===26||I===27||I>127&&I<S){this._dcsParser.put(M,P,$),P=$-1;break}break;case 14:if(E=this._dcsParser.unhook(I!==24&&I!==26),E)return this._preserveStack(6,[],0,D,P),E;I===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let $=P+1;;$++)if($>=w||(I=M[$])<32||I>127&&I<S){this._oscParser.put(M,P,$),P=$-1;break}break;case 6:if(E=this._oscParser.end(I!==24&&I!==26),E)return this._preserveStack(5,[],0,D,P),E;I===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}r.EscapeSequenceParser=x},6242:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;let c=a(5770),p=a(482),u=[];r.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(h,_){this._handlers[h]===void 0&&(this._handlers[h]=[]);let S=this._handlers[h];return S.push(_),{dispose:()=>{let x=S.indexOf(_);x!==-1&&S.splice(x,1)}}}clearHandler(h){this._handlers[h]&&delete this._handlers[h]}setHandlerFallback(h){this._handlerFb=h}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let h=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;h>=0;--h)this._active[h].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].start();else this._handlerFb(this._id,"START")}_put(h,_,S){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(h,_,S);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(h,_,S))}start(){this.reset(),this._state=1}put(h,_,S){if(this._state!==3){if(this._state===1)for(;_<S;){let x=h[_++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&S-_>0&&this._put(h,_,S)}}end(h,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,x=this._active.length-1,b=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,S=_,b=this._stack.fallThrough,this._stack.paused=!1),!b&&S===!1){for(;x>=0&&(S=this._active[x].end(h),S!==!0);x--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,S;x--}for(;x>=0;x--)if(S=this._active[x].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",h);this._active=u,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(h){this._handler=h,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(h,_,S){this._hitLimit||(this._data+=(0,p.utf32ToString)(h,_,S),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(h){let _=!1;if(this._hitLimit)_=!1;else if(h&&(_=this._handler(this._data),_ instanceof Promise))return _.then(S=>(this._data="",this._hitLimit=!1,S));return this._data="",this._hitLimit=!1,_}}},8742:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;let a=2147483647;class c{static fromArray(u){let h=new c;if(!u.length)return h;for(let _=Array.isArray(u[0])?1:0;_<u.length;++_){let S=u[_];if(Array.isArray(S))for(let x=0;x<S.length;++x)h.addSubParam(S[x]);else h.addParam(S)}return h}constructor(u=32,h=32){if(this.maxLength=u,this.maxSubParamsLength=h,h>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(h),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){let u=[];for(let h=0;h<this.length;++h){u.push(this.params[h]);let _=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];S-_>0&&u.push(Array.prototype.slice.call(this._subParams,_,S))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>a?a:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>a?a:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){let h=this._subParamsIdx[u]>>8,_=255&this._subParamsIdx[u];return _-h>0?this._subParams.subarray(h,_):null}getSubParamsAll(){let u={};for(let h=0;h<this.length;++h){let _=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];S-_>0&&(u[h]=this._subParams.slice(_,S))}return u}addDigit(u){let h;if(this._rejectDigits||!(h=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let _=this._digitIsSub?this._subParams:this.params,S=_[h-1];_[h-1]=~S?Math.min(10*S+u,a):u}}r.Params=c},5741:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){let p={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(p),c.dispose=()=>this._wrappedAddonDispose(p),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===a){c=p;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;let c=a(3785),p=a(511);r.BufferApiView=class{constructor(u,h){this._buffer=u,this.type=h}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){let h=this._buffer.lines.get(u);if(h)return new c.BufferLineApiView(h)}getNullCell(){return new p.CellData}}},3785:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;let c=a(511);r.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new c.CellData)}translateToString(p,u,h){return this._line.translateToString(p,u,h)}}},8285:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;let c=a(8771),p=a(8460),u=a(844);class h extends u.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=h},7975:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,p=>c(p.toArray()))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,(p,u)=>c(p,u.toArray()))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(o,r,a){var c=this&&this.__decorate||function(b,M,w,y){var E,I=arguments.length,D=I<3?M:y===null?y=Object.getOwnPropertyDescriptor(M,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,M,w,y);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(D=(I<3?E(D):I>3?E(M,w,D):E(M,w))||D);return I>3&&D&&Object.defineProperty(M,w,D),D},p=this&&this.__param||function(b,M){return function(w,y){M(w,y,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;let u=a(8460),h=a(844),_=a(5295),S=a(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let x=r.BufferService=class extends h.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(b,this))}resize(b,M){this.cols=b,this.rows=M,this.buffers.resize(b,M),this._onResize.fire({cols:b,rows:M})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,M=!1){let w=this.buffer,y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=w.getBlankLine(b,M),this._cachedBlankLine=y),y.isWrapped=M;let E=w.ybase+w.scrollTop,I=w.ybase+w.scrollBottom;if(w.scrollTop===0){let D=w.lines.isFull;I===w.lines.length-1?D?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(I+1,0,y.clone()),D?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{let D=I-E+1;w.lines.shiftElements(E+1,D-1,-1),w.lines.set(I,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(b,M,w){let y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);let E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),E!==y.ydisp&&(M||this._onScroll.fire(y.ydisp))}};r.BufferService=x=c([p(0,S.IOptionsService)],x)},7994:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(o,r,a){var c=this&&this.__decorate||function(y,E,I,D){var N,P=arguments.length,L=P<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,I):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,E,I,D);else for(var re=y.length-1;re>=0;re--)(N=y[re])&&(L=(P<3?N(L):P>3?N(E,I,L):N(E,I))||L);return P>3&&L&&Object.defineProperty(E,I,L),L},p=this&&this.__param||function(y,E){return function(I,D){E(I,D,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;let u=a(2585),h=a(8460),_=a(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function x(y,E){let I=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(I|=64,I|=y.action):(I|=3&y.button,4&y.button&&(I|=64),8&y.button&&(I|=128),y.action===32?I|=32:y.action!==0||E||(I|=3)),I}let b=String.fromCharCode,M={DEFAULT:y=>{let E=[x(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${b(E[0])}${b(E[1])}${b(E[2])}`},SGR:y=>{let E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{let E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${x(y,!0)};${y.x};${y.y}${E}`}},w=r.CoreMouseService=class extends _.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new h.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let I of Object.keys(S))this.addProtocol(I,S[I]);for(let I of Object.keys(M))this.addEncoding(I,M[I]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;let E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,I){if(I){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};r.CoreMouseService=w=c([p(0,u.IBufferService),p(1,u.ICoreService)],w)},6975:function(o,r,a){var c=this&&this.__decorate||function(w,y,E,I){var D,N=arguments.length,P=N<3?y:I===null?I=Object.getOwnPropertyDescriptor(y,E):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,y,E,I);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(y,E,P):D(y,E))||P);return N>3&&P&&Object.defineProperty(y,E,P),P},p=this&&this.__param||function(w,y){return function(E,I){y(E,I,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;let u=a(1439),h=a(8460),_=a(844),S=a(2585),x=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),M=r.CoreService=class extends _.Disposable{constructor(w,y,E){super(),this._bufferService=w,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new h.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new h.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}reset(){this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;let E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,()=>w.split("").map(I=>I.charCodeAt(0))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,()=>w.split("").map(y=>y.charCodeAt(0))),this._onBinary.fire(w))}};r.CoreService=M=c([p(0,S.IBufferService),p(1,S.ILogService),p(2,S.IOptionsService)],M)},9074:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;let c=a(8055),p=a(8460),u=a(844),h=a(6106),_=0,S=0;class x extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new h.SortedList(w=>w?.marker.line),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(w){if(w.marker.isDisposed)return;let y=new b(w);if(y){let E=y.marker.onDispose(()=>y.dispose());y.onDispose(()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())}),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(let w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,E){let I=0,D=0;for(let N of this._decorations.getKeyIterator(y))I=N.options.x??0,D=I+(N.options.width??1),w>=I&&w<D&&(!E||(N.options.layer??"bottom")===E)&&(yield N)}forEachDecorationAtCell(w,y,E,I){this._decorations.forEachByKey(y,D=>{_=D.options.x??0,S=_+(D.options.width??1),w>=_&&w<S&&(!E||(D.options.layer??"bottom")===E)&&I(D)})}}r.DecorationService=x;class b extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(w){super(),this.options=w,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=w.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;let c=a(2585),p=a(8343);class u{constructor(..._){this._entries=new Map;for(let[S,x]of _)this.set(S,x)}set(_,S){let x=this._entries.get(_);return this._entries.set(_,S),x}forEach(_){for(let[S,x]of this._entries.entries())_(S,x)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}r.ServiceCollection=u,r.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(h,_){this._services.set(h,_)}getService(h){return this._services.get(h)}createInstance(h,..._){let S=(0,p.getServiceDependencies)(h).sort((M,w)=>M.index-w.index),x=[];for(let M of S){let w=this._services.get(M.id);if(!w)throw new Error(`[createInstance] ${h.name} depends on UNKNOWN service ${M.id}.`);x.push(w)}let b=S.length>0?S[0].index:_.length;if(_.length!==b)throw new Error(`[createInstance] First service dependency of ${h.name} at position ${b+1} conflicts with ${_.length} static arguments`);return new h(..._,...x)}}},7866:function(o,r,a){var c=this&&this.__decorate||function(b,M,w,y){var E,I=arguments.length,D=I<3?M:y===null?y=Object.getOwnPropertyDescriptor(M,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,M,w,y);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(D=(I<3?E(D):I>3?E(M,w,D):E(M,w))||D);return I>3&&D&&Object.defineProperty(M,w,D),D},p=this&&this.__param||function(b,M){return function(w,y){M(w,y,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;let u=a(844),h=a(2585),_={trace:h.LogLevelEnum.TRACE,debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF},S,x=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let M=0;M<b.length;M++)typeof b[M]=="function"&&(b[M]=b[M]())}_log(b,M,w){this._evalLazyOptionalParams(w),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+M,...w)}trace(b,...M){this._logLevel<=h.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,b,M)}debug(b,...M){this._logLevel<=h.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,b,M)}info(b,...M){this._logLevel<=h.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,b,M)}warn(b,...M){this._logLevel<=h.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,b,M)}error(b,...M){this._logLevel<=h.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,b,M)}};r.LogService=x=c([p(0,h.IOptionsService)],x),r.setTraceLogger=function(b){S=b},r.traceCall=function(b,M,w){if(typeof w.value!="function")throw new Error("not supported");let y=w.value;w.value=function(...E){if(S.logLevel!==h.LogLevelEnum.TRACE)return y.apply(this,E);S.trace(`GlyphRenderer#${y.name}(${E.map(D=>JSON.stringify(D)).join(", ")})`);let I=y.apply(this,E);return S.trace(`GlyphRenderer#${y.name} return`,I),I}}},7302:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;let c=a(8460),p=a(844),u=a(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};let h=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends p.Disposable{constructor(x){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;let b=K({},r.DEFAULT_OPTIONS);for(let M in x)if(M in b)try{let w=x[M];b[M]=this._sanitizeAndValidateOption(M,w)}catch(w){console.error(w)}this.rawOptions=b,this.options=K({},b),this._setupOptions(),this.register((0,p.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(x,b){return this.onOptionChange(M=>{M===x&&b(this.rawOptions[x])})}onMultipleOptionChange(x,b){return this.onOptionChange(M=>{x.indexOf(M)!==-1&&b()})}_setupOptions(){let x=M=>{if(!(M in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${M}"`);return this.rawOptions[M]},b=(M,w)=>{if(!(M in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${M}"`);w=this._sanitizeAndValidateOption(M,w),this.rawOptions[M]!==w&&(this.rawOptions[M]=w,this._onOptionChange.fire(M))};for(let M in this.rawOptions){let w={get:x.bind(this,M),set:b.bind(this,M)};Object.defineProperty(this.options,M,w)}}_sanitizeAndValidateOption(x,b){switch(x){case"cursorStyle":if(b||(b=r.DEFAULT_OPTIONS[x]),!(function(M){return M==="block"||M==="underline"||M==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${x}`);break;case"wordSeparator":b||(b=r.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=h.includes(b)?b:r.DEFAULT_OPTIONS[x];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${x} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${x} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}r.OptionsService=_},2660:function(o,r,a){var c=this&&this.__decorate||function(_,S,x,b){var M,w=arguments.length,y=w<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(_,S,x,b);else for(var E=_.length-1;E>=0;E--)(M=_[E])&&(y=(w<3?M(y):w>3?M(S,x,y):M(S,x))||y);return w>3&&y&&Object.defineProperty(S,x,y),y},p=this&&this.__param||function(_,S){return function(x,b){S(x,b,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;let u=a(2585),h=r.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){let S=this._bufferService.buffer;if(_.id===void 0){let E=S.addMarker(S.ybase+S.y),I={data:_,id:this._nextId++,lines:[E]};return E.onDispose(()=>this._removeMarkerFromLink(I,E)),this._dataByLinkId.set(I.id,I),I.id}let x=_,b=this._getEntryIdKey(x),M=this._entriesWithId.get(b);if(M)return this.addLineToLink(M.id,S.ybase+S.y),M.id;let w=S.addMarker(S.ybase+S.y),y={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[w]};return w.onDispose(()=>this._removeMarkerFromLink(y,w)),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(_,S){let x=this._dataByLinkId.get(_);if(x&&x.lines.every(b=>b.line!==S)){let b=this._bufferService.buffer.addMarker(S);x.lines.push(b),b.onDispose(()=>this._removeMarkerFromLink(x,b))}}getLinkData(_){return this._dataByLinkId.get(_)?.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,S){let x=_.lines.indexOf(S);x!==-1&&(_.lines.splice(x,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};r.OscLinkService=h=c([p(0,u.IBufferService)],h)},8343:(o,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;let a="di$target",c="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(p){return p[c]||[]},r.createDecorator=function(p){if(r.serviceRegistry.has(p))return r.serviceRegistry.get(p);let u=function(h,_,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,b,M){b[a]===b?b[c].push({id:x,index:M}):(b[c]=[{id:x,index:M}],b[a]=b)})(u,h,S)};return u.toString=()=>p,r.serviceRegistry.set(p,u),u}},2585:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;let c=a(8343);var p;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(p||(r.LogLevelEnum=p={})),r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(o,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;let c=a(8460),p=a(225);class u{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,S,x=!1){return(16777215&_)<<3|(3&S)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;let _=new p.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let S=0,x=0,b=_.length;for(let M=0;M<b;++M){let w=_.charCodeAt(M);if(55296<=w&&w<=56319){if(++M>=b)return S+this.wcwidth(w);let I=_.charCodeAt(M);56320<=I&&I<=57343?w=1024*(w-55296)+I-56320+65536:S+=this.wcwidth(I)}let y=this.charProperties(w,x),E=u.extractWidth(y);u.extractShouldJoin(y)&&(E-=u.extractWidth(x)),S+=E,x=y}return S}charProperties(_,S){return this._activeProvider.charProperties(_,S)}}r.UnicodeService=u}},i={};function e(o){var r=i[o];if(r!==void 0)return r.exports;var a=i[o]={exports:{}};return n[o].call(a.exports,a,a.exports,e),a.exports}var t={};return(()=>{var o=t;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;let r=e(9042),a=e(3236),c=e(844),p=e(5741),u=e(8285),h=e(7975),_=e(7090),S=["cols","rows"];class x extends c.Disposable{constructor(M){super(),this._core=this.register(new a.Terminal(M)),this._addonManager=this.register(new p.AddonManager),this._publicOptions=K({},this._core.options);let w=E=>this._core.options[E],y=(E,I)=>{this._checkReadonlyOptions(E),this._core.options[E]=I};for(let E in this._core.options){let I={get:w.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,I)}}_checkReadonlyOptions(M){if(S.includes(M))throw new Error(`Option "${M}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new h.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let M=this._core.coreService.decPrivateModes,w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:M.applicationCursorKeys,applicationKeypadMode:M.applicationKeypad,bracketedPasteMode:M.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:M.origin,reverseWraparoundMode:M.reverseWraparound,sendFocusMode:M.sendFocus,wraparoundMode:M.wraparound}}get options(){return this._publicOptions}set options(M){for(let w in M)this._publicOptions[w]=M[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(M,w=!0){this._core.input(M,w)}resize(M,w){this._verifyIntegers(M,w),this._core.resize(M,w)}open(M){this._core.open(M)}attachCustomKeyEventHandler(M){this._core.attachCustomKeyEventHandler(M)}attachCustomWheelEventHandler(M){this._core.attachCustomWheelEventHandler(M)}registerLinkProvider(M){return this._core.registerLinkProvider(M)}registerCharacterJoiner(M){return this._checkProposedApi(),this._core.registerCharacterJoiner(M)}deregisterCharacterJoiner(M){this._checkProposedApi(),this._core.deregisterCharacterJoiner(M)}registerMarker(M=0){return this._verifyIntegers(M),this._core.registerMarker(M)}registerDecoration(M){return this._checkProposedApi(),this._verifyPositiveIntegers(M.x??0,M.width??0,M.height??0),this._core.registerDecoration(M)}hasSelection(){return this._core.hasSelection()}select(M,w,y){this._verifyIntegers(M,w,y),this._core.select(M,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(M,w){this._verifyIntegers(M,w),this._core.selectLines(M,w)}dispose(){super.dispose()}scrollLines(M){this._verifyIntegers(M),this._core.scrollLines(M)}scrollPages(M){this._verifyIntegers(M),this._core.scrollPages(M)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(M){this._verifyIntegers(M),this._core.scrollToLine(M)}clear(){this._core.clear()}write(M,w){this._core.write(M,w)}writeln(M,w){this._core.write(M),this._core.write(`\r
`,w)}paste(M){this._core.paste(M)}refresh(M,w){this._verifyIntegers(M,w),this._core.refresh(M,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(M){this._addonManager.loadAddon(this,M)}static get strings(){return r}_verifyIntegers(...M){for(let w of M)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...M){for(let w of M)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}o.Terminal=x})(),t})())});var nO=Cs((E2,tO)=>{(function(n,i){typeof E2=="object"&&typeof tO=="object"?tO.exports=i():typeof define=="function"&&define.amd?define([],i):typeof E2=="object"?E2.AttachAddon=i():n.AttachAddon=i()})(self,()=>(()=>{"use strict";var n={};return(()=>{var i=n;function e(t,o,r){return t.addEventListener(o,r),{dispose:()=>{r&&t.removeEventListener(o,r)}}}Object.defineProperty(i,"__esModule",{value:!0}),i.AttachAddon=void 0,i.AttachAddon=class{constructor(t,o){this._disposables=[],this._socket=t,this._socket.binaryType="arraybuffer",this._bidirectional=!(o&&o.bidirectional===!1)}activate(t){this._disposables.push(e(this._socket,"message",o=>{let r=o.data;t.write(typeof r=="string"?r:new Uint8Array(r))})),this._bidirectional&&(this._disposables.push(t.onData(o=>this._sendData(o))),this._disposables.push(t.onBinary(o=>this._sendBinary(o)))),this._disposables.push(e(this._socket,"close",()=>this.dispose())),this._disposables.push(e(this._socket,"error",()=>this.dispose()))}dispose(){for(let t of this._disposables)t.dispose()}_sendData(t){this._checkOpenSocket()&&this._socket.send(t)}_sendBinary(t){if(!this._checkOpenSocket())return;let o=new Uint8Array(t.length);for(let r=0;r<t.length;++r)o[r]=255&t.charCodeAt(r);this._socket.send(o)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}}})(),n})())});var oO=Cs((D2,iO)=>{(function(n,i){typeof D2=="object"&&typeof iO=="object"?iO.exports=i():typeof define=="function"&&define.amd?define([],i):typeof D2=="object"?D2.FitAddon=i():n.FitAddon=i()})(self,()=>(()=>{"use strict";var n={};return(()=>{var i=n;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core,t=e._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let o=this._terminal.options.scrollback===0?0:e.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(r.getPropertyValue("height")),c=Math.max(0,parseInt(r.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=a-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),h=c-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(h/t.css.cell.width)),rows:Math.max(1,Math.floor(u/t.css.cell.height))}}}})(),n})())});var W4=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g"),vh=class n{element=null;classNames=[];attrs=[];notSelectors=[];static parse(i){let e=[],t=(p,u)=>{u.notSelectors.length>0&&!u.element&&u.classNames.length==0&&u.attrs.length==0&&(u.element="*"),p.push(u)},o=new n,r,a=o,c=!1;for(W4.lastIndex=0;r=W4.exec(i);){if(r[1]){if(c)throw new Error("Nesting :not in a selector is not allowed");c=!0,a=new n,o.notSelectors.push(a)}let p=r[2];if(p){let h=r[3];h==="#"?a.addAttribute("id",p.slice(1)):h==="."?a.addClassName(p.slice(1)):a.setElement(p)}let u=r[4];if(u&&a.addAttribute(a.unescapeAttribute(u),r[6]),r[7]&&(c=!1,a=o),r[8]){if(c)throw new Error("Multiple selectors in :not are not supported");t(e,o),o=a=new n}}return t(e,o),e}unescapeAttribute(i){let e="",t=!1;for(let o=0;o<i.length;o++){let r=i.charAt(o);if(r==="\\"){t=!0;continue}if(r==="$"&&!t)throw new Error(`Error in attribute selector "${i}". Unescaped "$" is not supported. Please escape with "\\$".`);t=!1,e+=r}return e}escapeAttribute(i){return i.replace(/\\/g,"\\\\").replace(/\$/g,"\\$")}isElementSelector(){return this.hasElementSelector()&&this.classNames.length==0&&this.attrs.length==0&&this.notSelectors.length===0}hasElementSelector(){return!!this.element}setElement(i=null){this.element=i}getAttrs(){let i=[];return this.classNames.length>0&&i.push("class",this.classNames.join(" ")),i.concat(this.attrs)}addAttribute(i,e=""){this.attrs.push(i,e&&e.toLowerCase()||"")}addClassName(i){this.classNames.push(i.toLowerCase())}toString(){let i=this.element||"";if(this.classNames&&this.classNames.forEach(e=>i+=`.${e}`),this.attrs)for(let e=0;e<this.attrs.length;e+=2){let t=this.escapeAttribute(this.attrs[e]),o=this.attrs[e+1];i+=`[${t}${o?"="+o:""}]`}return this.notSelectors.forEach(e=>i+=`:not(${e})`),i}},qC=class n{static createNotMatcher(i){let e=new n;return e.addSelectables(i,null),e}_elementMap=new Map;_elementPartialMap=new Map;_classMap=new Map;_classPartialMap=new Map;_attrValueMap=new Map;_attrValuePartialMap=new Map;_listContexts=[];addSelectables(i,e){let t=null;i.length>1&&(t=new Fk(i),this._listContexts.push(t));for(let o=0;o<i.length;o++)this._addSelectable(i[o],e,t)}_addSelectable(i,e,t){let o=this,r=i.element,a=i.classNames,c=i.attrs,p=new Rk(i,e,t);if(r&&(c.length===0&&a.length===0?this._addTerminal(o._elementMap,r,p):o=this._addPartial(o._elementPartialMap,r)),a)for(let u=0;u<a.length;u++){let h=c.length===0&&u===a.length-1,_=a[u];h?this._addTerminal(o._classMap,_,p):o=this._addPartial(o._classPartialMap,_)}if(c)for(let u=0;u<c.length;u+=2){let h=u===c.length-2,_=c[u],S=c[u+1];if(h){let x=o._attrValueMap,b=x.get(_);b||(b=new Map,x.set(_,b)),this._addTerminal(b,S,p)}else{let x=o._attrValuePartialMap,b=x.get(_);b||(b=new Map,x.set(_,b)),o=this._addPartial(b,S)}}}_addTerminal(i,e,t){let o=i.get(e);o||(o=[],i.set(e,o)),o.push(t)}_addPartial(i,e){let t=i.get(e);return t||(t=new n,i.set(e,t)),t}match(i,e){let t=!1,o=i.element,r=i.classNames,a=i.attrs;for(let c=0;c<this._listContexts.length;c++)this._listContexts[c].alreadyMatched=!1;if(t=this._matchTerminal(this._elementMap,o,i,e)||t,t=this._matchPartial(this._elementPartialMap,o,i,e)||t,r)for(let c=0;c<r.length;c++){let p=r[c];t=this._matchTerminal(this._classMap,p,i,e)||t,t=this._matchPartial(this._classPartialMap,p,i,e)||t}if(a)for(let c=0;c<a.length;c+=2){let p=a[c],u=a[c+1],h=this._attrValueMap.get(p);u&&(t=this._matchTerminal(h,"",i,e)||t),t=this._matchTerminal(h,u,i,e)||t;let _=this._attrValuePartialMap.get(p);u&&(t=this._matchPartial(_,"",i,e)||t),t=this._matchPartial(_,u,i,e)||t}return t}_matchTerminal(i,e,t,o){if(!i||typeof e!="string")return!1;let r=i.get(e)||[],a=i.get("*");if(a&&(r=r.concat(a)),r.length===0)return!1;let c,p=!1;for(let u=0;u<r.length;u++)c=r[u],p=c.finalize(t,o)||p;return p}_matchPartial(i,e,t,o){if(!i||typeof e!="string")return!1;let r=i.get(e);return r?r.match(t,o):!1}},Fk=class{selectors;alreadyMatched=!1;constructor(i){this.selectors=i}},Rk=class{selector;cbContext;listContext;notSelectors;constructor(i,e,t){this.selector=i,this.cbContext=e,this.listContext=t,this.notSelectors=i.notSelectors}finalize(i,e){let t=!0;return this.notSelectors.length>0&&(!this.listContext||!this.listContext.alreadyMatched)&&(t=!qC.createNotMatcher(this.notSelectors).match(i,null)),t&&e&&(!this.listContext||!this.listContext.alreadyMatched)&&(this.listContext&&(this.listContext.alreadyMatched=!0),e(this.selector,this.cbContext)),t}},QC=class{registry;constructor(i){this.registry=i}match(i){return this.registry.has(i)?this.registry.get(i):[]}};var Sp=(function(n){return n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom",n[n.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom",n})(Sp||{}),mE=(function(n){return n[n.OnPush=0]="OnPush",n[n.Default=1]="Default",n[n.Eager=1]="Eager",n})(mE||{}),qg=(function(n){return n[n.None=0]="None",n[n.SignalBased=1]="SignalBased",n[n.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",n})(qg||{}),q4={name:"custom-elements"},Q4={name:"no-errors-schema"};var eo=(function(n){return n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n[n.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING",n})(eo||{});function t$(n){let i=n.classNames&&n.classNames.length?[8,...n.classNames]:[];return[n.element&&n.element!=="*"?n.element:"",...n.attrs,...i]}function n$(n){let i=n.classNames&&n.classNames.length?[8,...n.classNames]:[];return n.element?[5,n.element,...n.attrs,...i]:n.attrs.length?[3,...n.attrs,...i]:n.classNames&&n.classNames.length?[9,...n.classNames]:[]}function i$(n){let i=t$(n),e=n.notSelectors&&n.notSelectors.length?n.notSelectors.map(t=>n$(t)):[];return i.concat(...e)}function pE(n){return n?vh.parse(n).map(i$):[]}var gd=(function(n){return n[n.Directive=0]="Directive",n[n.Component=1]="Component",n[n.Injectable=2]="Injectable",n[n.Pipe=3]="Pipe",n[n.NgModule=4]="NgModule",n})(gd||{});var XC;function o$(n){return l$(s$(n.nodes).join("")+`[${n.meaning}]`)}function r$(n){return n.id||jN(n)}function jN(n){let i=new Lk,e=n.nodes.map(t=>t.visit(i,null));return $N(e.join(""),n.meaning)}var KC=class{visitText(i,e){return i.value}visitContainer(i,e){return`[${i.children.map(t=>t.visit(this)).join(", ")}]`}visitIcu(i,e){let t=Object.keys(i.cases).map(o=>`${o} {${i.cases[o].visit(this)}}`);return`{${i.expression}, ${i.type}, ${t.join(", ")}}`}visitTagPlaceholder(i,e){return i.isVoid?`<ph tag name="${i.startName}"/>`:`<ph tag name="${i.startName}">${i.children.map(t=>t.visit(this)).join(", ")}</ph name="${i.closeName}">`}visitPlaceholder(i,e){return i.value?`<ph name="${i.name}">${i.value}</ph>`:`<ph name="${i.name}"/>`}visitIcuPlaceholder(i,e){return`<ph icu name="${i.name}">${i.value.visit(this)}</ph>`}visitBlockPlaceholder(i,e){return`<ph block name="${i.startName}">${i.children.map(t=>t.visit(this)).join(", ")}</ph name="${i.closeName}">`}},a$=new KC;function s$(n){return n.map(i=>i.visit(a$,null))}var Lk=class extends KC{visitIcu(i){let e=Object.keys(i.cases).map(t=>`${t} {${i.cases[t].visit(this)}}`);return`{${i.type}, ${e.join(", ")}}`}};function l$(n){XC??=new TextEncoder;let i=[...XC.encode(n)],e=m$(i,uE.Big),t=i.length*8,o=new Uint32Array(80),r=1732584193,a=4023233417,c=2562383102,p=271733878,u=3285377520;e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(let h=0;h<e.length;h+=16){let _=r,S=a,x=c,b=p,M=u;for(let w=0;w<80;w++){w<16?o[w]=e[h+w]:o[w]=uk(o[w-3]^o[w-8]^o[w-14]^o[w-16],1);let y=c$(w,a,c,p),E=y[0],I=y[1],D=[uk(r,5),E,u,I,o[w]].reduce(th);u=p,p=c,c=uk(a,30),a=r,r=D}r=th(r,_),a=th(a,S),c=th(c,x),p=th(p,b),u=th(u,M)}return Lg(r)+Lg(a)+Lg(c)+Lg(p)+Lg(u)}function Lg(n){return(n>>>0).toString(16).padStart(8,"0")}function c$(n,i,e,t){return n<20?[i&e|~i&t,1518500249]:n<40?[i^e^t,1859775393]:n<60?[i&e|i&t|e&t,2400959708]:[i^e^t,3395469782]}function X4(n){XC??=new TextEncoder;let i=XC.encode(n),e=new DataView(i.buffer,i.byteOffset,i.byteLength),t=K4(e,i.length,0),o=K4(e,i.length,102072);return t==0&&(o==0||o==1)&&(t=t^319790063,o=o^-1801410264),BigInt.asUintN(32,BigInt(t))<<BigInt(32)|BigInt.asUintN(32,BigInt(o))}function $N(n,i=""){let e=X4(n);return i&&(e=BigInt.asUintN(64,e<<BigInt(1))|e>>BigInt(63)&BigInt(1),e+=X4(i)),BigInt.asUintN(63,e).toString()}function K4(n,i,e){let t=2654435769,o=2654435769,r=0,a=i-12;for(;r<=a;r+=12){t+=n.getUint32(r,!0),o+=n.getUint32(r+4,!0),e+=n.getUint32(r+8,!0);let p=Y4(t,o,e);t=p[0],o=p[1],e=p[2]}let c=i-r;return e+=i,c>=4?(t+=n.getUint32(r,!0),r+=4,c>=8?(o+=n.getUint32(r,!0),r+=4,c>=9&&(e+=n.getUint8(r++)<<8),c>=10&&(e+=n.getUint8(r++)<<16),c===11&&(e+=n.getUint8(r++)<<24)):(c>=5&&(o+=n.getUint8(r++)),c>=6&&(o+=n.getUint8(r++)<<8),c===7&&(o+=n.getUint8(r++)<<16))):(c>=1&&(t+=n.getUint8(r++)),c>=2&&(t+=n.getUint8(r++)<<8),c===3&&(t+=n.getUint8(r++)<<16)),Y4(t,o,e)[2]}function Y4(n,i,e){return n-=i,n-=e,n^=e>>>13,i-=e,i-=n,i^=n<<8,e-=n,e-=i,e^=i>>>13,n-=i,n-=e,n^=e>>>12,i-=e,i-=n,i^=n<<16,e-=n,e-=i,e^=i>>>5,n-=i,n-=e,n^=e>>>3,i-=e,i-=n,i^=n<<10,e-=n,e-=i,e^=i>>>15,[n,i,e]}var uE=(function(n){return n[n.Little=0]="Little",n[n.Big=1]="Big",n})(uE||{});function th(n,i){return d$(n,i)[1]}function d$(n,i){let e=(n&65535)+(i&65535),t=(n>>>16)+(i>>>16)+(e>>>16);return[t>>>16,t<<16|e&65535]}function uk(n,i){return n<<i|n>>>32-i}function m$(n,i){let e=n.length+3>>>2,t=[];for(let o=0;o<e;o++)t[o]=p$(n,o*4,i);return t}function Z4(n,i){return i>=n.length?0:n[i]}function p$(n,i,e){let t=0;if(e===uE.Big)for(let o=0;o<4;o++)t+=Z4(n,i+o)<<24-8*o;else for(let o=0;o<4;o++)t+=Z4(n,i+o)<<8*o;return t}var HN=(function(n){return n[n.None=0]="None",n[n.Const=1]="Const",n})(HN||{}),YC=class{modifiers;constructor(i=HN.None){this.modifiers=i}hasModifier(i){return(this.modifiers&i)!==0}},wd=(function(n){return n[n.Dynamic=0]="Dynamic",n[n.Bool=1]="Bool",n[n.String=2]="String",n[n.Int=3]="Int",n[n.Number=4]="Number",n[n.Function=5]="Function",n[n.Inferred=6]="Inferred",n[n.None=7]="None",n})(wd||{}),xc=class extends YC{name;constructor(i,e){super(e),this.name=i}visitType(i,e){return i.visitBuiltinType(this,e)}},tl=class extends YC{value;typeParams;constructor(i,e,t=null){super(e),this.value=i,this.typeParams=t}visitType(i,e){return i.visitExpressionType(this,e)}};var is=new xc(wd.Dynamic),Ol=new xc(wd.Inferred),u$=new xc(wd.Bool),t5e=new xc(wd.Int),Bp=new xc(wd.Number),hE=new xc(wd.String),n5e=new xc(wd.Function),yc=new xc(wd.None),l_=(function(n){return n[n.Minus=0]="Minus",n[n.Plus=1]="Plus",n})(l_||{}),st=(function(n){return n[n.Equals=0]="Equals",n[n.NotEquals=1]="NotEquals",n[n.Assign=2]="Assign",n[n.Identical=3]="Identical",n[n.NotIdentical=4]="NotIdentical",n[n.Minus=5]="Minus",n[n.Plus=6]="Plus",n[n.Divide=7]="Divide",n[n.Multiply=8]="Multiply",n[n.Modulo=9]="Modulo",n[n.And=10]="And",n[n.Or=11]="Or",n[n.BitwiseOr=12]="BitwiseOr",n[n.BitwiseAnd=13]="BitwiseAnd",n[n.Lower=14]="Lower",n[n.LowerEquals=15]="LowerEquals",n[n.Bigger=16]="Bigger",n[n.BiggerEquals=17]="BiggerEquals",n[n.NullishCoalesce=18]="NullishCoalesce",n[n.Exponentiation=19]="Exponentiation",n[n.In=20]="In",n[n.InstanceOf=21]="InstanceOf",n[n.AdditionAssignment=22]="AdditionAssignment",n[n.SubtractionAssignment=23]="SubtractionAssignment",n[n.MultiplicationAssignment=24]="MultiplicationAssignment",n[n.DivisionAssignment=25]="DivisionAssignment",n[n.RemainderAssignment=26]="RemainderAssignment",n[n.ExponentiationAssignment=27]="ExponentiationAssignment",n[n.AndAssignment=28]="AndAssignment",n[n.OrAssignment=29]="OrAssignment",n[n.NullishCoalesceAssignment=30]="NullishCoalesceAssignment",n})(st||{});function h$(n,i){return n==null||i==null?n==i:n.isEquivalent(i)}function UN(n,i,e){let t=n.length;if(t!==i.length)return!1;for(let o=0;o<t;o++)if(!e(n[o],i[o]))return!1;return!0}function Ts(n,i){return UN(n,i,(e,t)=>e.isEquivalent(t))}var Bi=class{type;sourceSpan;constructor(i,e){this.type=i||null,this.sourceSpan=e||null}prop(i,e){return new Es(this,i,null,e)}key(i,e,t){return new xd(this,i,e,t)}callFn(i,e,t){return new os(this,i,null,e,t)}instantiate(i,e,t){return new d_(this,i,e,t)}conditional(i,e=null,t){return new Sc(this,i,e,null,t)}equals(i,e){return new gi(st.Equals,this,i,null,e)}notEquals(i,e){return new gi(st.NotEquals,this,i,null,e)}identical(i,e){return new gi(st.Identical,this,i,null,e)}notIdentical(i,e){return new gi(st.NotIdentical,this,i,null,e)}minus(i,e){return new gi(st.Minus,this,i,null,e)}plus(i,e){return new gi(st.Plus,this,i,null,e)}divide(i,e){return new gi(st.Divide,this,i,null,e)}multiply(i,e){return new gi(st.Multiply,this,i,null,e)}modulo(i,e){return new gi(st.Modulo,this,i,null,e)}power(i,e){return new gi(st.Exponentiation,this,i,null,e)}and(i,e){return new gi(st.And,this,i,null,e)}bitwiseOr(i,e){return new gi(st.BitwiseOr,this,i,null,e)}bitwiseAnd(i,e){return new gi(st.BitwiseAnd,this,i,null,e)}or(i,e){return new gi(st.Or,this,i,null,e)}lower(i,e){return new gi(st.Lower,this,i,null,e)}lowerEquals(i,e){return new gi(st.LowerEquals,this,i,null,e)}bigger(i,e){return new gi(st.Bigger,this,i,null,e)}biggerEquals(i,e){return new gi(st.BiggerEquals,this,i,null,e)}isBlank(i){return this.equals(C$,i)}nullishCoalesce(i,e){return new gi(st.NullishCoalesce,this,i,null,e)}toStmt(){return new sa(this,null)}},Nl=class n extends Bi{name;constructor(i,e,t){super(e,t),this.name=i}isEquivalent(i){return i instanceof n&&this.name===i.name}isConstant(){return!1}visitExpression(i,e){return i.visitReadVarExpr(this,e)}clone(){return new n(this.name,this.type,this.sourceSpan)}set(i){return new gi(st.Assign,this,i,null,this.sourceSpan)}},Ch=class n extends Bi{expr;constructor(i,e,t){super(e,t),this.expr=i}visitExpression(i,e){return i.visitTypeofExpr(this,e)}isEquivalent(i){return i instanceof n&&i.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}},ZC=class n extends Bi{expr;constructor(i,e,t){super(e,t),this.expr=i}visitExpression(i,e){return i.visitVoidExpr(this,e)}isEquivalent(i){return i instanceof n&&i.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}},oi=class n extends Bi{node;constructor(i,e,t){super(e,t),this.node=i}isEquivalent(i){return i instanceof n&&this.node===i.node}isConstant(){return!1}visitExpression(i,e){return i.visitWrappedNodeExpr(this,e)}clone(){return new n(this.node,this.type,this.sourceSpan)}},os=class n extends Bi{fn;args;pure;constructor(i,e,t,o,r=!1){super(t,o),this.fn=i,this.args=e,this.pure=r}get receiver(){return this.fn}isEquivalent(i){return i instanceof n&&this.fn.isEquivalent(i.fn)&&Ts(this.args,i.args)&&this.pure===i.pure}isConstant(){return!1}visitExpression(i,e){return i.visitInvokeFunctionExpr(this,e)}clone(){return new n(this.fn.clone(),this.args.map(i=>i.clone()),this.type,this.sourceSpan,this.pure)}},c_=class n extends Bi{tag;template;constructor(i,e,t,o){super(t,o),this.tag=i,this.template=e}isEquivalent(i){return i instanceof n&&this.tag.isEquivalent(i.tag)&&this.template.isEquivalent(i.template)}isConstant(){return!1}visitExpression(i,e){return i.visitTaggedTemplateLiteralExpr(this,e)}clone(){return new n(this.tag.clone(),this.template.clone(),this.type,this.sourceSpan)}},d_=class n extends Bi{classExpr;args;constructor(i,e,t,o){super(t,o),this.classExpr=i,this.args=e}isEquivalent(i){return i instanceof n&&this.classExpr.isEquivalent(i.classExpr)&&Ts(this.args,i.args)}isConstant(){return!1}visitExpression(i,e){return i.visitInstantiateExpr(this,e)}clone(){return new n(this.classExpr.clone(),this.args.map(i=>i.clone()),this.type,this.sourceSpan)}},bh=class n extends Bi{body;flags;constructor(i,e,t){super(null,t),this.body=i,this.flags=e}isEquivalent(i){return i instanceof n&&this.body===i.body&&this.flags===i.flags}isConstant(){return!0}visitExpression(i,e){return i.visitRegularExpressionLiteral(this,e)}clone(){return new n(this.body,this.flags,this.sourceSpan)}},aa=class n extends Bi{value;constructor(i,e,t){super(e,t),this.value=i}isEquivalent(i){return i instanceof n&&this.value===i.value}isConstant(){return!0}visitExpression(i,e){return i.visitLiteralExpr(this,e)}clone(){return new n(this.value,this.type,this.sourceSpan)}},m_=class n extends Bi{elements;expressions;constructor(i,e,t){super(null,t),this.elements=i,this.expressions=e}isEquivalent(i){return i instanceof n&&UN(this.elements,i.elements,(e,t)=>e.text===t.text)&&Ts(this.expressions,i.expressions)}isConstant(){return!1}visitExpression(i,e){return i.visitTemplateLiteralExpr(this,e)}clone(){return new n(this.elements.map(i=>i.clone()),this.expressions.map(i=>i.clone()))}},JC=class n extends Bi{text;rawText;constructor(i,e,t){super(hE,e),this.text=i,this.rawText=t??Vk($C(i))}visitExpression(i,e){return i.visitTemplateLiteralElementExpr(this,e)}isEquivalent(i){return i instanceof n&&i.text===this.text&&i.rawText===this.rawText}isConstant(){return!0}clone(){return new n(this.text,this.sourceSpan,this.rawText)}},Ip=class{text;sourceSpan;constructor(i,e){this.text=i,this.sourceSpan=e}},fh=class{text;sourceSpan;associatedMessage;constructor(i,e,t){this.text=i,this.sourceSpan=e,this.associatedMessage=t}},f$="|",J4="@@",g$="\u241F",e1=class n extends Bi{metaBlock;messageParts;placeHolderNames;expressions;constructor(i,e,t,o,r){super(hE,r),this.metaBlock=i,this.messageParts=e,this.placeHolderNames=t,this.expressions=o}isEquivalent(i){return!1}isConstant(){return!1}visitExpression(i,e){return i.visitLocalizedString(this,e)}clone(){return new n(this.metaBlock,this.messageParts,this.placeHolderNames,this.expressions.map(i=>i.clone()),this.sourceSpan)}serializeI18nHead(){let i=this.metaBlock.description||"";return this.metaBlock.meaning&&(i=`${this.metaBlock.meaning}${f$}${i}`),this.metaBlock.customId&&(i=`${i}${J4}${this.metaBlock.customId}`),this.metaBlock.legacyIds&&this.metaBlock.legacyIds.forEach(e=>{i=`${i}${g$}${e}`}),e5(i,this.messageParts[0].text,this.getMessagePartSourceSpan(0))}getMessagePartSourceSpan(i){return this.messageParts[i]?.sourceSpan??this.sourceSpan}getPlaceholderSourceSpan(i){return this.placeHolderNames[i]?.sourceSpan??this.expressions[i]?.sourceSpan??this.sourceSpan}serializeI18nTemplatePart(i){let e=this.placeHolderNames[i-1],t=this.messageParts[i],o=e.text;return e.associatedMessage?.legacyIds.length===0&&(o+=`${J4}${$N(e.associatedMessage.messageString,e.associatedMessage.meaning)}`),e5(o,t.text,this.getMessagePartSourceSpan(i))}},$C=n=>n.replace(/\\/g,"\\\\"),_$=n=>n.replace(/^:/,"\\:"),v$=n=>n.replace(/:/g,"\\:"),Vk=n=>n.replace(/`/g,"\\`").replace(/\${/g,"$\\{");function e5(n,i,e){return n===""?{cooked:i,raw:Vk(_$($C(i))),range:e}:{cooked:`:${n}:${i}`,raw:Vk(`:${v$($C(n))}:${$C(i)}`),range:e}}var zp=class n extends Bi{value;typeParams;constructor(i,e,t=null,o){super(e,o),this.value=i,this.typeParams=t}isEquivalent(i){return i instanceof n&&this.value.name===i.value.name&&this.value.moduleName===i.value.moduleName}isConstant(){return!1}visitExpression(i,e){return i.visitExternalExpr(this,e)}clone(){return new n(this.value,this.type,this.typeParams,this.sourceSpan)}};var Sc=class n extends Bi{condition;falseCase;trueCase;constructor(i,e,t=null,o,r){super(o||e.type,r),this.condition=i,this.falseCase=t,this.trueCase=e}isEquivalent(i){return i instanceof n&&this.condition.isEquivalent(i.condition)&&this.trueCase.isEquivalent(i.trueCase)&&h$(this.falseCase,i.falseCase)}isConstant(){return!1}visitExpression(i,e){return i.visitConditionalExpr(this,e)}clone(){return new n(this.condition.clone(),this.trueCase.clone(),this.falseCase?.clone(),this.type,this.sourceSpan)}};var p_=class n extends Bi{condition;constructor(i,e){super(u$,e),this.condition=i}isEquivalent(i){return i instanceof n&&this.condition.isEquivalent(i.condition)}isConstant(){return!1}visitExpression(i,e){return i.visitNotExpr(this,e)}clone(){return new n(this.condition.clone(),this.sourceSpan)}},br=class n{name;type;constructor(i,e=null){this.name=i,this.type=e}isEquivalent(i){return this.name===i.name}clone(){return new n(this.name,this.type)}},om=class n extends Bi{params;statements;name;constructor(i,e,t,o,r){super(t,o),this.params=i,this.statements=e,this.name=r}isEquivalent(i){return(i instanceof n||i instanceof u_)&&Ts(this.params,i.params)&&Ts(this.statements,i.statements)}isConstant(){return!1}visitExpression(i,e){return i.visitFunctionExpr(this,e)}toDeclStmt(i,e){return new u_(i,this.params,this.statements,this.type,e,this.sourceSpan)}clone(){return new n(this.params.map(i=>i.clone()),this.statements,this.type,this.sourceSpan,this.name)}},eu=class Bk extends Bi{params;body;constructor(i,e,t,o){super(t,o),this.params=i,this.body=e}isEquivalent(i){return!(i instanceof Bk)||!Ts(this.params,i.params)?!1:this.body instanceof Bi&&i.body instanceof Bi?this.body.isEquivalent(i.body):Array.isArray(this.body)&&Array.isArray(i.body)?Ts(this.body,i.body):!1}isConstant(){return!1}visitExpression(i,e){return i.visitArrowFunctionExpr(this,e)}clone(){return new Bk(this.params.map(i=>i.clone()),Array.isArray(this.body)?this.body:this.body.clone(),this.type,this.sourceSpan)}toDeclStmt(i,e){return new Rr(i,this,Ol,e,this.sourceSpan)}},jp=class n extends Bi{operator;expr;parens;constructor(i,e,t,o,r=!0){super(t||Bp,o),this.operator=i,this.expr=e,this.parens=r}isEquivalent(i){return i instanceof n&&this.operator===i.operator&&this.expr.isEquivalent(i.expr)}isConstant(){return!1}visitExpression(i,e){return i.visitUnaryOperatorExpr(this,e)}clone(){return new n(this.operator,this.expr.clone(),this.type,this.sourceSpan,this.parens)}},Fl=class n extends Bi{expr;constructor(i,e,t){super(e,t),this.expr=i}visitExpression(i,e){return i.visitParenthesizedExpr(this,e)}isEquivalent(i){return i instanceof n&&i.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}},gi=class n extends Bi{operator;rhs;lhs;constructor(i,e,t,o,r){super(o||e.type,r),this.operator=i,this.rhs=t,this.lhs=e}isEquivalent(i){return i instanceof n&&this.operator===i.operator&&this.lhs.isEquivalent(i.lhs)&&this.rhs.isEquivalent(i.rhs)}isConstant(){return!1}visitExpression(i,e){return i.visitBinaryOperatorExpr(this,e)}clone(){return new n(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan)}isAssignment(){let i=this.operator;return i===st.Assign||i===st.AdditionAssignment||i===st.SubtractionAssignment||i===st.MultiplicationAssignment||i===st.DivisionAssignment||i===st.RemainderAssignment||i===st.ExponentiationAssignment||i===st.AndAssignment||i===st.OrAssignment||i===st.NullishCoalesceAssignment}},Es=class n extends Bi{receiver;name;constructor(i,e,t,o){super(t,o),this.receiver=i,this.name=e}get index(){return this.name}isEquivalent(i){return i instanceof n&&this.receiver.isEquivalent(i.receiver)&&this.name===i.name}isConstant(){return!1}visitExpression(i,e){return i.visitReadPropExpr(this,e)}set(i){return new gi(st.Assign,this.receiver.prop(this.name),i,null,this.sourceSpan)}clone(){return new n(this.receiver.clone(),this.name,this.type,this.sourceSpan)}},xd=class n extends Bi{receiver;index;constructor(i,e,t,o){super(t,o),this.receiver=i,this.index=e}isEquivalent(i){return i instanceof n&&this.receiver.isEquivalent(i.receiver)&&this.index.isEquivalent(i.index)}isConstant(){return!1}visitExpression(i,e){return i.visitReadKeyExpr(this,e)}set(i){return new gi(st.Assign,this.receiver.key(this.index),i,null,this.sourceSpan)}clone(){return new n(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}},wc=class n extends Bi{entries;constructor(i,e,t){super(e,t),this.entries=i}isConstant(){return this.entries.every(i=>i.isConstant())}isEquivalent(i){return i instanceof n&&Ts(this.entries,i.entries)}visitExpression(i,e){return i.visitLiteralArrayExpr(this,e)}clone(){return new n(this.entries.map(i=>i.clone()),this.type,this.sourceSpan)}},xh=class n{key;value;quoted;constructor(i,e,t){this.key=i,this.value=e,this.quoted=t}isEquivalent(i){return this.key===i.key&&this.value.isEquivalent(i.value)}clone(){return new n(this.key,this.value.clone(),this.quoted)}isConstant(){return this.value.isConstant()}},rm=class n{expression;constructor(i){this.expression=i}isEquivalent(i){return i instanceof n&&this.expression.isEquivalent(i.expression)}clone(){return new n(this.expression.clone())}isConstant(){return this.expression.isConstant()}},Rl=class n extends Bi{entries;valueType=null;constructor(i,e,t){super(e,t),this.entries=i,e&&(this.valueType=e.valueType)}isEquivalent(i){return i instanceof n&&Ts(this.entries,i.entries)}isConstant(){return this.entries.every(i=>i.isConstant())}visitExpression(i,e){return i.visitLiteralMapExpr(this,e)}clone(){let i=this.entries.map(e=>e.clone());return new n(i,this.type,this.sourceSpan)}};var $p=class n extends Bi{expression;constructor(i,e){super(null,e),this.expression=i}isEquivalent(i){return i instanceof n&&this.expression.isEquivalent(i.expression)}isConstant(){return this.expression.isConstant()}visitExpression(i,e){return i.visitSpreadElementExpr(this,e)}clone(){return new n(this.expression.clone(),this.sourceSpan)}},yh=new aa(null,null,null),C$=new aa(null,Ol,null),oa=(function(n){return n[n.None=0]="None",n[n.Final=1]="Final",n[n.Private=2]="Private",n[n.Exported=4]="Exported",n[n.Static=8]="Static",n})(oa||{}),zk=class{text;multiline;trailingNewline;constructor(i,e,t){this.text=i,this.multiline=e,this.trailingNewline=t}toString(){return this.multiline?` ${this.text} `:this.text}},t1=class extends zk{tags;constructor(i){super("",!0,!0),this.tags=i}toString(){return w$(this.tags)}},Hp=class{modifiers;sourceSpan;leadingComments;constructor(i=oa.None,e=null,t){this.modifiers=i,this.sourceSpan=e,this.leadingComments=t}hasModifier(i){return(this.modifiers&i)!==0}addLeadingComment(i){this.leadingComments=this.leadingComments??[],this.leadingComments.push(i)}},Rr=class n extends Hp{name;value;type;constructor(i,e,t,o,r,a){super(o,r,a),this.name=i,this.value=e,this.type=t||e&&e.type||null}isEquivalent(i){return i instanceof n&&this.name===i.name&&(this.value?!!i.value&&this.value.isEquivalent(i.value):!i.value)}visitStatement(i,e){return i.visitDeclareVarStmt(this,e)}},u_=class n extends Hp{name;params;statements;type;constructor(i,e,t,o,r,a,c){super(r,a,c),this.name=i,this.params=e,this.statements=t,this.type=o||null}isEquivalent(i){return i instanceof n&&Ts(this.params,i.params)&&Ts(this.statements,i.statements)}visitStatement(i,e){return i.visitDeclareFunctionStmt(this,e)}},sa=class n extends Hp{expr;constructor(i,e,t){super(oa.None,e,t),this.expr=i}isEquivalent(i){return i instanceof n&&this.expr.isEquivalent(i.expr)}visitStatement(i,e){return i.visitExpressionStmt(this,e)}},xr=class n extends Hp{value;constructor(i,e=null,t){super(oa.None,e,t),this.value=i}isEquivalent(i){return i instanceof n&&this.value.isEquivalent(i.value)}visitStatement(i,e){return i.visitReturnStmt(this,e)}},n1=class n extends Hp{condition;trueCase;falseCase;constructor(i,e,t=[],o,r){super(oa.None,o,r),this.condition=i,this.trueCase=e,this.falseCase=t}isEquivalent(i){return i instanceof n&&this.condition.isEquivalent(i.condition)&&Ts(this.trueCase,i.trueCase)&&Ts(this.falseCase,i.falseCase)}visitStatement(i,e){return i.visitIfStmt(this,e)}};function b$(n=[]){return new t1(n)}function Yn(n,i,e){return new Nl(n,i,e)}function Ut(n,i=null,e){return new zp(n,null,i,e)}function ra(n,i,e){return new tl(n,i,e)}function r0(n){return new Ch(n)}function Gi(n,i,e){return new wc(n,i,e)}function nl(n,i=null){return new Rl(n.map(e=>new xh(e.key,e.value,e.quoted)),i,null)}function x$(n,i){return new p_(n,i)}function am(n,i,e,t,o){return new om(n,i,e,t,o)}function Ds(n,i,e,t){return new eu(n,i,e,t)}function tb(n,i,e,t,o){return new n1(n,i,e,t,o)}function y$(n,i,e,t){return new c_(n,i,e,t)}function Te(n,i,e){return new aa(n,i,e)}function S$(n,i,e,t,o){return new e1(n,i,e,t,o)}function t5(n){let i="";if(n.tagName&&(i+=` @${n.tagName}`),n.text){if(n.text.match(/\/\*|\*\//))throw new Error('JSDoc text cannot contain "/*" and "*/"');i+=" "+n.text.replace(/@/g,"\\@")}return i}function w$(n){if(n.length===0)return"";if(n.length===1&&n[0].tagName&&!n[0].text)return`*${t5(n[0])} `;let i=`*
`;for(let e of n)i+=" *",i+=t5(e).replace(/\n/g,`
* `),i+=`
`;return i+=" ",i}var M$="_c",k$={},T$=50,i1=class n extends Bi{resolved;original;shared=!1;constructor(i){super(i.type),this.resolved=i,this.original=i}visitExpression(i,e){return e===k$?this.original.visitExpression(i,e):this.resolved.visitExpression(i,e)}isEquivalent(i){return i instanceof n&&this.resolved.isEquivalent(i.resolved)}isConstant(){return!0}clone(){throw new Error("Not supported.")}fixup(i){this.resolved=i,this.shared=!0}},o1=class{isClosureCompilerEnabled;statements=[];literals=new Map;literalFactories=new Map;sharedConstants=new Map;_claimedNames=new Map;nextNameIndex=0;constructor(i=!1){this.isClosureCompilerEnabled=i}getConstLiteral(i,e){if(i instanceof aa&&!n5(i)||i instanceof i1)return i;let t=h_.INSTANCE.keyOf(i),o=this.literals.get(t),r=!1;if(o||(o=new i1(i),this.literals.set(t,o),r=!0),!r&&!o.shared||r&&e){let a=this.freshName(),c,p;this.isClosureCompilerEnabled&&n5(i)?(c=new om([],[new xr(i)]),p=Yn(a).callFn([])):(c=i,p=Yn(a)),this.statements.push(new Rr(a,c,Ol,oa.Final)),o.fixup(p)}return o}getSharedConstant(i,e){let t=i.keyOf(e);if(!this.sharedConstants.has(t)){let o=this.freshName();this.sharedConstants.set(t,Yn(o)),this.statements.push(i.toSharedConstantDeclaration(o,e))}return this.sharedConstants.get(t)}getSharedFunctionReference(i,e,t=!0){let o=i instanceof eu;for(let a of this.statements)if(o&&a instanceof Rr&&a.value?.isEquivalent(i)||!o&&a instanceof u_&&i instanceof om&&i.isEquivalent(a))return Yn(a.name);let r=t?this.uniqueName(e):e;return this.statements.push(i instanceof om?i.toDeclStmt(r,oa.Final):new Rr(r,i,Ol,oa.Final,i.sourceSpan)),Yn(r)}uniqueName(i,e=!0){let t=this._claimedNames.get(i)??0,o=t===0&&!e?`${i}`:`${i}${t}`;return this._claimedNames.set(i,t+1),o}freshName(){return this.uniqueName(M$)}},h_=class n{static INSTANCE=new n;keyOf(i){if(i instanceof aa&&typeof i.value=="string")return`"${i.value}"`;if(i instanceof aa)return String(i.value);if(i instanceof bh)return`/${i.body}/${i.flags??""}`;if(i instanceof wc){let e=[];for(let t of i.entries)e.push(this.keyOf(t));return`[${e.join(",")}]`}else if(i instanceof Rl){let e=[];for(let t of i.entries)if(t instanceof rm)e.push("..."+this.keyOf(t.expression));else{let o=t.key;t.quoted&&(o=`"${o}"`),e.push(o+":"+this.keyOf(t.value))}return`{${e.join(",")}}`}else{if(i instanceof zp)return`import("${i.value.moduleName}", ${i.value.name})`;if(i instanceof Nl)return`read(${i.name})`;if(i instanceof Ch)return`typeof(${this.keyOf(i.expr)})`;if(i instanceof $p)return`...${this.keyOf(i.expression)}`;throw new Error(`${this.constructor.name} does not handle expressions of type ${i.constructor.name}`)}}};function n5(n){return n instanceof aa&&typeof n.value=="string"&&n.value.length>=T$}var Ce="@angular/core",fe=(()=>{class n{static core={name:null,moduleName:Ce};static namespaceHTML={name:"\u0275\u0275namespaceHTML",moduleName:Ce};static namespaceMathML={name:"\u0275\u0275namespaceMathML",moduleName:Ce};static namespaceSVG={name:"\u0275\u0275namespaceSVG",moduleName:Ce};static element={name:"\u0275\u0275element",moduleName:Ce};static elementStart={name:"\u0275\u0275elementStart",moduleName:Ce};static elementEnd={name:"\u0275\u0275elementEnd",moduleName:Ce};static domElement={name:"\u0275\u0275domElement",moduleName:Ce};static domElementStart={name:"\u0275\u0275domElementStart",moduleName:Ce};static domElementEnd={name:"\u0275\u0275domElementEnd",moduleName:Ce};static domElementContainer={name:"\u0275\u0275domElementContainer",moduleName:Ce};static domElementContainerStart={name:"\u0275\u0275domElementContainerStart",moduleName:Ce};static domElementContainerEnd={name:"\u0275\u0275domElementContainerEnd",moduleName:Ce};static domTemplate={name:"\u0275\u0275domTemplate",moduleName:Ce};static domListener={name:"\u0275\u0275domListener",moduleName:Ce};static advance={name:"\u0275\u0275advance",moduleName:Ce};static syntheticHostProperty={name:"\u0275\u0275syntheticHostProperty",moduleName:Ce};static syntheticHostListener={name:"\u0275\u0275syntheticHostListener",moduleName:Ce};static attribute={name:"\u0275\u0275attribute",moduleName:Ce};static classProp={name:"\u0275\u0275classProp",moduleName:Ce};static elementContainerStart={name:"\u0275\u0275elementContainerStart",moduleName:Ce};static elementContainerEnd={name:"\u0275\u0275elementContainerEnd",moduleName:Ce};static elementContainer={name:"\u0275\u0275elementContainer",moduleName:Ce};static styleMap={name:"\u0275\u0275styleMap",moduleName:Ce};static classMap={name:"\u0275\u0275classMap",moduleName:Ce};static styleProp={name:"\u0275\u0275styleProp",moduleName:Ce};static interpolate={name:"\u0275\u0275interpolate",moduleName:Ce};static interpolate1={name:"\u0275\u0275interpolate1",moduleName:Ce};static interpolate2={name:"\u0275\u0275interpolate2",moduleName:Ce};static interpolate3={name:"\u0275\u0275interpolate3",moduleName:Ce};static interpolate4={name:"\u0275\u0275interpolate4",moduleName:Ce};static interpolate5={name:"\u0275\u0275interpolate5",moduleName:Ce};static interpolate6={name:"\u0275\u0275interpolate6",moduleName:Ce};static interpolate7={name:"\u0275\u0275interpolate7",moduleName:Ce};static interpolate8={name:"\u0275\u0275interpolate8",moduleName:Ce};static interpolateV={name:"\u0275\u0275interpolateV",moduleName:Ce};static nextContext={name:"\u0275\u0275nextContext",moduleName:Ce};static resetView={name:"\u0275\u0275resetView",moduleName:Ce};static templateCreate={name:"\u0275\u0275template",moduleName:Ce};static defer={name:"\u0275\u0275defer",moduleName:Ce};static deferWhen={name:"\u0275\u0275deferWhen",moduleName:Ce};static deferOnIdle={name:"\u0275\u0275deferOnIdle",moduleName:Ce};static deferOnImmediate={name:"\u0275\u0275deferOnImmediate",moduleName:Ce};static deferOnTimer={name:"\u0275\u0275deferOnTimer",moduleName:Ce};static deferOnHover={name:"\u0275\u0275deferOnHover",moduleName:Ce};static deferOnInteraction={name:"\u0275\u0275deferOnInteraction",moduleName:Ce};static deferOnViewport={name:"\u0275\u0275deferOnViewport",moduleName:Ce};static deferPrefetchWhen={name:"\u0275\u0275deferPrefetchWhen",moduleName:Ce};static deferPrefetchOnIdle={name:"\u0275\u0275deferPrefetchOnIdle",moduleName:Ce};static deferPrefetchOnImmediate={name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:Ce};static deferPrefetchOnTimer={name:"\u0275\u0275deferPrefetchOnTimer",moduleName:Ce};static deferPrefetchOnHover={name:"\u0275\u0275deferPrefetchOnHover",moduleName:Ce};static deferPrefetchOnInteraction={name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:Ce};static deferPrefetchOnViewport={name:"\u0275\u0275deferPrefetchOnViewport",moduleName:Ce};static deferHydrateWhen={name:"\u0275\u0275deferHydrateWhen",moduleName:Ce};static deferHydrateNever={name:"\u0275\u0275deferHydrateNever",moduleName:Ce};static deferHydrateOnIdle={name:"\u0275\u0275deferHydrateOnIdle",moduleName:Ce};static deferHydrateOnImmediate={name:"\u0275\u0275deferHydrateOnImmediate",moduleName:Ce};static deferHydrateOnTimer={name:"\u0275\u0275deferHydrateOnTimer",moduleName:Ce};static deferHydrateOnHover={name:"\u0275\u0275deferHydrateOnHover",moduleName:Ce};static deferHydrateOnInteraction={name:"\u0275\u0275deferHydrateOnInteraction",moduleName:Ce};static deferHydrateOnViewport={name:"\u0275\u0275deferHydrateOnViewport",moduleName:Ce};static deferEnableTimerScheduling={name:"\u0275\u0275deferEnableTimerScheduling",moduleName:Ce};static conditionalCreate={name:"\u0275\u0275conditionalCreate",moduleName:Ce};static conditionalBranchCreate={name:"\u0275\u0275conditionalBranchCreate",moduleName:Ce};static conditional={name:"\u0275\u0275conditional",moduleName:Ce};static repeater={name:"\u0275\u0275repeater",moduleName:Ce};static repeaterCreate={name:"\u0275\u0275repeaterCreate",moduleName:Ce};static repeaterTrackByIndex={name:"\u0275\u0275repeaterTrackByIndex",moduleName:Ce};static repeaterTrackByIdentity={name:"\u0275\u0275repeaterTrackByIdentity",moduleName:Ce};static componentInstance={name:"\u0275\u0275componentInstance",moduleName:Ce};static text={name:"\u0275\u0275text",moduleName:Ce};static enableBindings={name:"\u0275\u0275enableBindings",moduleName:Ce};static disableBindings={name:"\u0275\u0275disableBindings",moduleName:Ce};static getCurrentView={name:"\u0275\u0275getCurrentView",moduleName:Ce};static textInterpolate={name:"\u0275\u0275textInterpolate",moduleName:Ce};static textInterpolate1={name:"\u0275\u0275textInterpolate1",moduleName:Ce};static textInterpolate2={name:"\u0275\u0275textInterpolate2",moduleName:Ce};static textInterpolate3={name:"\u0275\u0275textInterpolate3",moduleName:Ce};static textInterpolate4={name:"\u0275\u0275textInterpolate4",moduleName:Ce};static textInterpolate5={name:"\u0275\u0275textInterpolate5",moduleName:Ce};static textInterpolate6={name:"\u0275\u0275textInterpolate6",moduleName:Ce};static textInterpolate7={name:"\u0275\u0275textInterpolate7",moduleName:Ce};static textInterpolate8={name:"\u0275\u0275textInterpolate8",moduleName:Ce};static textInterpolateV={name:"\u0275\u0275textInterpolateV",moduleName:Ce};static restoreView={name:"\u0275\u0275restoreView",moduleName:Ce};static pureFunction0={name:"\u0275\u0275pureFunction0",moduleName:Ce};static pureFunction1={name:"\u0275\u0275pureFunction1",moduleName:Ce};static pureFunction2={name:"\u0275\u0275pureFunction2",moduleName:Ce};static pureFunction3={name:"\u0275\u0275pureFunction3",moduleName:Ce};static pureFunction4={name:"\u0275\u0275pureFunction4",moduleName:Ce};static pureFunction5={name:"\u0275\u0275pureFunction5",moduleName:Ce};static pureFunction6={name:"\u0275\u0275pureFunction6",moduleName:Ce};static pureFunction7={name:"\u0275\u0275pureFunction7",moduleName:Ce};static pureFunction8={name:"\u0275\u0275pureFunction8",moduleName:Ce};static pureFunctionV={name:"\u0275\u0275pureFunctionV",moduleName:Ce};static pipeBind1={name:"\u0275\u0275pipeBind1",moduleName:Ce};static pipeBind2={name:"\u0275\u0275pipeBind2",moduleName:Ce};static pipeBind3={name:"\u0275\u0275pipeBind3",moduleName:Ce};static pipeBind4={name:"\u0275\u0275pipeBind4",moduleName:Ce};static pipeBindV={name:"\u0275\u0275pipeBindV",moduleName:Ce};static domProperty={name:"\u0275\u0275domProperty",moduleName:Ce};static ariaProperty={name:"\u0275\u0275ariaProperty",moduleName:Ce};static property={name:"\u0275\u0275property",moduleName:Ce};static control={name:"\u0275\u0275control",moduleName:Ce};static controlCreate={name:"\u0275\u0275controlCreate",moduleName:Ce};static animationEnterListener={name:"\u0275\u0275animateEnterListener",moduleName:Ce};static animationLeaveListener={name:"\u0275\u0275animateLeaveListener",moduleName:Ce};static animationEnter={name:"\u0275\u0275animateEnter",moduleName:Ce};static animationLeave={name:"\u0275\u0275animateLeave",moduleName:Ce};static i18n={name:"\u0275\u0275i18n",moduleName:Ce};static i18nAttributes={name:"\u0275\u0275i18nAttributes",moduleName:Ce};static i18nExp={name:"\u0275\u0275i18nExp",moduleName:Ce};static i18nStart={name:"\u0275\u0275i18nStart",moduleName:Ce};static i18nEnd={name:"\u0275\u0275i18nEnd",moduleName:Ce};static i18nApply={name:"\u0275\u0275i18nApply",moduleName:Ce};static i18nPostprocess={name:"\u0275\u0275i18nPostprocess",moduleName:Ce};static pipe={name:"\u0275\u0275pipe",moduleName:Ce};static projection={name:"\u0275\u0275projection",moduleName:Ce};static projectionDef={name:"\u0275\u0275projectionDef",moduleName:Ce};static reference={name:"\u0275\u0275reference",moduleName:Ce};static inject={name:"\u0275\u0275inject",moduleName:Ce};static injectAttribute={name:"\u0275\u0275injectAttribute",moduleName:Ce};static directiveInject={name:"\u0275\u0275directiveInject",moduleName:Ce};static invalidFactory={name:"\u0275\u0275invalidFactory",moduleName:Ce};static invalidFactoryDep={name:"\u0275\u0275invalidFactoryDep",moduleName:Ce};static templateRefExtractor={name:"\u0275\u0275templateRefExtractor",moduleName:Ce};static forwardRef={name:"forwardRef",moduleName:Ce};static resolveForwardRef={name:"resolveForwardRef",moduleName:Ce};static replaceMetadata={name:"\u0275\u0275replaceMetadata",moduleName:Ce};static getReplaceMetadataURL={name:"\u0275\u0275getReplaceMetadataURL",moduleName:Ce};static \u0275\u0275defineInjectable={name:"\u0275\u0275defineInjectable",moduleName:Ce};static declareInjectable={name:"\u0275\u0275ngDeclareInjectable",moduleName:Ce};static InjectableDeclaration={name:"\u0275\u0275InjectableDeclaration",moduleName:Ce};static resolveWindow={name:"\u0275\u0275resolveWindow",moduleName:Ce};static resolveDocument={name:"\u0275\u0275resolveDocument",moduleName:Ce};static resolveBody={name:"\u0275\u0275resolveBody",moduleName:Ce};static getComponentDepsFactory={name:"\u0275\u0275getComponentDepsFactory",moduleName:Ce};static defineComponent={name:"\u0275\u0275defineComponent",moduleName:Ce};static declareComponent={name:"\u0275\u0275ngDeclareComponent",moduleName:Ce};static setComponentScope={name:"\u0275\u0275setComponentScope",moduleName:Ce};static ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:Ce};static ViewEncapsulation={name:"ViewEncapsulation",moduleName:Ce};static ComponentDeclaration={name:"\u0275\u0275ComponentDeclaration",moduleName:Ce};static FactoryDeclaration={name:"\u0275\u0275FactoryDeclaration",moduleName:Ce};static declareFactory={name:"\u0275\u0275ngDeclareFactory",moduleName:Ce};static FactoryTarget={name:"\u0275\u0275FactoryTarget",moduleName:Ce};static defineDirective={name:"\u0275\u0275defineDirective",moduleName:Ce};static declareDirective={name:"\u0275\u0275ngDeclareDirective",moduleName:Ce};static DirectiveDeclaration={name:"\u0275\u0275DirectiveDeclaration",moduleName:Ce};static InjectorDef={name:"\u0275\u0275InjectorDef",moduleName:Ce};static InjectorDeclaration={name:"\u0275\u0275InjectorDeclaration",moduleName:Ce};static defineInjector={name:"\u0275\u0275defineInjector",moduleName:Ce};static declareInjector={name:"\u0275\u0275ngDeclareInjector",moduleName:Ce};static NgModuleDeclaration={name:"\u0275\u0275NgModuleDeclaration",moduleName:Ce};static ModuleWithProviders={name:"ModuleWithProviders",moduleName:Ce};static defineNgModule={name:"\u0275\u0275defineNgModule",moduleName:Ce};static declareNgModule={name:"\u0275\u0275ngDeclareNgModule",moduleName:Ce};static setNgModuleScope={name:"\u0275\u0275setNgModuleScope",moduleName:Ce};static registerNgModuleType={name:"\u0275\u0275registerNgModuleType",moduleName:Ce};static PipeDeclaration={name:"\u0275\u0275PipeDeclaration",moduleName:Ce};static definePipe={name:"\u0275\u0275definePipe",moduleName:Ce};static declarePipe={name:"\u0275\u0275ngDeclarePipe",moduleName:Ce};static declareClassMetadata={name:"\u0275\u0275ngDeclareClassMetadata",moduleName:Ce};static declareClassMetadataAsync={name:"\u0275\u0275ngDeclareClassMetadataAsync",moduleName:Ce};static setClassMetadata={name:"\u0275setClassMetadata",moduleName:Ce};static setClassMetadataAsync={name:"\u0275setClassMetadataAsync",moduleName:Ce};static setClassDebugInfo={name:"\u0275setClassDebugInfo",moduleName:Ce};static queryRefresh={name:"\u0275\u0275queryRefresh",moduleName:Ce};static viewQuery={name:"\u0275\u0275viewQuery",moduleName:Ce};static loadQuery={name:"\u0275\u0275loadQuery",moduleName:Ce};static contentQuery={name:"\u0275\u0275contentQuery",moduleName:Ce};static viewQuerySignal={name:"\u0275\u0275viewQuerySignal",moduleName:Ce};static contentQuerySignal={name:"\u0275\u0275contentQuerySignal",moduleName:Ce};static queryAdvance={name:"\u0275\u0275queryAdvance",moduleName:Ce};static twoWayProperty={name:"\u0275\u0275twoWayProperty",moduleName:Ce};static twoWayBindingSet={name:"\u0275\u0275twoWayBindingSet",moduleName:Ce};static twoWayListener={name:"\u0275\u0275twoWayListener",moduleName:Ce};static declareLet={name:"\u0275\u0275declareLet",moduleName:Ce};static storeLet={name:"\u0275\u0275storeLet",moduleName:Ce};static readContextLet={name:"\u0275\u0275readContextLet",moduleName:Ce};static arrowFunction={name:"\u0275\u0275arrowFunction",moduleName:Ce};static attachSourceLocations={name:"\u0275\u0275attachSourceLocations",moduleName:Ce};static NgOnChangesFeature={name:"\u0275\u0275NgOnChangesFeature",moduleName:Ce};static ControlFeature={name:"\u0275\u0275ControlFeature",moduleName:Ce};static InheritDefinitionFeature={name:"\u0275\u0275InheritDefinitionFeature",moduleName:Ce};static ProvidersFeature={name:"\u0275\u0275ProvidersFeature",moduleName:Ce};static HostDirectivesFeature={name:"\u0275\u0275HostDirectivesFeature",moduleName:Ce};static ExternalStylesFeature={name:"\u0275\u0275ExternalStylesFeature",moduleName:Ce};static listener={name:"\u0275\u0275listener",moduleName:Ce};static getInheritedFactory={name:"\u0275\u0275getInheritedFactory",moduleName:Ce};static sanitizeHtml={name:"\u0275\u0275sanitizeHtml",moduleName:Ce};static sanitizeStyle={name:"\u0275\u0275sanitizeStyle",moduleName:Ce};static validateAttribute={name:"\u0275\u0275validateAttribute",moduleName:Ce};static sanitizeResourceUrl={name:"\u0275\u0275sanitizeResourceUrl",moduleName:Ce};static sanitizeScript={name:"\u0275\u0275sanitizeScript",moduleName:Ce};static sanitizeUrl={name:"\u0275\u0275sanitizeUrl",moduleName:Ce};static sanitizeUrlOrResourceUrl={name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:Ce};static trustConstantHtml={name:"\u0275\u0275trustConstantHtml",moduleName:Ce};static trustConstantResourceUrl={name:"\u0275\u0275trustConstantResourceUrl",moduleName:Ce};static inputDecorator={name:"Input",moduleName:Ce};static outputDecorator={name:"Output",moduleName:Ce};static viewChildDecorator={name:"ViewChild",moduleName:Ce};static viewChildrenDecorator={name:"ViewChildren",moduleName:Ce};static contentChildDecorator={name:"ContentChild",moduleName:Ce};static contentChildrenDecorator={name:"ContentChildren",moduleName:Ce};static InputSignalBrandWriteType={name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:Ce};static UnwrapDirectiveSignalInputs={name:"\u0275UnwrapDirectiveSignalInputs",moduleName:Ce};static unwrapWritableSignal={name:"\u0275unwrapWritableSignal",moduleName:Ce};static assertType={name:"\u0275assertType",moduleName:Ce}}return n})(),E$=/-+([a-z0-9])/g;function D$(n){return n.replace(E$,(...i)=>i[1].toUpperCase())}function P$(n,i){return GN(n,":",i)}function I$(n,i){return GN(n,".",i)}function GN(n,i,e){let t=n.indexOf(i);return t==-1?e:[n.slice(0,t).trim(),n.slice(t+1).trim()]}function A$(n){let i=[];for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t>=55296&&t<=56319&&n.length>e+1){let o=n.charCodeAt(e+1);o>=56320&&o<=57343&&(e++,t=(t-55296<<10)+o-56320+65536)}t<=127?i.push(t):t<=2047?i.push(t>>6&31|192,t&63|128):t<=65535?i.push(t>>12|224,t>>6&63|128,t&63|128):t<=2097151&&i.push(t>>18&7|240,t>>12&63|128,t>>6&63|128,t&63|128)}return i}function WN(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(WN).join(", ")}]`;if(n==null)return""+n;let i=n.overriddenName||n.name;if(i)return`${i}`;if(!n.toString)return"object";let e=n.toString();if(e==null)return""+e;let t=e.indexOf(`
`);return t>=0?e.slice(0,t):e}var jk=class{full;major;minor;patch;constructor(i){this.full=i;let e=i.split(".");this.major=e[0],this.minor=e[1],this.patch=e.slice(2).join(".")}},Jg=globalThis,O$=/^([1-9]|1[0-8])\./;function qN(n){return n.startsWith("0.")?!0:!O$.test(n)}var N$=3,F$="# sourceMappingURL=data:application/json;base64,",$k=class{file;sourcesContent=new Map;lines=[];lastCol0=0;hasMappings=!1;constructor(i=null){this.file=i}addSource(i,e=null){return this.sourcesContent.has(i)||this.sourcesContent.set(i,e),this}addLine(){return this.lines.push([]),this.lastCol0=0,this}addMapping(i,e,t,o){if(!this.currentLine)throw new Error("A line must be added before mappings can be added");if(e!=null&&!this.sourcesContent.has(e))throw new Error(`Unknown source file "${e}"`);if(i==null)throw new Error("The column in the generated code must be provided");if(i<this.lastCol0)throw new Error("Mapping should be added in output order");if(e&&(t==null||o==null))throw new Error("The source location must be provided when a source url is provided");return this.hasMappings=!0,this.lastCol0=i,this.currentLine.push({col0:i,sourceUrl:e,sourceLine0:t,sourceCol0:o}),this}get currentLine(){return this.lines.slice(-1)[0]}toJSON(){if(!this.hasMappings)return null;let i=new Map,e=[],t=[];Array.from(this.sourcesContent.keys()).forEach((u,h)=>{i.set(u,h),e.push(u),t.push(this.sourcesContent.get(u)||null)});let o="",r=0,a=0,c=0,p=0;return this.lines.forEach(u=>{r=0,o+=u.map(h=>{let _=PC(h.col0-r);return r=h.col0,h.sourceUrl!=null&&(_+=PC(i.get(h.sourceUrl)-a),a=i.get(h.sourceUrl),_+=PC(h.sourceLine0-c),c=h.sourceLine0,_+=PC(h.sourceCol0-p),p=h.sourceCol0),_}).join(","),o+=";"}),o=o.slice(0,-1),{file:this.file||"",version:N$,sourceRoot:"",sources:e,sourcesContent:t,mappings:o}}toJsComment(){return this.hasMappings?"//"+F$+R$(JSON.stringify(this,null,0)):""}};function R$(n){let i="",e=A$(n);for(let t=0;t<e.length;){let o=e[t++],r=t<e.length?e[t++]:null,a=t<e.length?e[t++]:null;i+=Qg(o>>2),i+=Qg((o&3)<<4|(r===null?0:r>>4)),i+=r===null?"=":Qg((r&15)<<2|(a===null?0:a>>6)),i+=r===null||a===null?"=":Qg(a&63)}return i}function PC(n){n=n<0?(-n<<1)+1:n<<1;let i="";do{let e=n&31;n=n>>5,n>0&&(e=e|32),i+=Qg(e)}while(n>0);return i}var L$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Qg(n){if(n<0||n>=64)throw new Error("Can only encode value in the range [0, 63]");return L$[n]}var V$=/'|\\|\n|\r|\$/g,B$=/^[$A-Z_][0-9A-Z_$]*$/i,Hk=" ",r1=class{indent;partsLength=0;parts=[];srcSpans=[];constructor(i){this.indent=i}},z$=new Map([[st.And,"&&"],[st.Bigger,">"],[st.BiggerEquals,">="],[st.BitwiseOr,"|"],[st.BitwiseAnd,"&"],[st.Divide,"/"],[st.Assign,"="],[st.Equals,"=="],[st.Identical,"==="],[st.Lower,"<"],[st.LowerEquals,"<="],[st.Minus,"-"],[st.Modulo,"%"],[st.Exponentiation,"**"],[st.Multiply,"*"],[st.NotEquals,"!="],[st.NotIdentical,"!=="],[st.NullishCoalesce,"??"],[st.Or,"||"],[st.Plus,"+"],[st.In,"in"],[st.InstanceOf,"instanceof"],[st.AdditionAssignment,"+="],[st.SubtractionAssignment,"-="],[st.MultiplicationAssignment,"*="],[st.DivisionAssignment,"/="],[st.RemainderAssignment,"%="],[st.ExponentiationAssignment,"**="],[st.AndAssignment,"&&="],[st.OrAssignment,"||="],[st.NullishCoalesceAssignment,"??="]]),Uk=class n{_indent;static createRoot(){return new n(0)}_lines;constructor(i){this._indent=i,this._lines=[new r1(i)]}get _currentLine(){return this._lines[this._lines.length-1]}println(i,e=""){this.print(i||null,e,!0)}lineIsEmpty(){return this._currentLine.parts.length===0}lineLength(){return this._currentLine.indent*Hk.length+this._currentLine.partsLength}print(i,e,t=!1){e.length>0&&(this._currentLine.parts.push(e),this._currentLine.partsLength+=e.length,this._currentLine.srcSpans.push(i&&i.sourceSpan||null)),t&&this._lines.push(new r1(this._indent))}removeEmptyLastLine(){this.lineIsEmpty()&&this._lines.pop()}incIndent(){this._indent++,this.lineIsEmpty()&&(this._currentLine.indent=this._indent)}decIndent(){this._indent--,this.lineIsEmpty()&&(this._currentLine.indent=this._indent)}toSource(){return this.sourceLines.map(i=>i.parts.length>0?i5(i.indent)+i.parts.join(""):"").join(`
`)}toSourceMapGenerator(i,e=0){let t=new $k(i),o=!1,r=()=>{o||(t.addSource(i," ").addMapping(0,i,0,0),o=!0)};for(let a=0;a<e;a++)t.addLine(),r();return this.sourceLines.forEach((a,c)=>{t.addLine();let p=a.srcSpans,u=a.parts,h=a.indent*Hk.length,_=0;for(;_<p.length&&!p[_];)h+=u[_].length,_++;for(_<p.length&&c===0&&h===0?o=!0:r();_<p.length;){let S=p[_],x=S.start.file,b=S.start.line,M=S.start.col;for(t.addSource(x.url,x.content).addMapping(h,x.url,b,M),h+=u[_].length,_++;_<p.length&&(S===p[_]||!p[_]);)h+=u[_].length,_++}}),t}spanOf(i,e){let t=this._lines[i];if(t){let o=e-i5(t.indent).length;for(let r=0;r<t.parts.length;r++){let a=t.parts[r];if(a.length>o)return t.srcSpans[r];o-=a.length}}return null}get sourceLines(){return this._lines.length&&this._lines[this._lines.length-1].parts.length===0?this._lines.slice(0,-1):this._lines}},Gk=class{_escapeDollarInStrings;lastIfCondition=null;constructor(i){this._escapeDollarInStrings=i}printLeadingComments(i,e){if(i.leadingComments!==void 0)for(let t of i.leadingComments)t instanceof t1?e.print(i,`/*${t.toString()}*/`,t.trailingNewline):t.multiline?e.print(i,`/* ${t.text} */`,t.trailingNewline):t.text.split(`
`).forEach(o=>{e.println(i,`// ${o}`)})}visitExpressionStmt(i,e){return this.printLeadingComments(i,e),i.expr.visitExpression(this,e),e.println(i,";"),null}visitReturnStmt(i,e){return this.printLeadingComments(i,e),e.print(i,"return "),i.value.visitExpression(this,e),e.println(i,";"),null}visitIfStmt(i,e){this.printLeadingComments(i,e),e.print(i,"if ("),this.lastIfCondition=i.condition,i.condition.visitExpression(this,e),this.lastIfCondition=null,e.print(i,") {");let t=i.falseCase!=null&&i.falseCase.length>0;return i.trueCase.length<=1&&!t?(e.print(i," "),this.visitAllStatements(i.trueCase,e),e.removeEmptyLastLine(),e.print(i," ")):(e.println(),e.incIndent(),this.visitAllStatements(i.trueCase,e),e.decIndent(),t&&(e.println(i,"} else {"),e.incIndent(),this.visitAllStatements(i.falseCase,e),e.decIndent())),e.println(i,"}"),null}visitInvokeFunctionExpr(i,e){let t=i.fn instanceof eu;return t&&e.print(i.fn,"("),i.fn.visitExpression(this,e),t&&e.print(i.fn,")"),e.print(i,"("),this.visitAllExpressions(i.args,e,","),e.print(i,")"),null}visitTaggedTemplateLiteralExpr(i,e){return i.tag.visitExpression(this,e),i.template.visitExpression(this,e),null}visitTemplateLiteralExpr(i,e){e.print(i,"`");for(let t=0;t<i.elements.length;t++){i.elements[t].visitExpression(this,e);let o=t<i.expressions.length?i.expressions[t]:null;o!==null&&(e.print(o,"${"),o.visitExpression(this,e),e.print(o,"}"))}e.print(i,"`")}visitTemplateLiteralElementExpr(i,e){e.print(i,i.rawText)}visitWrappedNodeExpr(i,e){throw new Error("Abstract emitter cannot visit WrappedNodeExpr.")}visitTypeofExpr(i,e){e.print(i,"typeof "),i.expr.visitExpression(this,e)}visitVoidExpr(i,e){e.print(i,"void "),i.expr.visitExpression(this,e)}visitReadVarExpr(i,e){return e.print(i,i.name),null}visitInstantiateExpr(i,e){return e.print(i,"new "),i.classExpr.visitExpression(this,e),e.print(i,"("),this.visitAllExpressions(i.args,e,","),e.print(i,")"),null}visitLiteralExpr(i,e){let t=i.value;return typeof t=="string"?e.print(i,Tp(t,this._escapeDollarInStrings)):e.print(i,`${t}`),null}visitRegularExpressionLiteral(i,e){return e.print(i,`/${i.body}/${i.flags||""}`),null}visitLocalizedString(i,e){let t=i.serializeI18nHead();e.print(i,"$localize `"+t.raw);for(let o=1;o<i.messageParts.length;o++)e.print(i,"${"),i.expressions[o-1].visitExpression(this,e),e.print(i,`}${i.serializeI18nTemplatePart(o).raw}`);return e.print(i,"`"),null}visitConditionalExpr(i,e){return e.print(i,"("),i.condition.visitExpression(this,e),e.print(i,"? "),i.trueCase.visitExpression(this,e),e.print(i,": "),i.falseCase.visitExpression(this,e),e.print(i,")"),null}visitDynamicImportExpr(i,e){e.print(i,`import(${i.url})`)}visitNotExpr(i,e){return e.print(i,"!"),i.condition.visitExpression(this,e),null}visitUnaryOperatorExpr(i,e){let t;switch(i.operator){case l_.Plus:t="+";break;case l_.Minus:t="-";break;default:throw new Error(`Unknown operator ${i.operator}`)}let o=i!==this.lastIfCondition;return o&&e.print(i,"("),e.print(i,t),i.expr.visitExpression(this,e),o&&e.print(i,")"),null}visitBinaryOperatorExpr(i,e){let t=z$.get(i.operator);if(!t)throw new Error(`Unknown operator ${i.operator}`);let o=i!==this.lastIfCondition;return o&&e.print(i,"("),i.lhs.visitExpression(this,e),e.print(i,` ${t} `),i.rhs.visitExpression(this,e),o&&e.print(i,")"),null}visitReadPropExpr(i,e){return i.receiver.visitExpression(this,e),e.print(i,"."),e.print(i,i.name),null}visitReadKeyExpr(i,e){return i.receiver.visitExpression(this,e),e.print(i,"["),i.index.visitExpression(this,e),e.print(i,"]"),null}visitLiteralArrayExpr(i,e){return e.print(i,"["),this.visitAllExpressions(i.entries,e,","),e.print(i,"]"),null}visitLiteralMapExpr(i,e){return e.print(i,"{"),this.visitAllObjects(t=>{t instanceof rm?(e.print(i,"..."),t.expression.visitExpression(this,e)):(e.print(i,`${Tp(t.key,this._escapeDollarInStrings,t.quoted)}:`),t.value.visitExpression(this,e))},i.entries,e,","),e.print(i,"}"),null}visitCommaExpr(i,e){return e.print(i,"("),this.visitAllExpressions(i.parts,e,","),e.print(i,")"),null}visitParenthesizedExpr(i,e){i.expr.visitExpression(this,e)}visitSpreadElementExpr(i,e){e.print(i,"..."),i.expression.visitExpression(this,e)}visitAllExpressions(i,e,t){this.visitAllObjects(o=>o.visitExpression(this,e),i,e,t)}visitAllObjects(i,e,t,o){let r=!1;for(let a=0;a<e.length;a++)a>0&&(t.lineLength()>80?(t.print(null,o,!0),r||(t.incIndent(),t.incIndent(),r=!0)):t.print(null,o,!1)),i(e[a]);r&&(t.decIndent(),t.decIndent())}visitAllStatements(i,e){i.forEach(t=>t.visitStatement(this,e))}};function Tp(n,i,e=!0){if(n==null)return null;let t=n.replace(V$,(...r)=>r[0]=="$"?i?"\\$":"$":r[0]==`
`?"\\n":r[0]=="\r"?"\\r":`\\${r[0]}`);return e||!B$.test(t)?`'${t}'`:t}function i5(n){let i="";for(let e=0;e<n;e++)i+=Hk;return i}function nb(n,i){if(i===0)return ra(n);let e=[];for(let t=0;t<i;t++)e.push(is);return ra(n,void 0,e)}function j$(n,i){let e=Tp(i,!1,!1);return e!==i?`${n}[${e}]`:`${n}.${i}`}function $$(n){return H$("ngJitMode",n)}function H$(n,i){let e=new zp({name:n,moduleName:null}),t=new gi(st.Identical,new Ch(e),Te("undefined")),o=new gi(st.Or,t,e,void 0,void 0);return new gi(st.And,o,i)}function Nr(n){let i=new oi(n);return{value:i,type:i}}function Ep(n,i){let e=Gi(n.map(t=>t.value));return i?Ds([],e):e}function fE(n,i){return{expression:n,forwardRef:i}}function U$({expression:n,forwardRef:i}){switch(i){case 0:case 1:return n;case 2:return G$(n)}}function G$(n){return Ut(fe.forwardRef).callFn([Ds([],n)])}var a1=(function(n){return n[n.Class=0]="Class",n[n.Function=1]="Function",n})(a1||{});function wp(n){let i=Yn("__ngFactoryType__"),e=null,t=r5(n)?i:new gi(st.Or,i,n.type.value),o=null;n.deps!==null?n.deps!=="invalid"&&(o=new d_(t,o5(n.deps,n.target))):(e=Yn(`\u0275${n.name}_BaseFactory`),o=e.callFn([t]));let r=[],a=null;function c(u){let h=Yn("__ngConditionalFactory__");r.push(new Rr(h.name,yh,Ol));let _=o!==null?h.set(o).toStmt():Ut(fe.invalidFactory).callFn([]).toStmt();return r.push(tb(i,[_],[h.set(u).toStmt()])),h}if(r5(n)){let u=o5(n.delegateDeps,n.target),h=new(n.delegateType===a1.Class?d_:os)(n.delegate,u);a=c(h)}else K$(n)?a=c(n.expression):a=o;if(a===null)r.push(Ut(fe.invalidFactory).callFn([]).toStmt());else if(e!==null){let u=Ut(fe.getInheritedFactory).callFn([n.type.value]),h=new gi(st.Or,e,e.set(u));r.push(new xr(h.callFn([t])))}else r.push(new xr(a));let p=am([new br(i.name,is)],r,Ol,void 0,`${n.name}_Factory`);return e!==null&&(p=Ds([],[new Rr(e.name),new xr(p)]).callFn([],void 0,!0)),{expression:p,statements:[],type:W$(n)}}function W$(n){let i=n.deps!==null&&n.deps!=="invalid"?Q$(n.deps):yc;return ra(Ut(fe.FactoryDeclaration,[nb(n.type.type,n.typeArgumentCount),i]))}function o5(n,i){return n.map((e,t)=>q$(e,i,t))}function q$(n,i,e){if(n.token===null)return Ut(fe.invalidFactoryDep).callFn([Te(e)]);if(n.attributeNameType===null){let t=0|(n.self?2:0)|(n.skipSelf?4:0)|(n.host?1:0)|(n.optional?8:0)|(i===gd.Pipe?16:0),o=t!==0||n.optional?Te(t):null,r=[n.token];o&&r.push(o);let a=Y$(i);return Ut(a).callFn(r)}else return Ut(fe.injectAttribute).callFn([n.token])}function Q$(n){let i=!1,e=n.map(t=>{let o=X$(t);return o!==null?(i=!0,o):Te(null)});return i?ra(Gi(e)):yc}function X$(n){let i=[];return n.attributeNameType!==null&&i.push({key:"attribute",value:n.attributeNameType,quoted:!1}),n.optional&&i.push({key:"optional",value:Te(!0),quoted:!1}),n.host&&i.push({key:"host",value:Te(!0),quoted:!1}),n.self&&i.push({key:"self",value:Te(!0),quoted:!1}),n.skipSelf&&i.push({key:"skipSelf",value:Te(!0),quoted:!1}),i.length>0?nl(i):null}function r5(n){return n.delegateType!==void 0}function K$(n){return n.expression!==void 0}function Y$(n){switch(n){case gd.Component:case gd.Directive:case gd.Pipe:return fe.directiveInject;case gd.NgModule:case gd.Injectable:default:return fe.inject}}var Up=class{start;end;constructor(i,e){this.start=i,this.end=e}toAbsolute(i){return new Ms(i+this.start,i+this.end)}},to=class{span;sourceSpan;constructor(i,e){this.span=i,this.sourceSpan=e}toString(){return"AST"}},f_=class extends to{nameSpan;constructor(i,e,t){super(i,e),this.nameSpan=t}},_a=class extends to{visit(i,e=null){return i.visitEmptyExpr?.(this,e)}},Mc=class extends to{visit(i,e=null){return i.visitImplicitReceiver(this,e)}},g_=class extends to{visit(i,e=null){return i.visitThisReceiver?.(this,e)}},Sh=class extends to{expressions;constructor(i,e,t){super(i,e),this.expressions=t}visit(i,e=null){return i.visitChain(this,e)}},s1=class extends to{condition;trueExp;falseExp;constructor(i,e,t,o,r){super(i,e),this.condition=t,this.trueExp=o,this.falseExp=r}visit(i,e=null){return i.visitConditional(this,e)}},Cc=class extends f_{receiver;name;constructor(i,e,t,o,r){super(i,e,t),this.receiver=o,this.name=r}visit(i,e=null){return i.visitPropertyRead(this,e)}},__=class extends f_{receiver;name;constructor(i,e,t,o,r){super(i,e,t),this.receiver=o,this.name=r}visit(i,e=null){return i.visitSafePropertyRead(this,e)}},Gp=class extends to{receiver;key;constructor(i,e,t,o){super(i,e),this.receiver=t,this.key=o}visit(i,e=null){return i.visitKeyedRead(this,e)}},v_=class extends to{receiver;key;constructor(i,e,t,o){super(i,e),this.receiver=t,this.key=o}visit(i,e=null){return i.visitSafeKeyedRead(this,e)}},HC=(function(n){return n[n.ReferencedByName=0]="ReferencedByName",n[n.ReferencedDirectly=1]="ReferencedDirectly",n})(HC||{}),l1=class extends f_{exp;name;args;type;constructor(i,e,t,o,r,a,c){super(i,e,c),this.exp=t,this.name=o,this.args=r,this.type=a}visit(i,e=null){return i.visitPipe(this,e)}},Ja=class extends to{value;constructor(i,e,t){super(i,e),this.value=t}visit(i,e=null){return i.visitLiteralPrimitive(this,e)}},C_=class extends to{expressions;constructor(i,e,t){super(i,e),this.expressions=t}visit(i,e=null){return i.visitLiteralArray(this,e)}},c1=class extends to{expression;constructor(i,e,t){super(i,e),this.expression=t}visit(i,e=null){return i.visitSpreadElement(this,e)}},Wp=class extends to{keys;values;constructor(i,e,t,o){super(i,e),this.keys=t,this.values=o}visit(i,e=null){return i.visitLiteralMap(this,e)}},a0=class extends to{strings;expressions;constructor(i,e,t,o){super(i,e),this.strings=t,this.expressions=o}visit(i,e=null){return i.visitInterpolation(this,e)}},Na=class extends to{operation;left;right;constructor(i,e,t,o,r){super(i,e),this.operation=t,this.left=o,this.right=r}visit(i,e=null){return i.visitBinary(this,e)}static isAssignmentOperation(i){return i==="="||i==="+="||i==="-="||i==="*="||i==="/="||i==="%="||i==="**="||i==="&&="||i==="||="||i==="??="}},gh=class n extends Na{operator;expr;left=null;right=null;operation=null;static createMinus(i,e,t){return new n(i,e,"-",t,"-",new Ja(i,e,0),t)}static createPlus(i,e,t){return new n(i,e,"+",t,"-",t,new Ja(i,e,0))}constructor(i,e,t,o,r,a,c){super(i,e,r,a,c),this.operator=t,this.expr=o}visit(i,e=null){return i.visitUnary!==void 0?i.visitUnary(this,e):i.visitBinary(this,e)}},b_=class extends to{expression;constructor(i,e,t){super(i,e),this.expression=t}visit(i,e=null){return i.visitPrefixNot(this,e)}},x_=class extends to{expression;constructor(i,e,t){super(i,e),this.expression=t}visit(i,e=null){return i.visitTypeofExpression(this,e)}},y_=class extends to{expression;constructor(i,e,t){super(i,e),this.expression=t}visit(i,e=null){return i.visitVoidExpression(this,e)}},S_=class extends to{expression;constructor(i,e,t){super(i,e),this.expression=t}visit(i,e=null){return i.visitNonNullAssert(this,e)}},wh=class extends to{receiver;args;argumentSpan;constructor(i,e,t,o,r){super(i,e),this.receiver=t,this.args=o,this.argumentSpan=r}visit(i,e=null){return i.visitCall(this,e)}},d1=class extends to{receiver;args;argumentSpan;constructor(i,e,t,o,r){super(i,e),this.receiver=t,this.args=o,this.argumentSpan=r}visit(i,e=null){return i.visitSafeCall(this,e)}},w_=class extends to{tag;template;constructor(i,e,t,o){super(i,e),this.tag=t,this.template=o}visit(i,e){return i.visitTaggedTemplateLiteral(this,e)}},M_=class extends to{elements;expressions;constructor(i,e,t,o){super(i,e),this.elements=t,this.expressions=o}visit(i,e){return i.visitTemplateLiteral(this,e)}},m1=class extends to{text;constructor(i,e,t){super(i,e),this.text=t}visit(i,e){return i.visitTemplateLiteralElement(this,e)}},k_=class extends to{expression;constructor(i,e,t){super(i,e),this.expression=t}visit(i,e){return i.visitParenthesizedExpression(this,e)}},Wk=class{name;span;sourceSpan;constructor(i,e,t){this.name=i,this.span=e,this.sourceSpan=t}},p1=class extends to{parameters;body;constructor(i,e,t,o){super(i,e),this.parameters=t,this.body=o}visit(i,e){return i.visitArrowFunction(this,e)}},u1=class extends to{body;flags;constructor(i,e,t,o){super(i,e),this.body=t,this.flags=o}visit(i,e){return i.visitRegularExpressionLiteral(this,e)}},Ms=class{start;end;constructor(i,e){this.start=i,this.end=e}},ts=class extends to{ast;source;location;errors;constructor(i,e,t,o,r){super(new Up(0,e===null?0:e.length),new Ms(o,e===null?o:o+e.length)),this.ast=i,this.source=e,this.location=t,this.errors=r}visit(i,e=null){return i.visitASTWithSource?i.visitASTWithSource(this,e):this.ast.visit(i,e)}toString(){return`${this.source} in ${this.location}`}},T_=class{sourceSpan;key;value;constructor(i,e,t){this.sourceSpan=i,this.key=e,this.value=t}},qk=class{sourceSpan;key;value;constructor(i,e,t){this.sourceSpan=i,this.key=e,this.value=t}},Mh=class{visit(i,e){i.visit(this,e)}visitUnary(i,e){this.visit(i.expr,e)}visitBinary(i,e){this.visit(i.left,e),this.visit(i.right,e)}visitChain(i,e){this.visitAll(i.expressions,e)}visitConditional(i,e){this.visit(i.condition,e),this.visit(i.trueExp,e),this.visit(i.falseExp,e)}visitPipe(i,e){this.visit(i.exp,e),this.visitAll(i.args,e)}visitImplicitReceiver(i,e){}visitThisReceiver(i,e){}visitInterpolation(i,e){this.visitAll(i.expressions,e)}visitKeyedRead(i,e){this.visit(i.receiver,e),this.visit(i.key,e)}visitLiteralArray(i,e){this.visitAll(i.expressions,e)}visitLiteralMap(i,e){this.visitAll(i.values,e)}visitLiteralPrimitive(i,e){}visitPrefixNot(i,e){this.visit(i.expression,e)}visitTypeofExpression(i,e){this.visit(i.expression,e)}visitVoidExpression(i,e){this.visit(i.expression,e)}visitNonNullAssert(i,e){this.visit(i.expression,e)}visitPropertyRead(i,e){this.visit(i.receiver,e)}visitSafePropertyRead(i,e){this.visit(i.receiver,e)}visitSafeKeyedRead(i,e){this.visit(i.receiver,e),this.visit(i.key,e)}visitCall(i,e){this.visit(i.receiver,e),this.visitAll(i.args,e)}visitSafeCall(i,e){this.visit(i.receiver,e),this.visitAll(i.args,e)}visitTemplateLiteral(i,e){for(let t=0;t<i.elements.length;t++){this.visit(i.elements[t],e);let o=t<i.expressions.length?i.expressions[t]:null;o!==null&&this.visit(o,e)}}visitTemplateLiteralElement(i,e){}visitTaggedTemplateLiteral(i,e){this.visit(i.tag,e),this.visit(i.template,e)}visitParenthesizedExpression(i,e){this.visit(i.expression,e)}visitArrowFunction(i,e){this.visit(i.body,e)}visitRegularExpressionLiteral(i,e){}visitSpreadElement(i,e){this.visit(i.expression,e)}visitEmptyExpr(i,e){}visitAll(i,e){for(let t of i)this.visit(t,e)}},dh=class{name;expression;type;sourceSpan;keySpan;valueSpan;isLiteral;isLegacyAnimation;isAnimation;constructor(i,e,t,o,r,a){this.name=i,this.expression=e,this.type=t,this.sourceSpan=o,this.keySpan=r,this.valueSpan=a,this.isLiteral=this.type===fc.LITERAL_ATTR,this.isLegacyAnimation=this.type===fc.LEGACY_ANIMATION,this.isAnimation=this.type===fc.ANIMATION}},fc=(function(n){return n[n.DEFAULT=0]="DEFAULT",n[n.LITERAL_ATTR=1]="LITERAL_ATTR",n[n.LEGACY_ANIMATION=2]="LEGACY_ANIMATION",n[n.TWO_WAY=3]="TWO_WAY",n[n.ANIMATION=4]="ANIMATION",n})(fc||{}),Ba=(function(n){return n[n.Regular=0]="Regular",n[n.LegacyAnimation=1]="LegacyAnimation",n[n.TwoWay=2]="TwoWay",n[n.Animation=3]="Animation",n})(Ba||{}),h1=class{name;targetOrPhase;type;handler;sourceSpan;handlerSpan;keySpan;constructor(i,e,t,o,r,a,c){this.name=i,this.targetOrPhase=e,this.type=t,this.handler=o,this.sourceSpan=r,this.handlerSpan=a,this.keySpan=c}},Qk=class{name;value;sourceSpan;keySpan;valueSpan;constructor(i,e,t,o,r){this.name=i,this.value=e,this.sourceSpan=t,this.keySpan=o,this.valueSpan=r}},Ti=(function(n){return n[n.Property=0]="Property",n[n.Attribute=1]="Attribute",n[n.Class=2]="Class",n[n.Style=3]="Style",n[n.LegacyAnimation=4]="LegacyAnimation",n[n.TwoWay=5]="TwoWay",n[n.Animation=6]="Animation",n})(Ti||{}),f1=class{name;type;securityContext;value;unit;sourceSpan;keySpan;valueSpan;constructor(i,e,t,o,r,a,c,p){this.name=i,this.type=e,this.securityContext=t,this.value=o,this.unit=r,this.sourceSpan=a,this.keySpan=c,this.valueSpan=p}},gc=(function(n){return n[n.RAW_TEXT=0]="RAW_TEXT",n[n.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",n[n.PARSABLE_DATA=2]="PARSABLE_DATA",n})(gc||{});function Ll(n,i=!0){if(n[0]!=":")return[null,n];let e=n.indexOf(":",1);if(e===-1){if(i)throw new Error(`Unsupported format "${n}" expecting ":namespace:name"`);return[null,n]}return[n.slice(1,e),n.slice(e+1)]}function a5(n){return Ll(n)[1]==="ng-container"}function Xk(n){return Ll(n)[1]==="ng-content"}function Z$(n){return Ll(n)[1]==="ng-template"}function Kk(n){return n===null?null:Ll(n)[0]}function UC(n,i){return n?`:${n}:${i}`:i}var ib=class{value;sourceSpan;constructor(i,e){this.value=i,this.sourceSpan=e}visit(i){throw new Error("visit() not implemented for Comment")}},Dp=class{value;sourceSpan;constructor(i,e){this.value=i,this.sourceSpan=e}visit(i){return i.visitText(this)}},kh=class{value;sourceSpan;i18n;constructor(i,e,t){this.value=i,this.sourceSpan=e,this.i18n=t}visit(i){return i.visitBoundText(this)}},Th=class{name;value;sourceSpan;keySpan;valueSpan;i18n;constructor(i,e,t,o,r,a){this.name=i,this.value=e,this.sourceSpan=t,this.keySpan=o,this.valueSpan=r,this.i18n=a}visit(i){return i.visitTextAttribute(this)}},Yk=class n{name;type;securityContext;value;unit;sourceSpan;keySpan;valueSpan;i18n;constructor(i,e,t,o,r,a,c,p,u){this.name=i,this.type=e,this.securityContext=t,this.value=o,this.unit=r,this.sourceSpan=a,this.keySpan=c,this.valueSpan=p,this.i18n=u}static fromBoundElementProperty(i,e){if(i.keySpan===void 0)throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${i.name}: ${i.sourceSpan}`);return new n(i.name,i.type,i.securityContext,i.value,i.unit,i.sourceSpan,i.keySpan,i.valueSpan,e)}visit(i){return i.visitBoundAttribute(this)}},Zk=class n{name;type;handler;target;phase;sourceSpan;handlerSpan;keySpan;constructor(i,e,t,o,r,a,c,p){this.name=i,this.type=e,this.handler=t,this.target=o,this.phase=r,this.sourceSpan=a,this.handlerSpan=c,this.keySpan=p}static fromParsedEvent(i){let e=i.type===Ba.Regular?i.targetOrPhase:null,t=i.type===Ba.LegacyAnimation?i.targetOrPhase:null;if(i.keySpan===void 0)throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${i.name}: ${i.sourceSpan}`);return new n(i.name,i.type,i.handler,e,t,i.sourceSpan,i.handlerSpan,i.keySpan)}visit(i){return i.visitBoundEvent(this)}},kc=class{name;attributes;inputs;outputs;directives;children;references;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;isVoid;i18n;constructor(i,e,t,o,r,a,c,p,u,h,_,S,x){this.name=i,this.attributes=e,this.inputs=t,this.outputs=o,this.directives=r,this.children=a,this.references=c,this.isSelfClosing=p,this.sourceSpan=u,this.startSourceSpan=h,this.endSourceSpan=_,this.isVoid=S,this.i18n=x}visit(i){return i.visitElement(this)}},Tc=class{nameSpan;sourceSpan;prefetchSpan;whenOrOnSourceSpan;hydrateSpan;constructor(i,e,t,o,r){this.nameSpan=i,this.sourceSpan=e,this.prefetchSpan=t,this.whenOrOnSourceSpan=o,this.hydrateSpan=r}visit(i){return i.visitDeferredTrigger(this)}},g1=class extends Tc{value;constructor(i,e,t,o,r){super(null,e,t,o,r),this.value=i}},Jk=class extends Tc{},eT=class extends Tc{},tT=class extends Tc{},_1=class extends Tc{reference;constructor(i,e,t,o,r,a){super(e,t,o,r,a),this.reference=i}},nT=class extends Tc{delay;constructor(i,e,t,o,r,a){super(e,t,o,r,a),this.delay=i}},v1=class extends Tc{reference;constructor(i,e,t,o,r,a){super(e,t,o,r,a),this.reference=i}},E_=class extends Tc{reference;options;constructor(i,e,t,o,r,a,c){super(t,o,r,a,c),this.reference=i,this.options=e}},rs=class{nameSpan;sourceSpan;startSourceSpan;endSourceSpan;constructor(i,e,t,o){this.nameSpan=i,this.sourceSpan=e,this.startSourceSpan=t,this.endSourceSpan=o}},D_=class extends rs{children;minimumTime;i18n;constructor(i,e,t,o,r,a,c){super(t,o,r,a),this.children=i,this.minimumTime=e,this.i18n=c}visit(i){return i.visitDeferredBlockPlaceholder(this)}},P_=class extends rs{children;afterTime;minimumTime;i18n;constructor(i,e,t,o,r,a,c,p){super(o,r,a,c),this.children=i,this.afterTime=e,this.minimumTime=t,this.i18n=p}visit(i){return i.visitDeferredBlockLoading(this)}},I_=class extends rs{children;i18n;constructor(i,e,t,o,r,a){super(e,t,o,r),this.children=i,this.i18n=a}visit(i){return i.visitDeferredBlockError(this)}},qp=class extends rs{children;placeholder;loading;error;mainBlockSpan;i18n;triggers;prefetchTriggers;hydrateTriggers;definedTriggers;definedPrefetchTriggers;definedHydrateTriggers;constructor(i,e,t,o,r,a,c,p,u,h,_,S,x){super(p,u,_,S),this.children=i,this.placeholder=r,this.loading=a,this.error=c,this.mainBlockSpan=h,this.i18n=x,this.triggers=e,this.prefetchTriggers=t,this.hydrateTriggers=o,this.definedTriggers=Object.keys(e),this.definedPrefetchTriggers=Object.keys(t),this.definedHydrateTriggers=Object.keys(o)}visit(i){return i.visitDeferredBlock(this)}visitAll(i){this.visitTriggers(this.definedHydrateTriggers,this.hydrateTriggers,i),this.visitTriggers(this.definedTriggers,this.triggers,i),this.visitTriggers(this.definedPrefetchTriggers,this.prefetchTriggers,i),hk(i,this.children);let e=[this.placeholder,this.loading,this.error].filter(t=>t!==null);hk(i,e)}visitTriggers(i,e,t){hk(t,i.map(o=>e[o]))}},C1=class extends rs{expression;groups;unknownBlocks;exhaustiveCheck;constructor(i,e,t,o,r,a,c,p){super(p,r,a,c),this.expression=i,this.groups=e,this.unknownBlocks=t,this.exhaustiveCheck=o}visit(i){return i.visitSwitchBlock(this)}},iT=class extends rs{expression;constructor(i,e,t,o,r){super(r,e,t,o),this.expression=i}visit(i){return i.visitSwitchBlockCase(this)}},A_=class extends rs{cases;children;i18n;constructor(i,e,t,o,r,a,c){super(a,t,o,r),this.cases=i,this.children=e,this.i18n=c}visit(i){return i.visitSwitchBlockCaseGroup(this)}},oT=class extends rs{constructor(i,e,t,o){super(o,i,e,t)}visit(i){return i.visitSwitchExhaustiveCheck(this)}},Eh=class extends rs{item;expression;trackBy;trackKeywordSpan;contextVariables;children;empty;mainBlockSpan;i18n;constructor(i,e,t,o,r,a,c,p,u,h,_,S,x){super(S,p,h,_),this.item=i,this.expression=e,this.trackBy=t,this.trackKeywordSpan=o,this.contextVariables=r,this.children=a,this.empty=c,this.mainBlockSpan=u,this.i18n=x}visit(i){return i.visitForLoopBlock(this)}},O_=class extends rs{children;i18n;constructor(i,e,t,o,r,a){super(r,e,t,o),this.children=i,this.i18n=a}visit(i){return i.visitForLoopBlockEmpty(this)}},b1=class extends rs{branches;constructor(i,e,t,o,r){super(r,e,t,o),this.branches=i}visit(i){return i.visitIfBlock(this)}},Ap=class extends rs{expression;children;expressionAlias;i18n;constructor(i,e,t,o,r,a,c,p){super(c,o,r,a),this.expression=i,this.children=e,this.expressionAlias=t,this.i18n=p}visit(i){return i.visitIfBlockBranch(this)}},x1=class{name;sourceSpan;nameSpan;constructor(i,e,t){this.name=i,this.sourceSpan=e,this.nameSpan=t}visit(i){return i.visitUnknownBlock(this)}},gE=class{name;value;sourceSpan;nameSpan;valueSpan;constructor(i,e,t,o,r){this.name=i,this.value=e,this.sourceSpan=t,this.nameSpan=o,this.valueSpan=r}visit(i){return i.visitLetDeclaration(this)}},e_=class{componentName;tagName;fullName;attributes;inputs;outputs;directives;children;references;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;i18n;constructor(i,e,t,o,r,a,c,p,u,h,_,S,x,b){this.componentName=i,this.tagName=e,this.fullName=t,this.attributes=o,this.inputs=r,this.outputs=a,this.directives=c,this.children=p,this.references=u,this.isSelfClosing=h,this.sourceSpan=_,this.startSourceSpan=S,this.endSourceSpan=x,this.i18n=b}visit(i){return i.visitComponent(this)}},QN=class{name;attributes;inputs;outputs;references;sourceSpan;startSourceSpan;endSourceSpan;i18n;constructor(i,e,t,o,r,a,c,p,u){this.name=i,this.attributes=e,this.inputs=t,this.outputs=o,this.references=r,this.sourceSpan=a,this.startSourceSpan=c,this.endSourceSpan=p,this.i18n=u}visit(i){return i.visitDirective(this)}},ks=class{tagName;attributes;inputs;outputs;directives;templateAttrs;children;references;variables;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;i18n;constructor(i,e,t,o,r,a,c,p,u,h,_,S,x,b){this.tagName=i,this.attributes=e,this.inputs=t,this.outputs=o,this.directives=r,this.templateAttrs=a,this.children=c,this.references=p,this.variables=u,this.isSelfClosing=h,this.sourceSpan=_,this.startSourceSpan=S,this.endSourceSpan=x,this.i18n=b}visit(i){return i.visitTemplate(this)}},Dh=class{selector;attributes;children;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;i18n;name="ng-content";constructor(i,e,t,o,r,a,c,p){this.selector=i,this.attributes=e,this.children=t,this.isSelfClosing=o,this.sourceSpan=r,this.startSourceSpan=a,this.endSourceSpan=c,this.i18n=p}visit(i){return i.visitContent(this)}},sm=class{name;value;sourceSpan;keySpan;valueSpan;constructor(i,e,t,o,r){this.name=i,this.value=e,this.sourceSpan=t,this.keySpan=o,this.valueSpan=r}visit(i){return i.visitVariable(this)}},N_=class{name;value;sourceSpan;keySpan;valueSpan;constructor(i,e,t,o,r){this.name=i,this.value=e,this.sourceSpan=t,this.keySpan=o,this.valueSpan=r}visit(i){return i.visitReference(this)}},XN=class{vars;placeholders;sourceSpan;i18n;constructor(i,e,t,o){this.vars=i,this.placeholders=e,this.sourceSpan=t,this.i18n=o}visit(i){return i.visitIcu(this)}},F_=class{tagNames;bindings;listeners;sourceSpan;constructor(i,e,t,o){if(this.tagNames=i,this.bindings=e,this.listeners=t,this.sourceSpan=o,i.length===0)throw new Error("HostElement must have at least one tag name.")}visit(){throw new Error("HostElement cannot be visited")}};function hk(n,i){let e=[];if(n.visit)for(let t of i)n.visit(t);else for(let t of i){let o=t.visit(n);o&&e.push(o)}return e}var za=class{nodes;placeholders;placeholderToMessage;meaning;description;customId;sources;id;legacyIds=[];messageString;constructor(i,e,t,o,r,a){this.nodes=i,this.placeholders=e,this.placeholderToMessage=t,this.meaning=o,this.description=r,this.customId=a,this.id=this.customId,this.messageString=J$(this.nodes),i.length?this.sources=[{filePath:i[0].sourceSpan.start.file.url,startLine:i[0].sourceSpan.start.line+1,startCol:i[0].sourceSpan.start.col+1,endLine:i[i.length-1].sourceSpan.end.line+1,endCol:i[0].sourceSpan.start.col+1}]:this.sources=[]}},Vg=class{value;sourceSpan;constructor(i,e){this.value=i,this.sourceSpan=e}visit(i,e){return i.visitText(this,e)}},Cd=class{children;sourceSpan;constructor(i,e){this.children=i,this.sourceSpan=e}visit(i,e){return i.visitContainer(this,e)}},y1=class{expression;type;cases;sourceSpan;expressionPlaceholder;constructor(i,e,t,o,r){this.expression=i,this.type=e,this.cases=t,this.sourceSpan=o,this.expressionPlaceholder=r}visit(i,e){return i.visitIcu(this,e)}},lm=class{tag;attrs;startName;closeName;children;isVoid;sourceSpan;startSourceSpan;endSourceSpan;constructor(i,e,t,o,r,a,c,p,u){this.tag=i,this.attrs=e,this.startName=t,this.closeName=o,this.children=r,this.isVoid=a,this.sourceSpan=c,this.startSourceSpan=p,this.endSourceSpan=u}visit(i,e){return i.visitTagPlaceholder(this,e)}},R_=class{value;name;sourceSpan;constructor(i,e,t){this.value=i,this.name=e,this.sourceSpan=t}visit(i,e){return i.visitPlaceholder(this,e)}},Ph=class{value;name;sourceSpan;previousMessage;constructor(i,e,t){this.value=i,this.name=e,this.sourceSpan=t}visit(i,e){return i.visitIcuPlaceholder(this,e)}},cm=class{name;parameters;startName;closeName;children;sourceSpan;startSourceSpan;endSourceSpan;constructor(i,e,t,o,r,a,c,p){this.name=i,this.parameters=e,this.startName=t,this.closeName=o,this.children=r,this.sourceSpan=a,this.startSourceSpan=c,this.endSourceSpan=p}visit(i,e){return i.visitBlockPlaceholder(this,e)}};function J$(n){let i=new rT;return n.map(t=>t.visit(i)).join("")}var rT=class{visitText(i){return i.value}visitContainer(i){return i.children.map(e=>e.visit(this)).join("")}visitIcu(i){let e=Object.keys(i.cases).map(t=>`${t} {${i.cases[t].visit(this)}}`);return`{${i.expressionPlaceholder}, ${i.type}, ${e.join(" ")}}`}visitTagPlaceholder(i){let e=i.children.map(t=>t.visit(this)).join("");return`{$${i.startName}}${e}{$${i.closeName}}`}visitPlaceholder(i){return`{$${i.name}}`}visitIcuPlaceholder(i){return`{$${i.name}}`}visitBlockPlaceholder(i){let e=i.children.map(t=>t.visit(this)).join("");return`{$${i.startName}}${e}{$${i.closeName}}`}};var eH=class{visitTag(i){let e=this._serializeAttributes(i.attrs);if(i.children.length==0)return`<${i.name}${e}/>`;let t=i.children.map(o=>o.visit(this));return`<${i.name}${e}>${t.join("")}</${i.name}>`}visitText(i){return i.value}visitDeclaration(i){return`<?xml${this._serializeAttributes(i.attrs)} ?>`}_serializeAttributes(i){let e=Object.keys(i).map(t=>`${t}="${i[t]}"`).join(" ");return e.length>0?" "+e:""}visitDoctype(i){return`<!DOCTYPE ${i.rootTag} [
${i.dtd}
]>`}},h5e=new eH;function tH(n){return n.toUpperCase().replace(/[^A-Z0-9_]/g,"_")}var KN="i18n",aT="i18n-",nH="VAR_";function YN(n){return n===KN||n.startsWith(aT)}function iH(n){return n.attrs.some(i=>YN(i.name))}function ZN(n){return n.nodes[0]}function _E(n={},i){let e={};return n&&Object.keys(n).length&&Object.keys(n).forEach(t=>e[s0(t,i)]=n[t]),e}function s0(n,i=!0){let e=tH(n);if(!i)return e;let t=e.split("_");if(t.length===1)return n.toLowerCase();let o;/^\d+$/.test(t[t.length-1])&&(o=t.pop());let r=t.shift().toLowerCase();return t.length&&(r+=t.map(a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join("")),o?`${r}_${o}`:r}var oH=/[-.]/,vE="_t",Ps="ctx",Vh="rf";function JN(n,i){let e=null;return()=>(e||(n(new Rr(vE,void 0,is)),e=Yn(i)),e)}function mh(n){return Array.isArray(n)?Gi(n.map(mh)):Te(n,Ol)}function s5(n,i){let e=Object.getOwnPropertyNames(n);return e.length===0?null:nl(e.map(t=>{let o=n[t],r,a,c,p;if(typeof o=="string")r=t,c=t,a=o,p=mh(a);else{c=t,r=o.classPropertyName,a=o.bindingPropertyName;let u=a!==r,h=o.transformFunction!==null,_=qg.None;if(o.isSignal&&(_|=qg.SignalBased),h&&(_|=qg.HasDecoratorInputTransform),i&&(u||h||_!==qg.None)){let S=[Te(_),mh(a)];(u||h)&&(S.push(mh(r)),h&&S.push(o.transformFunction)),p=Gi(S)}else p=mh(a)}return{key:c,quoted:oH.test(c),value:p}}))}var dm=class{values=[];set(i,e){if(e){let t=this.values.find(o=>o.key===i);t?t.value=e:this.values.push({key:i,value:e,quoted:!1})}}toLiteralMap(){return nl(this.values)}};function rH(n){let i=n instanceof kc?n.name:"ng-template",e=aH(n),t=new vh,o=Ll(i)[1];return t.setElement(o),Object.getOwnPropertyNames(e).forEach(r=>{let a=Ll(r)[1],c=e[r];t.addAttribute(a,c),r.toLowerCase()==="class"&&c.trim().split(/\s+/).forEach(u=>t.addClassName(u))}),t}function aH(n){let i={};return n instanceof ks&&n.tagName!=="ng-template"?n.templateAttrs.forEach(e=>i[e.name]=""):(n.attributes.forEach(e=>{YN(e.name)||(i[e.name]=e.value)}),n.inputs.forEach(e=>{(e.type===Ti.Property||e.type===Ti.TwoWay)&&(i[e.name]="")}),n.outputs.forEach(e=>{i[e.name]=""})),i}function l5(n,i){let e=null,t={name:n.name,type:n.type,typeArgumentCount:n.typeArgumentCount,deps:[],target:gd.Injectable};if(n.useClass!==void 0){let c=n.useClass.expression.isEquivalent(n.type.value),p;n.deps!==void 0&&(p=n.deps),p!==void 0?e=wp(it(K({},t),{delegate:n.useClass.expression,delegateDeps:p,delegateType:a1.Class})):c?e=wp(t):e={statements:[],expression:c5(n.type.value,n.useClass.expression,i)}}else n.useFactory!==void 0?n.deps!==void 0?e=wp(it(K({},t),{delegate:n.useFactory,delegateDeps:n.deps||[],delegateType:a1.Function})):e={statements:[],expression:Ds([],n.useFactory.callFn([]))}:n.useValue!==void 0?e=wp(it(K({},t),{expression:n.useValue.expression})):n.useExisting!==void 0?e=wp(it(K({},t),{expression:Ut(fe.inject).callFn([n.useExisting.expression])})):e={statements:[],expression:c5(n.type.value,n.type.value,i)};let o=n.type.value,r=new dm;return r.set("token",o),r.set("factory",e.expression),n.providedIn.expression.value!==null&&r.set("providedIn",U$(n.providedIn)),{expression:Ut(fe.\u0275\u0275defineInjectable).callFn([r.toLiteralMap()],void 0,!0),type:sH(n),statements:e.statements}}function sH(n){return new tl(Ut(fe.InjectableDeclaration,[nb(n.type.type,n.typeArgumentCount)]))}function c5(n,i,e){if(n.node===i.node)return i.prop("\u0275fac");if(!e)return d5(i);let t=Ut(fe.resolveForwardRef).callFn([i]);return d5(t)}function d5(n){let i=new br("__ngFactoryType__",is);return Ds([i],n.prop("\u0275fac").callFn([Yn(i.name)]))}var Gr=0,lH=8,CE=9,Op=10,eF=11,tF=12,bE=13,nF=32,sT=33,L_=34,iF=35,ob=36,cH=37,S1=38,V_=39,Va=40,Cr=41,m5=42,oF=43,va=44,w1=45,yp=46,Qs=47,_c=58,es=59,_h=60,Hr=61,Ss=62,p5=63,xE=48,dH=55,rF=57,gm=65,mH=69,pH=70,uH=88,Bh=90,bc=91,Np=92,_d=93,hH=94,_m=95,Qp=97,fH=98,gH=101,yE=102,aF=110,sF=114,lF=116,cF=117,dF=118,mF=120,l0=122,Ys=123,u5=124,Ra=125,pF=160,nh=64,lT=96;function B_(n){return n>=CE&&n<=nF||n==pF}function Xs(n){return xE<=n&&n<=rF}function mm(n){return n>=Qp&&n<=l0||n>=gm&&n<=Bh}function _H(n){return n>=Qp&&n<=yE||n>=gm&&n<=pH||Xs(n)}function M1(n){return n===Op||n===bE}function h5(n){return xE<=n&&n<=dH}function t_(n){return n===V_||n===L_||n===lT}var z_=class n{file;offset;line;col;constructor(i,e,t,o){this.file=i,this.offset=e,this.line=t,this.col=o}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(i){let e=this.file.content,t=e.length,o=this.offset,r=this.line,a=this.col;for(;o>0&&i<0;)if(o--,i++,e.charCodeAt(o)==Op){r--;let p=e.substring(0,o-1).lastIndexOf(String.fromCharCode(Op));a=p>0?o-p:o}else a--;for(;o<t&&i>0;){let c=e.charCodeAt(o);o++,i--,c==Op?(r++,a=0):a++}return new n(this.file,o,r,a)}getContext(i,e){let t=this.file.content,o=this.offset;if(o!=null){o>t.length-1&&(o=t.length-1);let r=o,a=0,c=0;for(;a<i&&o>0&&(o--,a++,!(t[o]==`
`&&++c==e)););for(a=0,c=0;a<i&&r<t.length-1&&(r++,a++,!(t[r]==`
`&&++c==e)););return{before:t.substring(o,this.offset),after:t.substring(this.offset,r+1)}}return null}},k1=class{content;url;constructor(i,e){this.content=i,this.url=e}},gn=class{start;end;fullStart;details;constructor(i,e,t=i,o=null){this.start=i,this.end=e,this.fullStart=t,this.details=o}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},nm=(function(n){return n[n.WARNING=0]="WARNING",n[n.ERROR=1]="ERROR",n})(nm||{}),sn=class extends Error{span;msg;level;relatedError;constructor(i,e,t=nm.ERROR,o){super(e),this.span=i,this.msg=e,this.level=t,this.relatedError=o,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let i=this.span.start.getContext(100,3);return i?`${this.msg} ("${i.before}[${nm[this.level]} ->]${i.after}")`:this.msg}toString(){let i=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${i}`}};function vH(n,i,e){let t=`in ${n} ${i} in ${e}`,o=new k1("",t);return new gn(new z_(o,-1,-1,-1),new z_(o,-1,-1,-1))}var CH=0;function bH(n){if(!n||!n.reference)return null;let i=n.reference;if(i.__anonymousType)return i.__anonymousType;if(i.__forward_ref__)return"__forward_ref__";let e=WN(i);return e.indexOf("(")>=0?(e=`anonymous_${CH++}`,i.__anonymousType=e):e=Mp(e),e}function Mp(n){return n.replace(/\W/g,"_")}var f5='(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})',cT=class extends Gk{constructor(){super(!1)}visitWrappedNodeExpr(i,e){throw new Error("Cannot emit a WrappedNodeExpr in Javascript.")}visitDeclareVarStmt(i,e){return e.print(i,`var ${i.name}`),i.value&&(e.print(i," = "),i.value.visitExpression(this,e)),e.println(i,";"),null}visitTaggedTemplateLiteralExpr(i,e){let t=i.template.elements;return i.tag.visitExpression(this,e),e.print(i,`(${f5}(`),e.print(i,`[${t.map(o=>Tp(o.text,!1)).join(", ")}], `),e.print(i,`[${t.map(o=>Tp(o.rawText,!1)).join(", ")}])`),i.template.expressions.forEach(o=>{e.print(i,", "),o.visitExpression(this,e)}),e.print(i,")"),null}visitTemplateLiteralExpr(i,e){e.print(i,"`");for(let t=0;t<i.elements.length;t++){i.elements[t].visitExpression(this,e);let o=t<i.expressions.length?i.expressions[t]:null;o!==null&&(e.print(o,"${"),o.visitExpression(this,e),e.print(o,"}"))}e.print(i,"`")}visitTemplateLiteralElementExpr(i,e){return e.print(i,i.rawText),null}visitFunctionExpr(i,e){return e.print(i,`function${i.name?" "+i.name:""}(`),this._visitParams(i.params,e),e.println(i,") {"),e.incIndent(),this.visitAllStatements(i.statements,e),e.decIndent(),e.print(i,"}"),null}visitArrowFunctionExpr(i,e){if(e.print(i,"("),this._visitParams(i.params,e),e.print(i,") =>"),Array.isArray(i.body))e.println(i,"{"),e.incIndent(),this.visitAllStatements(i.body,e),e.decIndent(),e.print(i,"}");else{let t=i.body instanceof Rl;t&&e.print(i,"("),i.body.visitExpression(this,e),t&&e.print(i,")")}return null}visitDeclareFunctionStmt(i,e){return e.print(i,`function ${i.name}(`),this._visitParams(i.params,e),e.println(i,") {"),e.incIndent(),this.visitAllStatements(i.statements,e),e.decIndent(),e.println(i,"}"),null}visitLocalizedString(i,e){e.print(i,`$localize(${f5}(`);let t=[i.serializeI18nHead()];for(let o=1;o<i.messageParts.length;o++)t.push(i.serializeI18nTemplatePart(o));return e.print(i,`[${t.map(o=>Tp(o.cooked,!1)).join(", ")}], `),e.print(i,`[${t.map(o=>Tp(o.raw,!1)).join(", ")}])`),i.expressions.forEach(o=>{e.print(i,", "),o.visitExpression(this,e)}),e.print(i,")"),null}_visitParams(i,e){this.visitAllObjects(t=>e.print(null,t.name),i,e,",")}},IC;function xH(){if(IC===void 0){let n=Jg.trustedTypes;if(IC=null,n)try{IC=n.createPolicy("angular#unsafe-jit",{createScript:i=>i})}catch{}}return IC}function yH(n){return xH()?.createScript(n)||n}function g5(...n){if(!Jg.trustedTypes)return new Function(...n);let i=n.slice(0,-1).join(","),e=n[n.length-1],t=`(function anonymous(${i}
) { ${e}
})`,o=Jg.eval(yH(t));return o.bind===void 0?new Function(...n):(o.toString=()=>t,o.bind(Jg))}var dT=class{evaluateStatements(i,e,t,o){let r=new mT(t),a=Uk.createRoot();return e.length>0&&!SH(e[0])&&(e=[Te("use strict").toStmt(),...e]),r.visitAllStatements(e,a),r.createReturnStmt(a),this.evaluateCode(i,a,r.getArgs(),o)}evaluateCode(i,e,t,o){let r=`"use strict";${e.toSource()}
//# sourceURL=${i}`,a=[],c=[];for(let u in t)c.push(t[u]),a.push(u);if(o){let u=g5(...a.concat("return null;")).toString(),h=u.slice(0,u.indexOf("return null;")).split(`
`).length-1;r+=`
${e.toSourceMapGenerator(i,h).toJsComment()}`}let p=g5(...a.concat(r));return this.executeFunction(p,c)}executeFunction(i,e){return i(...e)}},mT=class extends cT{refResolver;_evalArgNames=[];_evalArgValues=[];_evalExportedVars=[];constructor(i){super(),this.refResolver=i}createReturnStmt(i){new xr(new Rl(this._evalExportedVars.map(t=>new xh(t,Yn(t),!1)))).visitStatement(this,i)}getArgs(){let i={};for(let e=0;e<this._evalArgNames.length;e++)i[this._evalArgNames[e]]=this._evalArgValues[e];return i}visitExternalExpr(i,e){return this._emitReferenceToExternal(i,this.refResolver.resolveExternalReference(i.value),e),null}visitWrappedNodeExpr(i,e){return this._emitReferenceToExternal(i,i.node,e),null}visitDeclareVarStmt(i,e){return i.hasModifier(oa.Exported)&&this._evalExportedVars.push(i.name),super.visitDeclareVarStmt(i,e)}visitDeclareFunctionStmt(i,e){return i.hasModifier(oa.Exported)&&this._evalExportedVars.push(i.name),super.visitDeclareFunctionStmt(i,e)}_emitReferenceToExternal(i,e,t){let o=this._evalArgValues.indexOf(e);if(o===-1){o=this._evalArgValues.length,this._evalArgValues.push(e);let r=bH({reference:e})||"val";this._evalArgNames.push(`jit_${r}_${o}`)}t.print(i,this._evalArgNames[o])}};function SH(n){return n.isEquivalent(Te("use strict").toStmt())}function _5(n){let i=new dm;n.providers!==null&&i.set("providers",n.providers),n.imports.length>0&&i.set("imports",Gi(n.imports));let e=Ut(fe.defineInjector).callFn([i.toLiteralMap()],void 0,!0),t=wH(n);return{expression:e,type:t,statements:[]}}function wH(n){return new tl(Ut(fe.InjectorDeclaration,[new tl(n.type.type)]))}var pT=class{context;constructor(i){this.context=i}resolveExternalReference(i){if(i.moduleName!=="@angular/core")throw new Error(`Cannot resolve external reference to ${i.moduleName}, only references to @angular/core are supported.`);if(!this.context.hasOwnProperty(i.name))throw new Error(`No value provided for @angular/core symbol '${i.name}'.`);return this.context[i.name]}},T1=(function(n){return n[n.Inline=0]="Inline",n[n.SideEffect=1]="SideEffect",n[n.Omit=2]="Omit",n})(T1||{}),im=(function(n){return n[n.Global=0]="Global",n[n.Local=1]="Local",n})(im||{});function MH(n){let i=[],e=new dm;if(e.set("type",n.type.value),n.kind===im.Global&&n.bootstrap.length>0&&e.set("bootstrap",Ep(n.bootstrap,n.containsForwardDecls)),n.selectorScopeMode===T1.Inline)n.declarations.length>0&&e.set("declarations",Ep(n.declarations,n.containsForwardDecls)),n.imports.length>0&&e.set("imports",Ep(n.imports,n.containsForwardDecls)),n.exports.length>0&&e.set("exports",Ep(n.exports,n.containsForwardDecls));else if(n.selectorScopeMode===T1.SideEffect){let r=EH(n);r!==null&&i.push(r)}n.schemas!==null&&n.schemas.length>0&&e.set("schemas",Gi(n.schemas.map(r=>r.value))),n.id!==null&&(e.set("id",n.id),i.push(Ut(fe.registerNgModuleType).callFn([n.type.value,n.id]).toStmt()));let t=Ut(fe.defineNgModule).callFn([e.toLiteralMap()],void 0,!0),o=TH(n);return{expression:t,type:o,statements:i}}function kH(n){let i=new dm;return i.set("type",new oi(n.type)),n.bootstrap!==void 0&&i.set("bootstrap",new oi(n.bootstrap)),n.declarations!==void 0&&i.set("declarations",new oi(n.declarations)),n.imports!==void 0&&i.set("imports",new oi(n.imports)),n.exports!==void 0&&i.set("exports",new oi(n.exports)),n.schemas!==void 0&&i.set("schemas",new oi(n.schemas)),n.id!==void 0&&i.set("id",new oi(n.id)),Ut(fe.defineNgModule).callFn([i.toLiteralMap()])}function TH(n){if(n.kind===im.Local)return new tl(n.type.value);let{type:i,declarations:e,exports:t,imports:o,includeImportTypes:r,publicDeclarationTypes:a}=n;return new tl(Ut(fe.NgModuleDeclaration,[new tl(i.type),a===null?fk(e):DH(a),r?fk(o):yc,fk(t)]))}function EH(n){let i=new dm;if(n.kind===im.Global?n.declarations.length>0&&i.set("declarations",Ep(n.declarations,n.containsForwardDecls)):n.declarationsExpression&&i.set("declarations",n.declarationsExpression),n.kind===im.Global?n.imports.length>0&&i.set("imports",Ep(n.imports,n.containsForwardDecls)):n.importsExpression&&i.set("imports",n.importsExpression),n.kind===im.Global?n.exports.length>0&&i.set("exports",Ep(n.exports,n.containsForwardDecls)):n.exportsExpression&&i.set("exports",n.exportsExpression),n.kind===im.Local&&n.bootstrapExpression&&i.set("bootstrap",n.bootstrapExpression),Object.keys(i.values).length===0)return null;let e=new os(Ut(fe.setNgModuleScope),[n.type.value,i.toLiteralMap()]),t=$$(e),o=new om([],[t.toStmt()]);return new os(o,[]).toStmt()}function fk(n){let i=n.map(e=>r0(e.type));return n.length>0?ra(Gi(i)):yc}function DH(n){let i=n.map(e=>r0(e));return n.length>0?ra(Gi(i)):yc}function v5(n){let i=[];i.push({key:"name",value:Te(n.pipeName??n.name),quoted:!1}),i.push({key:"type",value:n.type.value,quoted:!1}),i.push({key:"pure",value:Te(n.pure),quoted:!1}),n.isStandalone===!1&&i.push({key:"standalone",value:Te(!1),quoted:!1});let e=Ut(fe.definePipe).callFn([nl(i)],void 0,!0),t=PH(n);return{expression:e,type:t,statements:[]}}function PH(n){return new tl(Ut(fe.PipeDeclaration,[nb(n.type.type,n.typeArgumentCount),new tl(new aa(n.pipeName)),new tl(new aa(n.isStandalone))]))}var Ih=(function(n){return n[n.Directive=0]="Directive",n[n.Pipe=1]="Pipe",n[n.NgModule=2]="NgModule",n})(Ih||{}),IH=new Set(["inherit","initial","revert","unset","alternate","alternate-reverse","normal","reverse","backwards","both","forwards","none","paused","running","ease","ease-in","ease-in-out","ease-out","linear","step-start","step-end","end","jump-both","jump-end","jump-none","jump-start","start"]),AH=["@media","@supports","@document","@layer","@container","@scope","@starting-style"],uT=class{shimCssText(i,e,t=""){let o=[];i=i.replace(QH,c=>{if(c.match(XH))o.push(c);else{let p=c.match(qH);o.push(p?.join("")??"")}return wE}),i=this._insertDirectives(i);let r=this._scopeCssText(i,e,t),a=0;return r.replace(KH,()=>o[a++])}_insertDirectives(i){return i=this._insertPolyfillDirectivesInCssText(i),this._insertPolyfillRulesInCssText(i)}_scopeKeyframesRelatedCss(i,e){let t=new Set,o=AC(i,r=>this._scopeLocalKeyframeDeclarations(r,e,t));return AC(o,r=>this._scopeAnimationRule(r,e,t))}_scopeLocalKeyframeDeclarations(i,e,t){return it(K({},i),{selector:i.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/,(o,r,a,c,p)=>(t.add(x5(c,a)),`${r}${a}${e}_${c}${a}${p}`))})}_scopeAnimationKeyframe(i,e,t){return i.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/,(o,r,a,c,p)=>(c=`${t.has(x5(c,a))?e+"_":""}${c}`,`${r}${a}${c}${a}${p}`))}_animationDeclarationKeyframesRe=/(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;_scopeAnimationRule(i,e,t){let o=i.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g,(r,a,c)=>a+c.replace(this._animationDeclarationKeyframesRe,(p,u,h="",_,S)=>_?`${u}${this._scopeAnimationKeyframe(`${h}${_}${h}`,e,t)}`:IH.has(S)?p:`${u}${this._scopeAnimationKeyframe(S,e,t)}`));return o=o.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g,(r,a,c)=>`${a}${c.split(",").map(p=>this._scopeAnimationKeyframe(p,e,t)).join(",")}`),it(K({},i),{content:o})}_insertPolyfillDirectivesInCssText(i){return i.replace(NH,function(...e){return e[2]+"{"})}_insertPolyfillRulesInCssText(i){return i.replace(FH,(...e)=>{let t=e[0].replace(e[1],"").replace(e[2],"");return e[4]+t})}_scopeCssText(i,e,t){let o=this._extractUnscopedRulesFromCssText(i);return i=this._insertPolyfillHostInCssText(i),i=this._convertColonHost(i),i=this._convertColonHostContext(i),i=this._convertShadowDOMSelectors(i),e&&(i=this._scopeKeyframesRelatedCss(i,e),i=this._scopeSelectors(i,e,t)),i=i+`
`+o,i.trim()}_extractUnscopedRulesFromCssText(i){let e="",t;for(C5.lastIndex=0;(t=C5.exec(i))!==null;){let o=t[0].replace(t[2],"").replace(t[1],t[4]);e+=o+`
`}return e}_convertColonHost(i){return i.replace(BH,(e,t,o)=>{if(t){let r=[];for(let a of this._splitOnTopLevelCommas(t,!0)){let c=a.trim();if(!c)break;let p=Jd+c.replace(E1,"")+o;r.push(p)}return r.join(",")}else return Jd+o})}*_splitOnTopLevelCommas(i,e){let t=i.length,o=0,r=0;for(let a=0;a<t;a++){let c=i.charCodeAt(a);if(c===Va)o++;else if(c===Cr){if(o--,o<0&&e){yield i.slice(r,a);return}}else c===va&&o===0&&(yield i.slice(r,a),r=a+1)}yield i.slice(r)}_convertColonHostContext(i){let e=[];for(let t of this._splitOnTopLevelCommas(i,!1))e.push(this._convertColonHostContextInSelectorPart(t));return e.join(",")}_convertColonHostContextInSelectorPart(i){return i.replace(jH,(e,t)=>{let o=[[]],r=e.indexOf(lh);for(;r!==-1;){let a=e.substring(r+lh.length);if(!a||a[0]!=="("){e=a,r=e.indexOf(lh);continue}let c=[],p=0;for(let h of this._splitOnTopLevelCommas(a.substring(1),!0)){p=p+h.length+1;let _=h.trim();_&&c.push(_)}let u=o.length;sU(o,c.length);for(let h=0;h<c.length;h++)for(let _=0;_<u;_++)o[_+h*u].push(c[h]);e=a.substring(p+1),r=e.indexOf(lh)}return o.map(a=>aU(a,e,t)).join(", ")})}_convertShadowDOMSelectors(i){return HH.reduce((e,t)=>e.replace(t," "),i)}_scopeSelectors(i,e,t){return AC(i,o=>{let r=o.selector,a=o.content;return o.selector[0]!=="@"?r=this._scopeSelector({selector:r,scopeSelector:e,hostSelector:t,isParentSelector:!0}):AH.some(c=>o.selector.startsWith(c))?a=this._scopeSelectors(o.content,e,t):(o.selector.startsWith("@font-face")||o.selector.startsWith("@page"))&&(a=this._stripScopingSelectors(o.content)),new j_(r,a)})}_stripScopingSelectors(i){return AC(i,e=>{let t=e.selector.replace(b5," ").replace(gk," ");return new j_(t,e.content)})}_safeSelector;_shouldScopeIndicator;_scopeSelector({selector:i,scopeSelector:e,hostSelector:t,isParentSelector:o=!1}){let r=/ ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/;return i.split(r).map(a=>a.split(b5)).map(a=>{let[c,...p]=a;return[(h=>this._selectorNeedsScoping(h,e)?this._applySelectorScope({selector:h,scopeSelector:e,hostSelector:t,isParentSelector:o}):h)(c),...p].join(" ")}).join(", ")}_selectorNeedsScoping(i,e){return!this._makeScopeMatcher(e).test(i)}_makeScopeMatcher(i){let e=/\[/g,t=/\]/g;return i=i.replace(e,"\\[").replace(t,"\\]"),new RegExp("^("+i+")"+UH,"m")}_applySimpleSelectorScope(i,e,t){if(ph.lastIndex=0,ph.test(i)){let o=`[${t}]`,r=i;for(;r.match(gk);)r=r.replace(gk,(a,c)=>c.replace(/([^:\)]*)(:*)(.*)/,(p,u,h,_)=>u+o+h+_));return r.replace(ph,o)}return e+" "+i}_applySelectorScope({selector:i,scopeSelector:e,hostSelector:t,isParentSelector:o}){let r=/\[is=([^\]]*)\]/g;e=e.replace(r,(M,...w)=>w[0]);let a=`[${e}]`,c=M=>{let w=M.trim();if(!w)return M;if(M.includes(Jd)){if(w=this._applySimpleSelectorScope(M,e,t),!M.match($H)){let[y,E,I,D]=w.match(/([^:]*)(:*)([\s\S]*)/);w=E+a+I+D}}else{let y=M.replace(ph,"");if(y.length>0){let E=y.match(/([^:]*)(:*)([\s\S]*)/);E&&(w=E[1]+a+E[2]+E[3])}}return w},p=M=>{let w="",y=[],E;for(;(E=Bg.exec(M))!==null;){let I=1,D=Bg.lastIndex;for(;D<M.length;){let N=M[D];if(D++,N==="("){I++;continue}if(N===")"){if(I--,I===0)break;continue}}y.push(`${E[0]}${M.slice(Bg.lastIndex,D)}`),Bg.lastIndex=D}return y.join("")===M?w=y.map(I=>{let[D]=I.match(Bg)??[],N=I.slice(D?.length,-1);N.includes(Jd)&&(this._shouldScopeIndicator=!0);let P=this._scopeSelector({selector:N,scopeSelector:e,hostSelector:t});return`${D}${P})`}).join(""):(this._shouldScopeIndicator=this._shouldScopeIndicator||M.includes(Jd),w=this._shouldScopeIndicator?c(M):M),w};o&&(this._safeSelector=new hT(i),i=this._safeSelector.content());let u="",h=0,_,S=/( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g,x=i.includes(Jd);for((o||this._shouldScopeIndicator)&&(this._shouldScopeIndicator=!x);(_=S.exec(i))!==null;){let M=_[1],w=i.slice(h,_.index);if(w.match(/__esc-ph-(\d+)__/)&&i[_.index+1]?.match(/[a-fA-F\d]/))continue;let y=p(w);u+=`${y} ${M} `,h=S.lastIndex}let b=i.substring(h);return u+=p(b),this._safeSelector.restore(u)}_insertPolyfillHostInCssText(i){return i.replace(WH,lh).replace(GH,E1)}},hT=class{placeholders=[];index=0;_content;constructor(i){i=this._escapeRegexMatches(i,/(\[[^\]]*\])/g),i=i.replace(/(\\.)/g,(e,t)=>{let o=`__esc-ph-${this.index}__`;return this.placeholders.push(t),this.index++,o}),this._content=i.replace(VH,(e,t,o)=>{let r=`__ph-${this.index}__`;return this.placeholders.push(`(${o})`),this.index++,t+r})}restore(i){return i.replace(/__(?:ph|esc-ph)-(\d+)__/g,(e,t)=>this.placeholders[+t])}content(){return this._content}_escapeRegexMatches(i,e){return i.replace(e,(t,o)=>{let r=`__ph-${this.index}__`;return this.placeholders.push(o),this.index++,r})}},OH="(:(where|is)\\()?",Bg=/:(where|is)\(/gi,NH=/polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim,FH=/(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,C5=/(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,E1="-shadowcsshost",lh="-shadowcsscontext",fT="[^)(]*",RH=String.raw`(?:\(${fT}\)|${fT})+?`,LH=String.raw`(?:\(${RH}\)|${fT})+?`,SE=String.raw`(?:\((${LH})\))`,VH=new RegExp(String.raw`(:nth-[-\w]+)`+SE,"g"),BH=new RegExp(E1+SE+"?([^,{]*)","gim"),zH=lh+SE+"?([^{]*)",jH=new RegExp(`${OH}(${zH})`,"gim"),Jd=E1+"-no-combinator",$H=new RegExp(`${Jd}(?![^(]*\\))`,"g"),gk=/-shadowcsshost-no-combinator([^\s,]*)/,HH=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g],b5=/(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g,UH="([>\\s~+[.,{:][\\s\\S]*)?$",ph=/-shadowcsshost/gim,GH=/:host/gim,WH=/:host-context/gim,qH=/\r?\n/g,QH=/\/\*[\s\S]*?\*\//g,XH=/\/\*\s*#\s*source(Mapping)?URL=/g,wE="%COMMENT%",KH=new RegExp(wE,"g"),_k="%BLOCK%",YH=new RegExp(`(\\s*(?:${wE}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g"),ZH=new Map([["{","}"]]),uF="%COMMA_IN_PLACEHOLDER%",hF="%SEMI_IN_PLACEHOLDER%",fF="%COLON_IN_PLACEHOLDER%",JH=new RegExp(uF,"g"),eU=new RegExp(hF,"g"),tU=new RegExp(fF,"g"),j_=class{selector;content;constructor(i,e){this.selector=i,this.content=e}};function AC(n,i){let e=oU(n),t=nU(e,ZH,_k),o=0,r=t.escapedString.replace(YH,(...a)=>{let c=a[2],p="",u=a[4],h="";u&&u.startsWith("{"+_k)&&(p=t.blocks[o++],u=u.substring(_k.length+1),h="{");let _=i(new j_(c,p));return`${a[1]}${_.selector}${a[3]}${h}${_.content}${u}`});return rU(r)}var gT=class{escapedString;blocks;constructor(i,e){this.escapedString=i,this.blocks=e}};function nU(n,i,e){let t=[],o=[],r=0,a=0,c=-1,p,u;for(let h=0;h<n.length;h++){let _=n[h];_==="\\"?h++:_===u?(r--,r===0&&(o.push(n.substring(c,h)),t.push(e),a=h,c=-1,p=u=void 0)):_===p?r++:r===0&&i.has(_)&&(p=_,u=i.get(_),r=1,c=h+1,t.push(n.substring(a,c)))}return c!==-1?(o.push(n.substring(c)),t.push(e)):t.push(n.substring(a)),new gT(t.join(""),o)}var iU={";":hF,",":uF,":":fF};function oU(n){let i=n,e=null;for(let t=0;t<i.length;t++){let o=i[t];if(o==="\\")t++;else if(e!==null)if(o===e)e=null;else{let r=iU[o];r&&(i=`${i.substr(0,t)}${r}${i.substr(t+1)}`,t+=r.length-1)}else(o==="'"||o==='"')&&(e=o)}return i}function rU(n){let i=n.replace(JH,",");return i=i.replace(eU,";"),i=i.replace(tU,":"),i}function x5(n,i){return i?n.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g,"$1"):n}function aU(n,i,e=""){let t=Jd;ph.lastIndex=0;let o=ph.test(i);if(n.length===0)return t+i;let r=[n.pop()||""];for(;n.length>0;){let a=r.length,c=n.pop();for(let p=0;p<a;p++){let u=r[p];r[a*2+p]=u+" "+c,r[a+p]=c+" "+u,r[p]=c+u}}return r.map(a=>o?`${e}${a}${i}`:`${e}${a}${t}${i}, ${e}${a} ${t}${i}`).join(",")}function sU(n,i){let e=n.length;for(let t=1;t<i;t++)for(let o=0;o<e;o++)n[o+t*e]=n[o].slice(0)}var V=(function(n){return n[n.ListEnd=0]="ListEnd",n[n.Statement=1]="Statement",n[n.Variable=2]="Variable",n[n.ElementStart=3]="ElementStart",n[n.Element=4]="Element",n[n.Template=5]="Template",n[n.ElementEnd=6]="ElementEnd",n[n.ContainerStart=7]="ContainerStart",n[n.Container=8]="Container",n[n.ContainerEnd=9]="ContainerEnd",n[n.DisableBindings=10]="DisableBindings",n[n.ConditionalCreate=11]="ConditionalCreate",n[n.ConditionalBranchCreate=12]="ConditionalBranchCreate",n[n.Conditional=13]="Conditional",n[n.EnableBindings=14]="EnableBindings",n[n.Text=15]="Text",n[n.Listener=16]="Listener",n[n.InterpolateText=17]="InterpolateText",n[n.Binding=18]="Binding",n[n.Property=19]="Property",n[n.StyleProp=20]="StyleProp",n[n.ClassProp=21]="ClassProp",n[n.StyleMap=22]="StyleMap",n[n.ClassMap=23]="ClassMap",n[n.Advance=24]="Advance",n[n.Pipe=25]="Pipe",n[n.Attribute=26]="Attribute",n[n.ExtractedAttribute=27]="ExtractedAttribute",n[n.Defer=28]="Defer",n[n.DeferOn=29]="DeferOn",n[n.DeferWhen=30]="DeferWhen",n[n.I18nMessage=31]="I18nMessage",n[n.DomProperty=32]="DomProperty",n[n.Namespace=33]="Namespace",n[n.ProjectionDef=34]="ProjectionDef",n[n.Projection=35]="Projection",n[n.RepeaterCreate=36]="RepeaterCreate",n[n.Repeater=37]="Repeater",n[n.TwoWayProperty=38]="TwoWayProperty",n[n.TwoWayListener=39]="TwoWayListener",n[n.DeclareLet=40]="DeclareLet",n[n.StoreLet=41]="StoreLet",n[n.I18nStart=42]="I18nStart",n[n.I18n=43]="I18n",n[n.I18nEnd=44]="I18nEnd",n[n.I18nExpression=45]="I18nExpression",n[n.I18nApply=46]="I18nApply",n[n.IcuStart=47]="IcuStart",n[n.IcuEnd=48]="IcuEnd",n[n.IcuPlaceholder=49]="IcuPlaceholder",n[n.I18nContext=50]="I18nContext",n[n.I18nAttributes=51]="I18nAttributes",n[n.SourceLocation=52]="SourceLocation",n[n.Animation=53]="Animation",n[n.AnimationString=54]="AnimationString",n[n.AnimationBinding=55]="AnimationBinding",n[n.AnimationListener=56]="AnimationListener",n[n.Control=57]="Control",n[n.ControlCreate=58]="ControlCreate",n})(V||{}),Qt=(function(n){return n[n.LexicalRead=0]="LexicalRead",n[n.Context=1]="Context",n[n.TrackContext=2]="TrackContext",n[n.ReadVariable=3]="ReadVariable",n[n.NextContext=4]="NextContext",n[n.Reference=5]="Reference",n[n.StoreLet=6]="StoreLet",n[n.ContextLetReference=7]="ContextLetReference",n[n.GetCurrentView=8]="GetCurrentView",n[n.RestoreView=9]="RestoreView",n[n.ResetView=10]="ResetView",n[n.PureFunctionExpr=11]="PureFunctionExpr",n[n.PureFunctionParameterExpr=12]="PureFunctionParameterExpr",n[n.PipeBinding=13]="PipeBinding",n[n.PipeBindingVariadic=14]="PipeBindingVariadic",n[n.SafePropertyRead=15]="SafePropertyRead",n[n.SafeKeyedRead=16]="SafeKeyedRead",n[n.SafeInvokeFunction=17]="SafeInvokeFunction",n[n.SafeTernaryExpr=18]="SafeTernaryExpr",n[n.EmptyExpr=19]="EmptyExpr",n[n.AssignTemporaryExpr=20]="AssignTemporaryExpr",n[n.ReadTemporaryExpr=21]="ReadTemporaryExpr",n[n.SlotLiteralExpr=22]="SlotLiteralExpr",n[n.ConditionalCase=23]="ConditionalCase",n[n.ConstCollected=24]="ConstCollected",n[n.TwoWayBindingSet=25]="TwoWayBindingSet",n[n.ArrowFunction=26]="ArrowFunction",n})(Qt||{}),Zs=(function(n){return n[n.None=0]="None",n[n.AlwaysInline=1]="AlwaysInline",n})(Zs||{}),Wr=(function(n){return n[n.Context=0]="Context",n[n.Identifier=1]="Identifier",n[n.SavedView=2]="SavedView",n[n.Alias=3]="Alias",n})(Wr||{}),jt=(function(n){return n[n.Attribute=0]="Attribute",n[n.ClassName=1]="ClassName",n[n.StyleProperty=2]="StyleProperty",n[n.Property=3]="Property",n[n.Template=4]="Template",n[n.I18n=5]="I18n",n[n.LegacyAnimation=6]="LegacyAnimation",n[n.TwoWayProperty=7]="TwoWayProperty",n[n.Animation=8]="Animation",n})(jt||{}),$_=(function(n){return n[n.Creation=0]="Creation",n[n.Postproccessing=1]="Postproccessing",n})($_||{}),zh=(function(n){return n[n.I18nText=0]="I18nText",n[n.I18nAttribute=1]="I18nAttribute",n})(zh||{}),ao=(function(n){return n[n.None=0]="None",n[n.ElementTag=1]="ElementTag",n[n.TemplateTag=2]="TemplateTag",n[n.OpenTag=4]="OpenTag",n[n.CloseTag=8]="CloseTag",n[n.ExpressionIndex=16]="ExpressionIndex",n})(ao||{}),Ca=(function(n){return n[n.HTML=0]="HTML",n[n.SVG=1]="SVG",n[n.Math=2]="Math",n})(Ca||{}),Ji=(function(n){return n[n.Idle=0]="Idle",n[n.Immediate=1]="Immediate",n[n.Timer=2]="Timer",n[n.Hover=3]="Hover",n[n.Interaction=4]="Interaction",n[n.Viewport=5]="Viewport",n[n.Never=6]="Never",n})(Ji||{}),Pp=(function(n){return n[n.RootI18n=0]="RootI18n",n[n.Icu=1]="Icu",n[n.Attr=2]="Attr",n})(Pp||{}),ns=(function(n){return n[n.NgTemplate=0]="NgTemplate",n[n.Structural=1]="Structural",n[n.Block=2]="Block",n})(ns||{}),qe=(()=>{class n{static nextListId=0;debugListId=n.nextListId++;head={kind:V.ListEnd,next:null,prev:null,debugListId:this.debugListId};tail={kind:V.ListEnd,next:null,prev:null,debugListId:this.debugListId};constructor(){this.head.next=this.tail,this.tail.prev=this.head}push(e){if(Array.isArray(e)){for(let o of e)this.push(o);return}n.assertIsNotEnd(e),n.assertIsUnowned(e),e.debugListId=this.debugListId;let t=this.tail.prev;e.prev=t,t.next=e,e.next=this.tail,this.tail.prev=e}prepend(e){if(e.length===0)return;for(let r of e)n.assertIsNotEnd(r),n.assertIsUnowned(r),r.debugListId=this.debugListId;let t=this.head.next,o=this.head;for(let r of e)o.next=r,r.prev=o,o=r;o.next=t,t.prev=o}*[Symbol.iterator](){let e=this.head.next;for(;e!==this.tail;){n.assertIsOwned(e,this.debugListId);let t=e.next;yield e,e=t}}*reversed(){let e=this.tail.prev;for(;e!==this.head;){n.assertIsOwned(e,this.debugListId);let t=e.prev;yield e,e=t}}static replace(e,t){n.assertIsNotEnd(e),n.assertIsNotEnd(t),n.assertIsOwned(e),n.assertIsUnowned(t),t.debugListId=e.debugListId,e.prev!==null&&(e.prev.next=t,t.prev=e.prev),e.next!==null&&(e.next.prev=t,t.next=e.next),e.debugListId=null,e.prev=null,e.next=null}static replaceWithMany(e,t){if(t.length===0){n.remove(e);return}n.assertIsNotEnd(e),n.assertIsOwned(e);let o=e.debugListId;e.debugListId=null;for(let h of t)n.assertIsNotEnd(h),n.assertIsUnowned(h);let{prev:r,next:a}=e;e.prev=null,e.next=null;let c=r;for(let h of t)n.assertIsUnowned(h),h.debugListId=o,c.next=h,h.prev=c,h.next=null,c=h;let p=t[0],u=c;r!==null&&(r.next=p,p.prev=r),a!==null&&(a.prev=u,u.next=a)}static remove(e){n.assertIsNotEnd(e),n.assertIsOwned(e),e.prev.next=e.next,e.next.prev=e.prev,e.debugListId=null,e.prev=null,e.next=null}static insertBefore(e,t){if(Array.isArray(e)){for(let o of e)n.insertBefore(o,t);return}if(n.assertIsOwned(t),t.prev===null)throw new Error("AssertionError: illegal operation on list start");n.assertIsNotEnd(e),n.assertIsUnowned(e),e.debugListId=t.debugListId,e.prev=null,t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e}static insertAfter(e,t){if(n.assertIsOwned(t),t.next===null)throw new Error("AssertionError: illegal operation on list end");n.assertIsNotEnd(e),n.assertIsUnowned(e),e.debugListId=t.debugListId,t.next.prev=e,e.next=t.next,e.prev=t,t.next=e}static assertIsUnowned(e){if(e.debugListId!==null)throw new Error(`AssertionError: illegal operation on owned node: ${V[e.kind]}`)}static assertIsOwned(e,t){if(e.debugListId===null)throw new Error(`AssertionError: illegal operation on unowned node: ${V[e.kind]}`);if(t!==void 0&&e.debugListId!==t)throw new Error(`AssertionError: node belongs to the wrong list (expected ${t}, actual ${e.debugListId})`)}static assertIsNotEnd(e){if(e.kind===V.ListEnd)throw new Error("AssertionError: illegal operation on list head or tail")}}return n})();function Is(n){return K({kind:V.Statement,statement:n},_n)}function tm(n,i,e,t){return K({kind:V.Variable,xref:n,variable:i,initializer:e,flags:t},_n)}var _n={debugListId:null,prev:null,next:null},gF=Symbol("ConsumesSlot"),ME=Symbol("DependsOnSlotContext"),tu=Symbol("ConsumesVars"),c0=Symbol("UsesVarOffset"),il={[gF]:!0,numSlotsUsed:1},as={[ME]:!0},ss={[tu]:!0};function jh(n){return n[gF]===!0}function H_(n){return n[ME]===!0}function vk(n){return n[tu]===!0}function y5(n){return n[c0]===!0}function lU(n,i,e){return K(K(K({kind:V.InterpolateText,target:n,interpolation:i,sourceSpan:e},as),ss),_n)}var Qo=class{strings;expressions;i18nPlaceholders;constructor(i,e,t){if(this.strings=i,this.expressions=e,this.i18nPlaceholders=t,t.length!==0&&t.length!==e.length)throw new Error(`Expected ${e.length} placeholders to match interpolation expression count, but got ${t.length}`)}};function Xp(n,i,e,t,o,r,a,c,p,u,h){return K({kind:V.Binding,bindingKind:i,target:n,name:e,expression:t,unit:o,securityContext:r,isTextAttribute:a,isStructuralTemplateAttribute:c,templateKind:p,i18nContext:null,i18nMessage:u,sourceSpan:h},_n)}function cU(n,i,e,t,o,r,a,c,p,u){return K(K(K({kind:V.Property,target:n,name:i,expression:e,bindingKind:t,securityContext:o,sanitizer:null,isStructuralTemplateAttribute:r,templateKind:a,i18nContext:c,i18nMessage:p,sourceSpan:u},as),ss),_n)}function dU(n,i,e,t,o,r,a,c,p){return K(K(K({kind:V.TwoWayProperty,target:n,name:i,expression:e,securityContext:t,sanitizer:null,isStructuralTemplateAttribute:o,templateKind:r,i18nContext:a,i18nMessage:c,sourceSpan:p},as),ss),_n)}function mU(n,i,e,t,o){return K(K(K({kind:V.StyleProp,target:n,name:i,expression:e,unit:t,sourceSpan:o},as),ss),_n)}function pU(n,i,e,t){return K(K(K({kind:V.ClassProp,target:n,name:i,expression:e,sourceSpan:t},as),ss),_n)}function uU(n,i,e){return K(K(K({kind:V.StyleMap,target:n,expression:i,sourceSpan:e},as),ss),_n)}function hU(n,i,e){return K(K(K({kind:V.ClassMap,target:n,expression:i,sourceSpan:e},as),ss),_n)}function S5(n,i,e,t,o,r,a,c,p,u){return K(K(K({kind:V.Attribute,target:n,namespace:i,name:e,expression:t,securityContext:o,sanitizer:null,isTextAttribute:r,isStructuralTemplateAttribute:a,templateKind:c,i18nContext:null,i18nMessage:p,sourceSpan:u},as),ss),_n)}function fU(n,i){return K({kind:V.Advance,delta:n,sourceSpan:i},_n)}function _F(n,i,e,t){return K(K(K({kind:V.Conditional,target:n,test:i,conditions:e,processed:null,sourceSpan:t,contextValue:null},_n),as),ss)}function gU(n,i,e,t){return K(K({kind:V.Repeater,target:n,targetSlot:i,collection:e,sourceSpan:t},_n),as)}function w5(n,i,e,t,o,r,a){return K({kind:V.AnimationBinding,name:n,target:i,animationKind:e,expression:t,i18nMessage:null,securityContext:o,sanitizer:null,sourceSpan:r,animationBindingKind:a},_n)}function _U(n,i,e,t){return K(K(K({kind:V.DeferWhen,target:n,expr:i,modifier:e,sourceSpan:t},_n),as),ss)}function vF(n,i,e,t,o,r,a,c,p,u,h){return K(K(K({kind:V.I18nExpression,context:n,target:i,i18nOwner:e,handle:t,expression:o,icuPlaceholder:r,i18nPlaceholder:a,resolutionTime:c,usage:p,name:u,sourceSpan:h},_n),ss),as)}function vU(n,i,e){return K({kind:V.I18nApply,owner:n,handle:i,sourceSpan:e},_n)}function CU(n,i,e,t){return K(K(K({kind:V.StoreLet,target:n,declaredName:i,value:e,sourceSpan:t},as),ss),_n)}function bU(n,i){return K(K({kind:V.Control,sourceSpan:i,target:n},as),_n)}function Ec(n){return n instanceof Wi}var Wi=class extends Bi{constructor(i=null){super(null,i)}},Ur=class n extends Wi{name;kind=Qt.LexicalRead;constructor(i){super(),this.name=i}visitExpression(i,e){}isEquivalent(i){return this.name===i.name}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.name)}},D1=class n extends Wi{target;targetSlot;offset;kind=Qt.Reference;constructor(i,e,t){super(),this.target=i,this.targetSlot=e,this.offset=t}visitExpression(){}isEquivalent(i){return i instanceof n&&i.target===this.target}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.target,this.targetSlot,this.offset)}},U_=class n extends Wi{target;value;sourceSpan;kind=Qt.StoreLet;[tu]=!0;[ME]=!0;constructor(i,e,t){super(),this.target=i,this.value=e,this.sourceSpan=t}visitExpression(){}isEquivalent(i){return i instanceof n&&i.target===this.target&&i.value.isEquivalent(this.value)}isConstant(){return!1}transformInternalExpressions(i,e){this.value=Vt(this.value,i,e)}clone(){return new n(this.target,this.value,this.sourceSpan)}},G_=class n extends Wi{target;targetSlot;kind=Qt.ContextLetReference;constructor(i,e){super(),this.target=i,this.targetSlot=e}visitExpression(){}isEquivalent(i){return i instanceof n&&i.target===this.target}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.target,this.targetSlot)}},pm=class n extends Wi{view;kind=Qt.Context;constructor(i){super(),this.view=i}visitExpression(){}isEquivalent(i){return i instanceof n&&i.view===this.view}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.view)}},_T=class n extends Wi{view;kind=Qt.TrackContext;constructor(i){super(),this.view=i}visitExpression(){}isEquivalent(i){return i instanceof n&&i.view===this.view}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.view)}},P1=class n extends Wi{kind=Qt.NextContext;steps=1;visitExpression(){}isEquivalent(i){return i instanceof n&&i.steps===this.steps}isConstant(){return!1}transformInternalExpressions(){}clone(){let i=new n;return i.steps=this.steps,i}},vT=class n extends Wi{kind=Qt.GetCurrentView;constructor(){super()}visitExpression(){}isEquivalent(i){return i instanceof n}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n}},W_=class n extends Wi{view;kind=Qt.RestoreView;constructor(i){super(),this.view=i}visitExpression(i,e){typeof this.view!="number"&&this.view.visitExpression(i,e)}isEquivalent(i){return!(i instanceof n)||typeof i.view!=typeof this.view?!1:typeof this.view=="number"?this.view===i.view:this.view.isEquivalent(i.view)}isConstant(){return!1}transformInternalExpressions(i,e){typeof this.view!="number"&&(this.view=Vt(this.view,i,e))}clone(){return new n(this.view instanceof Bi?this.view.clone():this.view)}},I1=class n extends Wi{expr;kind=Qt.ResetView;constructor(i){super(),this.expr=i}visitExpression(i,e){this.expr.visitExpression(i,e)}isEquivalent(i){return i instanceof n&&this.expr.isEquivalent(i.expr)}isConstant(){return!1}transformInternalExpressions(i,e){this.expr=Vt(this.expr,i,e)}clone(){return new n(this.expr.clone())}},A1=class n extends Wi{target;value;kind=Qt.TwoWayBindingSet;constructor(i,e){super(),this.target=i,this.value=e}visitExpression(i,e){this.target.visitExpression(i,e),this.value.visitExpression(i,e)}isEquivalent(i){return this.target.isEquivalent(i.target)&&this.value.isEquivalent(i.value)}isConstant(){return!1}transformInternalExpressions(i,e){this.target=Vt(this.target,i,e),this.value=Vt(this.value,i,e)}clone(){return new n(this.target,this.value)}},bd=class n extends Wi{xref;kind=Qt.ReadVariable;name=null;constructor(i){super(),this.xref=i}visitExpression(){}isEquivalent(i){return i instanceof n&&i.xref===this.xref}isConstant(){return!1}transformInternalExpressions(){}clone(){let i=new n(this.xref);return i.name=this.name,i}},Kp=class n extends Wi{kind=Qt.PureFunctionExpr;[tu]=!0;[c0]=!0;varOffset=null;body;args;fn=null;constructor(i,e){super(),this.body=i,this.args=e}visitExpression(i,e){this.body?.visitExpression(i,e);for(let t of this.args)t.visitExpression(i,e)}isEquivalent(i){return!(i instanceof n)||i.args.length!==this.args.length?!1:i.body!==null&&this.body!==null&&i.body.isEquivalent(this.body)&&i.args.every((e,t)=>e.isEquivalent(this.args[t]))}isConstant(){return!1}transformInternalExpressions(i,e){this.body!==null?this.body=Vt(this.body,i,e|Wn.InChildOperation):this.fn!==null&&(this.fn=Vt(this.fn,i,e));for(let t=0;t<this.args.length;t++)this.args[t]=Vt(this.args[t],i,e)}clone(){let i=new n(this.body?.clone()??null,this.args.map(e=>e.clone()));return i.fn=this.fn?.clone()??null,i.varOffset=this.varOffset,i}},um=class n extends Wi{index;kind=Qt.PureFunctionParameterExpr;constructor(i){super(),this.index=i}visitExpression(){}isEquivalent(i){return i instanceof n&&i.index===this.index}isConstant(){return!0}transformInternalExpressions(){}clone(){return new n(this.index)}},Yp=class n extends Wi{target;targetSlot;name;args;kind=Qt.PipeBinding;[tu]=!0;[c0]=!0;varOffset=null;constructor(i,e,t,o){super(),this.target=i,this.targetSlot=e,this.name=t,this.args=o}visitExpression(i,e){for(let t of this.args)t.visitExpression(i,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(i,e){for(let t=0;t<this.args.length;t++)this.args[t]=Vt(this.args[t],i,e)}clone(){let i=new n(this.target,this.targetSlot,this.name,this.args.map(e=>e.clone()));return i.varOffset=this.varOffset,i}},q_=class n extends Wi{target;targetSlot;name;args;numArgs;kind=Qt.PipeBindingVariadic;[tu]=!0;[c0]=!0;varOffset=null;constructor(i,e,t,o,r){super(),this.target=i,this.targetSlot=e,this.name=t,this.args=o,this.numArgs=r}visitExpression(i,e){this.args.visitExpression(i,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(i,e){this.args=Vt(this.args,i,e)}clone(){let i=new n(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);return i.varOffset=this.varOffset,i}},Ah=class n extends Wi{receiver;name;kind=Qt.SafePropertyRead;constructor(i,e){super(),this.receiver=i,this.name=e}get index(){return this.name}visitExpression(i,e){this.receiver.visitExpression(i,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(i,e){this.receiver=Vt(this.receiver,i,e)}clone(){return new n(this.receiver.clone(),this.name)}},Oh=class n extends Wi{receiver;index;kind=Qt.SafeKeyedRead;constructor(i,e,t){super(t),this.receiver=i,this.index=e}visitExpression(i,e){this.receiver.visitExpression(i,e),this.index.visitExpression(i,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(i,e){this.receiver=Vt(this.receiver,i,e),this.index=Vt(this.index,i,e)}clone(){return new n(this.receiver.clone(),this.index.clone(),this.sourceSpan)}},Zp=class n extends Wi{receiver;args;kind=Qt.SafeInvokeFunction;constructor(i,e){super(),this.receiver=i,this.args=e}visitExpression(i,e){this.receiver.visitExpression(i,e);for(let t of this.args)t.visitExpression(i,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(i,e){this.receiver=Vt(this.receiver,i,e);for(let t=0;t<this.args.length;t++)this.args[t]=Vt(this.args[t],i,e)}clone(){return new n(this.receiver.clone(),this.args.map(i=>i.clone()))}},Nh=class n extends Wi{guard;expr;kind=Qt.SafeTernaryExpr;constructor(i,e){super(),this.guard=i,this.expr=e}visitExpression(i,e){this.guard.visitExpression(i,e),this.expr.visitExpression(i,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(i,e){this.guard=Vt(this.guard,i,e),this.expr=Vt(this.expr,i,e)}clone(){return new n(this.guard.clone(),this.expr.clone())}},Q_=class n extends Wi{kind=Qt.EmptyExpr;visitExpression(i,e){}isEquivalent(i){return i instanceof n}isConstant(){return!0}clone(){return new n}transformInternalExpressions(){}},Dc=class n extends Wi{expr;xref;kind=Qt.AssignTemporaryExpr;name=null;constructor(i,e){super(),this.expr=i,this.xref=e}visitExpression(i,e){this.expr.visitExpression(i,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(i,e){this.expr=Vt(this.expr,i,e)}clone(){let i=new n(this.expr.clone(),this.xref);return i.name=this.name,i}},hm=class n extends Wi{xref;kind=Qt.ReadTemporaryExpr;name=null;constructor(i){super(),this.xref=i}visitExpression(i,e){}isEquivalent(){return this.xref===this.xref}isConstant(){return!1}transformInternalExpressions(i,e){}clone(){let i=new n(this.xref);return i.name=this.name,i}},O1=class n extends Wi{slot;kind=Qt.SlotLiteralExpr;constructor(i){super(),this.slot=i}visitExpression(i,e){}isEquivalent(i){return i instanceof n&&i.slot===this.slot}isConstant(){return!0}clone(){return new n(this.slot)}transformInternalExpressions(){}},N1=class n extends Wi{expr;target;targetSlot;alias;kind=Qt.ConditionalCase;constructor(i,e,t,o=null){super(),this.expr=i,this.target=e,this.targetSlot=t,this.alias=o}visitExpression(i,e){this.expr!==null&&this.expr.visitExpression(i,e)}isEquivalent(i){return i instanceof n&&i.expr===this.expr}isConstant(){return!0}clone(){return new n(this.expr,this.target,this.targetSlot)}transformInternalExpressions(i,e){this.expr!==null&&(this.expr=Vt(this.expr,i,e))}},X_=class n extends Wi{expr;kind=Qt.ConstCollected;constructor(i){super(),this.expr=i}transformInternalExpressions(i,e){this.expr=i(this.expr,e)}visitExpression(i,e){this.expr.visitExpression(i,e)}isEquivalent(i){return i instanceof n?this.expr.isEquivalent(i.expr):!1}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr)}},CT=class n extends Wi{parameters;body;kind=Qt.ArrowFunction;[tu]=!0;[c0]=!0;contextName=Ps;currentViewName="view";varOffset=null;ops;constructor(i,e){super(),this.parameters=i,this.body=e,this.ops=new qe,this.ops.push([Is(new xr(e,e.sourceSpan))])}visitExpression(i,e){for(let t of this.ops)mr(t,o=>{o.visitExpression(i,e)})}isEquivalent(i){return i instanceof n&&i.parameters.length===this.parameters.length&&i.parameters.every((e,t)=>e.isEquivalent(this.parameters[t]))&&i.body.isEquivalent(this.body)}isConstant(){return!1}transformInternalExpressions(i,e){for(let t of this.ops)Xo(t,i,e|(Wn.InChildOperation|Wn.InArrowFunctionOperation))}clone(){let i=new n(this.parameters,this.body);return i.varOffset=this.varOffset,i.ops=this.ops,i}};function mr(n,i){Xo(n,(e,t)=>(i(e,t),e),Wn.None)}var Wn=(function(n){return n[n.None=0]="None",n[n.InChildOperation=1]="InChildOperation",n[n.InArrowFunctionOperation=2]="InArrowFunctionOperation",n})(Wn||{});function Ck(n,i,e){for(let t=0;t<n.expressions.length;t++)n.expressions[t]=Vt(n.expressions[t],i,e)}function Xo(n,i,e){switch(n.kind){case V.StyleProp:case V.StyleMap:case V.ClassProp:case V.ClassMap:case V.AnimationString:case V.AnimationBinding:case V.Binding:n.expression instanceof Qo?Ck(n.expression,i,e):n.expression=Vt(n.expression,i,e);break;case V.Property:case V.DomProperty:case V.Attribute:n.expression instanceof Qo?Ck(n.expression,i,e):n.expression=Vt(n.expression,i,e),n.sanitizer=n.sanitizer&&Vt(n.sanitizer,i,e);break;case V.TwoWayProperty:n.expression=Vt(n.expression,i,e),n.sanitizer=n.sanitizer&&Vt(n.sanitizer,i,e);break;case V.I18nExpression:n.expression=Vt(n.expression,i,e);break;case V.InterpolateText:Ck(n.interpolation,i,e);break;case V.Statement:F1(n.statement,i,e);break;case V.Variable:n.initializer=Vt(n.initializer,i,e);break;case V.Conditional:for(let t of n.conditions)t.expr!==null&&(t.expr=Vt(t.expr,i,e));n.processed!==null&&(n.processed=Vt(n.processed,i,e)),n.contextValue!==null&&(n.contextValue=Vt(n.contextValue,i,e));break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:for(let t of n.handlerOps)Xo(t,i,e|Wn.InChildOperation);break;case V.ExtractedAttribute:n.expression=n.expression&&Vt(n.expression,i,e),n.trustedValueFn=n.trustedValueFn&&Vt(n.trustedValueFn,i,e);break;case V.RepeaterCreate:if(n.trackByOps===null)n.track=Vt(n.track,i,e);else for(let t of n.trackByOps)Xo(t,i,e|Wn.InChildOperation);n.trackByFn!==null&&(n.trackByFn=Vt(n.trackByFn,i,e));break;case V.Repeater:n.collection=Vt(n.collection,i,e);break;case V.Defer:n.loadingConfig!==null&&(n.loadingConfig=Vt(n.loadingConfig,i,e)),n.placeholderConfig!==null&&(n.placeholderConfig=Vt(n.placeholderConfig,i,e)),n.resolverFn!==null&&(n.resolverFn=Vt(n.resolverFn,i,e));break;case V.I18nMessage:for(let[t,o]of n.params)n.params.set(t,Vt(o,i,e));for(let[t,o]of n.postprocessingParams)n.postprocessingParams.set(t,Vt(o,i,e));break;case V.DeferWhen:n.expr=Vt(n.expr,i,e);break;case V.StoreLet:n.value=Vt(n.value,i,e);break;case V.Advance:case V.Container:case V.ContainerEnd:case V.ContainerStart:case V.DeferOn:case V.DisableBindings:case V.Element:case V.ElementEnd:case V.ElementStart:case V.EnableBindings:case V.I18n:case V.I18nApply:case V.I18nContext:case V.I18nEnd:case V.I18nStart:case V.IcuEnd:case V.IcuStart:case V.Namespace:case V.Pipe:case V.Projection:case V.ProjectionDef:case V.Template:case V.Text:case V.I18nAttributes:case V.IcuPlaceholder:case V.DeclareLet:case V.SourceLocation:case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Control:case V.ControlCreate:break;default:throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${V[n.kind]}`)}}function Vt(n,i,e){if(n instanceof Wi)n.transformInternalExpressions(i,e);else if(n instanceof gi)n.lhs=Vt(n.lhs,i,e),n.rhs=Vt(n.rhs,i,e);else if(n instanceof jp)n.expr=Vt(n.expr,i,e);else if(n instanceof Es)n.receiver=Vt(n.receiver,i,e);else if(n instanceof xd)n.receiver=Vt(n.receiver,i,e),n.index=Vt(n.index,i,e);else if(n instanceof os){n.fn=Vt(n.fn,i,e);for(let t=0;t<n.args.length;t++)n.args[t]=Vt(n.args[t],i,e)}else if(n instanceof wc)for(let t=0;t<n.entries.length;t++)n.entries[t]=Vt(n.entries[t],i,e);else if(n instanceof Rl)for(let t of n.entries)t instanceof rm?t.expression=Vt(t.expression,i,e):t.value=Vt(t.value,i,e);else if(n instanceof Sc)n.condition=Vt(n.condition,i,e),n.trueCase=Vt(n.trueCase,i,e),n.falseCase!==null&&(n.falseCase=Vt(n.falseCase,i,e));else if(n instanceof Ch)n.expr=Vt(n.expr,i,e);else if(n instanceof ZC)n.expr=Vt(n.expr,i,e);else if(n instanceof e1)for(let t=0;t<n.expressions.length;t++)n.expressions[t]=Vt(n.expressions[t],i,e);else if(n instanceof p_)n.condition=Vt(n.condition,i,e);else if(n instanceof c_)n.tag=Vt(n.tag,i,e),n.template.expressions=n.template.expressions.map(t=>Vt(t,i,e));else if(n instanceof eu)if(Array.isArray(n.body))for(let t=0;t<n.body.length;t++)F1(n.body[t],i,e|Wn.InChildOperation);else n.body=Vt(n.body,i,e|Wn.InChildOperation);else if(!(n instanceof oi)){if(n instanceof m_)for(let t=0;t<n.expressions.length;t++)n.expressions[t]=Vt(n.expressions[t],i,e);else if(n instanceof Fl)n.expr=Vt(n.expr,i,e);else if(n instanceof $p)n.expression=Vt(n.expression,i,e);else if(!(n instanceof Nl||n instanceof zp||n instanceof aa||n instanceof bh))throw new Error(`Unhandled expression kind: ${n.constructor.name}`)}return i(n,e)}function F1(n,i,e){if(n instanceof sa)n.expr=Vt(n.expr,i,e);else if(n instanceof xr)n.value=Vt(n.value,i,e);else if(n instanceof Rr)n.value!==void 0&&(n.value=Vt(n.value,i,e));else if(n instanceof n1){n.condition=Vt(n.condition,i,e);for(let t of n.trueCase)F1(t,i,e);for(let t of n.falseCase)F1(t,i,e)}else throw new Error(`Unhandled statement kind: ${n.constructor.name}`)}function CF(n){return n instanceof aa&&typeof n.value=="string"}var la=class{slot=null},xU=new Set([V.Element,V.ElementStart,V.Container,V.ContainerStart,V.Template,V.RepeaterCreate,V.ConditionalCreate,V.ConditionalBranchCreate]);function fm(n){return xU.has(n.kind)}function yU(n,i,e,t,o,r){return K(K({kind:V.ElementStart,xref:i,tag:n,handle:new la,attributes:null,localRefs:[],nonBindable:!1,namespace:e,i18nPlaceholder:t,startSourceSpan:o,wholeSourceSpan:r},il),_n)}function bF(n,i,e,t,o,r,a,c){return K(K({kind:V.Template,xref:n,templateKind:i,attributes:null,tag:e,handle:new la,functionNameSuffix:t,decls:null,vars:null,localRefs:[],nonBindable:!1,namespace:o,i18nPlaceholder:r,startSourceSpan:a,wholeSourceSpan:c},il),_n)}function xF(n,i,e,t,o,r,a,c){return K(K({kind:V.ConditionalCreate,xref:n,templateKind:i,attributes:null,tag:e,handle:new la,functionNameSuffix:t,decls:null,vars:null,localRefs:[],nonBindable:!1,namespace:o,i18nPlaceholder:r,startSourceSpan:a,wholeSourceSpan:c},il),_n)}function yF(n,i,e,t,o,r,a,c){return K(K({kind:V.ConditionalBranchCreate,xref:n,templateKind:i,attributes:null,tag:e,handle:new la,functionNameSuffix:t,decls:null,vars:null,localRefs:[],nonBindable:!1,namespace:o,i18nPlaceholder:r,startSourceSpan:a,wholeSourceSpan:c},il),_n)}function SU(n,i,e,t,o,r,a,c,p,u){return it(K(K(K({kind:V.RepeaterCreate,attributes:null,xref:n,handle:new la,emptyView:i,track:t,trackByFn:null,trackByOps:null,tag:e,emptyTag:r,emptyAttributes:null,functionNameSuffix:"For",namespace:Ca.HTML,nonBindable:!1,localRefs:[],decls:null,vars:null,varNames:o,usesComponentInstance:!1,i18nPlaceholder:a,emptyI18nPlaceholder:c,startSourceSpan:p,wholeSourceSpan:u},il),_n),ss),{numSlotsUsed:i===null?2:3})}function wU(n,i){return K({kind:V.ElementEnd,xref:n,sourceSpan:i},_n)}function MU(n){return K({kind:V.DisableBindings,xref:n},_n)}function kU(n){return K({kind:V.EnableBindings,xref:n},_n)}function SF(n,i,e,t){return K(K({kind:V.Text,xref:n,handle:new la,initialValue:i,icuPlaceholder:e,sourceSpan:t},il),_n)}function TU(n,i,e,t,o,r){return K({kind:V.AnimationString,name:n,target:i,animationKind:e,expression:t,i18nMessage:null,securityContext:o,sanitizer:null,sourceSpan:r},_n)}function EU(n,i,e,t,o,r){let a=new qe;return a.push(t),K({kind:V.Animation,name:n,target:i,animationKind:e,handlerOps:a,handlerFnName:null,i18nMessage:null,securityContext:o,sanitizer:null,sourceSpan:r},_n)}function kE(n,i,e,t,o,r,a,c,p){let u=new qe;return u.push(o),K({kind:V.Listener,target:n,targetSlot:i,tag:t,hostListener:c,name:e,handlerOps:u,handlerFnName:null,consumesDollarEvent:!1,isLegacyAnimationListener:r!==null,legacyAnimationPhase:r,eventTarget:a,sourceSpan:p},_n)}function wF(n,i,e,t,o,r,a,c,p){let u=new qe;return u.push(o),K({kind:V.AnimationListener,target:n,targetSlot:i,tag:t,hostListener:c,name:e,animationKind:r,handlerOps:u,handlerFnName:null,consumesDollarEvent:!1,eventTarget:a,sourceSpan:p},_n)}function MF(n,i,e,t,o,r){let a=new qe;return a.push(o),K({kind:V.TwoWayListener,target:n,targetSlot:i,tag:t,name:e,handlerOps:a,handlerFnName:null,sourceSpan:r},_n)}function DU(n,i,e){return K(K({kind:V.Pipe,xref:n,handle:i,name:e},_n),il)}function PU(n){return K({kind:V.Namespace,active:n},_n)}function IU(n){return K({kind:V.ProjectionDef,def:n},_n)}function AU(n,i,e,t,o){return it(K(K({kind:V.Projection,xref:n,handle:new la,selector:i,i18nPlaceholder:e,fallbackView:t,projectionSlotIndex:0,attributes:null,localRefs:[],sourceSpan:o},_n),il),{numSlotsUsed:t===null?1:2})}function Js(n,i,e,t,o,r,a,c){return K({kind:V.ExtractedAttribute,target:n,bindingKind:i,namespace:e,name:t,expression:o,i18nContext:r,i18nMessage:a,securityContext:c,trustedValueFn:null},_n)}function OU(n,i,e,t,o,r){return it(K(K({kind:V.Defer,xref:n,handle:new la,mainView:i,mainSlot:e,loadingView:null,loadingSlot:null,loadingConfig:null,loadingMinimumTime:null,loadingAfterTime:null,placeholderView:null,placeholderSlot:null,placeholderConfig:null,placeholderMinimumTime:null,errorView:null,errorSlot:null,ownResolverFn:t,resolverFn:o,flags:null,sourceSpan:r},_n),il),{numSlotsUsed:2})}function Zd(n,i,e,t){return K({kind:V.DeferOn,defer:n,trigger:i,modifier:e,sourceSpan:t},_n)}function NU(n,i,e){return K(K({kind:V.DeclareLet,xref:n,declaredName:i,sourceSpan:e,handle:new la},il),_n)}function FU(n,i,e,t,o,r,a,c){return K({kind:V.I18nMessage,xref:n,i18nContext:i,i18nBlock:e,message:t,messagePlaceholder:o,params:r,postprocessingParams:a,needsPostprocessing:c,subMessages:[]},_n)}function rb(n,i,e,t){return K(K({kind:V.I18nStart,xref:n,handle:new la,root:e??n,message:i,messageIndex:null,subTemplateIndex:null,context:null,sourceSpan:t},_n),il)}function ab(n,i){return K({kind:V.I18nEnd,xref:n,sourceSpan:i},_n)}function RU(n,i,e,t){return K({kind:V.IcuStart,xref:n,message:i,messagePlaceholder:e,context:null,sourceSpan:t},_n)}function LU(n){return K({kind:V.IcuEnd,xref:n},_n)}function VU(n,i,e){return K({kind:V.IcuPlaceholder,xref:n,name:i,strings:e,expressionPlaceholders:[]},_n)}function bk(n,i,e,t,o){if(e===null&&n!==Pp.Attr)throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");return K({kind:V.I18nContext,contextKind:n,xref:i,i18nBlock:e,message:t,sourceSpan:o,params:new Map,postprocessingParams:new Map},_n)}function kF(n,i,e){return K(K({kind:V.I18nAttributes,xref:n,handle:i,target:e,i18nAttributesConfig:null},_n),il)}function BU(n,i){return K({kind:V.SourceLocation,templatePath:n,locations:i},_n)}function zU(n){return K({kind:V.ControlCreate,sourceSpan:n},_n)}function jU(n,i,e,t,o,r){return K(K({kind:V.DomProperty,name:n,expression:i,bindingKind:e,i18nContext:t,securityContext:o,sanitizer:null,sourceSpan:r},ss),_n)}var TF="CTX_REF_MARKER",Et=(function(n){return n[n.Tmpl=0]="Tmpl",n[n.Host=1]="Host",n[n.Both=2]="Both",n})(Et||{}),Za=(function(n){return n[n.Full=0]="Full",n[n.DomOnly=1]="DomOnly",n})(Za||{}),R1=class{componentName;pool;mode;constructor(i,e,t){this.componentName=i,this.pool=e,this.mode=t}kind=Et.Both;allocateXrefId(){return this.nextXrefId++}nextXrefId=0},K_=class extends R1{relativeContextFilePath;i18nUseExternalIds;deferMeta;allDeferrableDepsFn;relativeTemplatePath;enableDebugLocations;constructor(i,e,t,o,r,a,c,p,u){super(i,e,t),this.relativeContextFilePath=o,this.i18nUseExternalIds=r,this.deferMeta=a,this.allDeferrableDepsFn=c,this.relativeTemplatePath=p,this.enableDebugLocations=u,this.root=new el(this,this.allocateXrefId(),null),this.views.set(this.root.xref,this.root)}kind=Et.Tmpl;fnSuffix="Template";root;views=new Map;contentSelectors=null;allocateView(i){let e=new el(this,this.allocateXrefId(),i);return this.views.set(e.xref,e),e}get units(){return this.views.values()}addConst(i,e){for(let o=0;o<this.consts.length;o++)if(this.consts[o].isEquivalent(i))return o;let t=this.consts.length;return this.consts.push(i),e&&this.constsInitializers.push(...e),t}consts=[];constsInitializers=[]},L1=class{xref;constructor(i){this.xref=i}create=new qe;update=new qe;functions=new Set;fnName=null;vars=null;*ops(){for(let i of this.functions)for(let e of i.ops)yield e;for(let i of this.create)if(yield i,i.kind===V.Listener||i.kind===V.Animation||i.kind===V.AnimationListener||i.kind===V.TwoWayListener)for(let e of i.handlerOps)yield e;else if(i.kind===V.RepeaterCreate&&i.trackByOps!==null)for(let e of i.trackByOps)yield e;for(let i of this.update)yield i}},el=class extends L1{job;parent;constructor(i,e,t){super(e),this.job=i,this.parent=t}contextVariables=new Map;aliases=new Set;decls=null},V1=class extends R1{constructor(i,e,t){super(i,e,t),this.root=new bT(this)}kind=Et.Host;fnSuffix="HostBindings";root;get units(){return[this.root]}},bT=class extends L1{job;constructor(i){super(0),this.job=i}attributes=null};function $U(n){for(let i of n.units)for(let e of i.ops())Xo(e,HU,Wn.None)}function HU(n){if(n instanceof os&&n.fn instanceof Ur&&n.fn.name==="$any"){if(n.args.length!==1)throw new Error("The $any builtin function expects exactly one argument.");return n.args[0]}return n}function UU(n){let i=new Map;for(let e of n.units)for(let t of e.create)t.kind===V.I18nContext&&i.set(t.xref,t);for(let e of n.units)for(let t of e.update)t.kind===V.I18nExpression&&GU(i,t)&&qe.insertAfter(vU(t.i18nOwner,t.handle,null),t)}function GU(n,i){if(i.next?.kind!==V.I18nExpression)return!0;let e=n.get(i.context),t=n.get(i.next.context);if(e===void 0)throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context");if(t===void 0)throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context");return e.i18nBlock!==null?e.i18nBlock!==t.i18nBlock:i.i18nOwner!==i.next.i18nOwner}function WU(n){for(let i of n.units){let e=i.update.head,t=[],o=null;for(let r of i.create){if(r.kind===V.I18nStart)o={blockXref:r.xref,lastSlotConsumer:r.xref};else if(r.kind===V.I18nEnd){for(let a of t)a.target=o.lastSlotConsumer,qe.insertBefore(a,e);t.length=0,o=null}if(jh(r))for(o!==null&&(o.lastSlotConsumer=r.xref);e.next!==null;){if(o!==null&&e.kind===V.I18nExpression&&e.usage===zh.I18nText&&e.i18nOwner===o.blockXref){let c=e;e=e.next,qe.remove(c),t.push(c);continue}let a=!1;if(H_(e)&&e.target!==r.xref?a=!0:(e.kind===V.Statement||e.kind===V.Variable)&&mr(e,c=>{!a&&H_(c)&&c.target!==r.xref&&(a=!0)}),a)break;e=e.next}}}}function qU(n){if(!(!n.enableDebugLocations||n.relativeTemplatePath===null))for(let i of n.units){let e=[];for(let t of i.create)if(t.kind===V.ElementStart||t.kind===V.Element){let o=t.startSourceSpan.start;e.push({targetSlot:t.handle,offset:o.offset,line:o.line,column:o.col})}e.length>0&&i.create.push(BU(n.relativeTemplatePath,e))}}function EF(n){let i=new Map;for(let e of n.create)jh(e)&&(i.set(e.xref,e),e.kind===V.RepeaterCreate&&e.emptyView!==null&&i.set(e.emptyView,e));return i}function QU(n){for(let i of n.units){let e=EF(i);for(let t of i.ops())switch(t.kind){case V.Attribute:XU(i,t,e);break;case V.Property:if(t.bindingKind!==jt.LegacyAnimation&&t.bindingKind!==jt.Animation){let o;t.i18nMessage!==null&&t.templateKind===null?o=jt.I18n:t.isStructuralTemplateAttribute?o=jt.Template:o=jt.Property,qe.insertBefore(Js(t.target,o,null,t.name,null,null,null,t.securityContext),ch(e,t.target))}break;case V.TwoWayProperty:qe.insertBefore(Js(t.target,jt.TwoWayProperty,null,t.name,null,null,null,t.securityContext),ch(e,t.target));break;case V.StyleProp:case V.ClassProp:t.expression instanceof Q_&&qe.insertBefore(Js(t.target,jt.Property,null,t.name,null,null,null,eo.STYLE),ch(e,t.target));break;case V.Listener:if(!t.isLegacyAnimationListener){let o=Js(t.target,jt.Property,null,t.name,null,null,null,eo.NONE);if(n.kind===Et.Host)break;qe.insertBefore(o,ch(e,t.target))}break;case V.TwoWayListener:if(n.kind!==Et.Host){let o=Js(t.target,jt.Property,null,t.name,null,null,null,eo.NONE);qe.insertBefore(o,ch(e,t.target))}break}}}function ch(n,i){let e=n.get(i);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function XU(n,i,e){if(!(i.expression instanceof Qo)&&i.isTextAttribute){let t=Js(i.target,i.isStructuralTemplateAttribute?jt.Template:jt.Attribute,i.namespace,i.name,i.expression,i.i18nContext,i.i18nMessage,i.securityContext);if(n.job.kind===Et.Host)n.create.push(t);else{let o=ch(e,i.target);qe.insertBefore(t,o)}qe.remove(i)}}var M5="aria-";function DF(n){return n.startsWith(M5)&&n.length>M5.length}function KU(n,i){let e=n.get(i);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function YU(n){let i=new Map;for(let e of n.units)for(let t of e.create)fm(t)&&i.set(t.xref,t);for(let e of n.units)for(let t of e.ops())if(t.kind===V.Binding)switch(t.bindingKind){case jt.Attribute:if(t.name==="ngNonBindable"){qe.remove(t);let o=KU(i,t.target);o.nonBindable=!0}else if(t.name.startsWith("animate."))qe.replace(t,w5(t.name,t.target,t.name==="animate.enter"?"enter":"leave",t.expression,t.securityContext,t.sourceSpan,0));else{let[o,r]=Ll(t.name);qe.replace(t,S5(t.target,o,r,t.expression,t.securityContext,t.isTextAttribute,t.isStructuralTemplateAttribute,t.templateKind,t.i18nMessage,t.sourceSpan))}break;case jt.Animation:qe.replace(t,w5(t.name,t.target,t.name==="animate.enter"?"enter":"leave",t.expression,t.securityContext,t.sourceSpan,1));break;case jt.Property:case jt.LegacyAnimation:n.mode===Za.DomOnly&&DF(t.name)?qe.replace(t,S5(t.target,null,t.name,t.expression,t.securityContext,!1,t.isStructuralTemplateAttribute,t.templateKind,t.i18nMessage,t.sourceSpan)):n.kind===Et.Host?qe.replace(t,jU(t.name,t.expression,t.bindingKind,t.i18nContext,t.securityContext,t.sourceSpan)):qe.replace(t,cU(t.target,t.name,t.expression,t.bindingKind,t.securityContext,t.isStructuralTemplateAttribute,t.templateKind,t.i18nContext,t.i18nMessage,t.sourceSpan));break;case jt.TwoWayProperty:if(!(t.expression instanceof Bi))throw new Error(`Expected value of two-way property binding "${t.name}" to be an expression`);qe.replace(t,dU(t.target,t.name,t.expression,t.securityContext,t.isStructuralTemplateAttribute,t.templateKind,t.i18nContext,t.i18nMessage,t.sourceSpan));break;case jt.I18n:case jt.ClassName:case jt.StyleProperty:throw new Error(`Unhandled binding of kind ${jt[t.bindingKind]}`)}}var k5=new Map([[fe.ariaProperty,fe.ariaProperty],[fe.attribute,fe.attribute],[fe.classProp,fe.classProp],[fe.element,fe.element],[fe.elementContainer,fe.elementContainer],[fe.elementContainerEnd,fe.elementContainerEnd],[fe.elementContainerStart,fe.elementContainerStart],[fe.elementEnd,fe.elementEnd],[fe.elementStart,fe.elementStart],[fe.domProperty,fe.domProperty],[fe.i18nExp,fe.i18nExp],[fe.listener,fe.listener],[fe.listener,fe.listener],[fe.property,fe.property],[fe.styleProp,fe.styleProp],[fe.syntheticHostListener,fe.syntheticHostListener],[fe.syntheticHostProperty,fe.syntheticHostProperty],[fe.templateCreate,fe.templateCreate],[fe.twoWayProperty,fe.twoWayProperty],[fe.twoWayListener,fe.twoWayListener],[fe.declareLet,fe.declareLet],[fe.conditionalCreate,fe.conditionalBranchCreate],[fe.conditionalBranchCreate,fe.conditionalBranchCreate],[fe.domElement,fe.domElement],[fe.domElementStart,fe.domElementStart],[fe.domElementEnd,fe.domElementEnd],[fe.domElementContainer,fe.domElementContainer],[fe.domElementContainerStart,fe.domElementContainerStart],[fe.domElementContainerEnd,fe.domElementContainerEnd],[fe.domListener,fe.domListener],[fe.domTemplate,fe.domTemplate],[fe.animationEnter,fe.animationEnter],[fe.animationLeave,fe.animationLeave],[fe.animationEnterListener,fe.animationEnterListener],[fe.animationLeaveListener,fe.animationLeaveListener]]),ZU=256;function JU(n){for(let i of n.units)T5(i.create),T5(i.update)}function T5(n){let i=null;for(let e of n){if(e.kind!==V.Statement||!(e.statement instanceof sa)){i=null;continue}if(!(e.statement.expr instanceof os)||!(e.statement.expr.fn instanceof zp)){i=null;continue}let t=e.statement.expr.fn.value;if(!k5.has(t)){i=null;continue}if(i!==null&&k5.get(i.instruction)===t&&i.length<ZU){let o=i.expression.callFn(e.statement.expr.args,e.statement.expr.sourceSpan,e.statement.expr.pure);i.expression=o,i.op.statement=o.toStmt(),i.length++,qe.remove(e)}else i={op:e,instruction:t,expression:e.statement.expr,length:1}}}function eG(n){for(let i of n.units)for(let e of i.update)(e.kind===V.Attribute||e.kind===V.StyleProp||e.kind==V.StyleMap||e.kind===V.ClassMap)&&e.expression instanceof Qo&&e.expression.strings.length===2&&e.expression.strings.every(o=>o==="")&&(e.expression=e.expression.expressions[0])}function tG(n){for(let i of n.units)for(let e of i.ops()){if(e.kind!==V.Conditional)continue;let t,o=e.conditions.findIndex(c=>c.expr===null);if(o>=0){let c=e.conditions.splice(o,1)[0].targetSlot;t=new O1(c)}else t=Te(-1);let r=e.test==null?null:new Dc(e.test,n.allocateXrefId()),a=null;for(let c=e.conditions.length-1;c>=0;c--){let p=e.conditions[c];if(p.expr!==null){if(r!==null){let u=c===0?r:new hm(r.xref);p.expr=new gi(st.Identical,u,p.expr)}else p.alias!==null&&(a??=n.allocateXrefId(),p.expr=new Dc(p.expr,a),e.contextValue=new hm(a));t=new Sc(p.expr,new O1(p.targetSlot),t)}}e.processed=t,e.conditions=[]}}var nG=new Map([["&&",st.And],[">",st.Bigger],[">=",st.BiggerEquals],["|",st.BitwiseOr],["&",st.BitwiseAnd],["/",st.Divide],["=",st.Assign],["==",st.Equals],["===",st.Identical],["<",st.Lower],["<=",st.LowerEquals],["-",st.Minus],["%",st.Modulo],["**",st.Exponentiation],["*",st.Multiply],["!=",st.NotEquals],["!==",st.NotIdentical],["??",st.NullishCoalesce],["||",st.Or],["+",st.Plus],["in",st.In],["instanceof",st.InstanceOf],["+=",st.AdditionAssignment],["-=",st.SubtractionAssignment],["*=",st.MultiplicationAssignment],["/=",st.DivisionAssignment],["%=",st.RemainderAssignment],["**=",st.ExponentiationAssignment],["&&=",st.AndAssignment],["||=",st.OrAssignment],["??=",st.NullishCoalesceAssignment]]);function PF(n){let i=new Map([["svg",Ca.SVG],["math",Ca.Math]]);return n===null?Ca.HTML:i.get(n)??Ca.HTML}function iG(n){let i=new Map([["svg",Ca.SVG],["math",Ca.Math]]);for(let[e,t]of i.entries())if(t===n)return e;return null}function oG(n,i){return i===Ca.HTML?n:`:${iG(i)}:${n}`}function Fh(n){return Array.isArray(n)?Gi(n.map(Fh)):Te(n)}function rG(n){let i=new Map;for(let e of n.units)for(let t of e.create)if(t.kind===V.ExtractedAttribute){let o=i.get(t.target)||new xT;i.set(t.target,o),o.add(t.bindingKind,t.name,t.expression,t.namespace,t.trustedValueFn),qe.remove(t)}if(n instanceof K_)for(let e of n.units)for(let t of e.create)if(t.kind==V.Projection){let o=i.get(t.xref);if(o!==void 0){let r=yT(o);r.entries.length>0&&(t.attributes=r)}}else fm(t)&&(t.attributes=E5(n,i,t.xref),t.kind===V.RepeaterCreate&&t.emptyView!==null&&(t.emptyAttributes=E5(n,i,t.emptyView)));else if(n instanceof V1)for(let[e,t]of i.entries()){if(e!==n.root.xref)throw new Error("An attribute would be const collected into the host binding's template function, but is not associated with the root xref.");let o=yT(t);o.entries.length>0&&(n.root.attributes=o)}}function E5(n,i,e){let t=i.get(e);if(t!==void 0){let o=yT(t);if(o.entries.length>0)return n.addConst(o)}return null}var ih=Object.freeze([]),xT=class{known=new Map;byKind=new Map;propertyBindings=null;projectAs=null;get attributes(){return this.byKind.get(jt.Attribute)??ih}get classes(){return this.byKind.get(jt.ClassName)??ih}get styles(){return this.byKind.get(jt.StyleProperty)??ih}get bindings(){return this.propertyBindings??ih}get template(){return this.byKind.get(jt.Template)??ih}get i18n(){return this.byKind.get(jt.I18n)??ih}isKnown(i,e){let t=this.known.get(i)??new Set;return this.known.set(i,t),t.has(e)?!0:(t.add(e),!1)}add(i,e,t,o,r){if(!(i===jt.Attribute||i===jt.ClassName||i===jt.StyleProperty)&&this.isKnown(i,e))return;if(e==="ngProjectAs"){if(t===null||!(t instanceof aa)||t.value==null||typeof t.value?.toString()!="string")throw Error("ngProjectAs must have a string literal value");this.projectAs=t.value.toString()}let c=this.arrayFor(i);if(c.push(...aG(o,e)),i===jt.Attribute||i===jt.StyleProperty){if(t===null)throw Error("Attribute, i18n attribute, & style element attributes must have a value");if(r!==null){if(!CF(t))throw Error("AssertionError: extracted attribute value should be string literal");c.push(y$(r,new m_([new JC(t.value)],[]),void 0,t.sourceSpan))}else c.push(t)}}arrayFor(i){return i===jt.Property||i===jt.TwoWayProperty?(this.propertyBindings??=[],this.propertyBindings):(this.byKind.has(i)||this.byKind.set(i,[]),this.byKind.get(i))}};function aG(n,i){let e=Te(i);return n?[Te(0),Te(n),e]:[e]}function yT({attributes:n,bindings:i,classes:e,i18n:t,projectAs:o,styles:r,template:a}){let c=[...n];if(o!==null){let p=pE(o)[0];c.push(Te(5),Fh(p))}return e.length>0&&c.push(Te(1),...e),r.length>0&&c.push(Te(2),...r),i.length>0&&c.push(Te(3),...i),a.length>0&&c.push(Te(4),...a),t.length>0&&c.push(Te(6),...t),Gi(c)}function sG(n,i){let e=n.get(i);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function lG(n){let i=new Map;for(let e of n.units)for(let t of e.create)fm(t)&&i.set(t.xref,t);for(let e of n.units)for(let t of e.ops())if(t.kind===V.AnimationBinding){let o=cG(t);n.kind===Et.Host?e.create.push(o):qe.insertAfter(o,sG(i,t.target)),qe.remove(t)}}function cG(n){if(n.animationBindingKind===0)return TU(n.name,n.target,n.name==="animate.enter"?"enter":"leave",n.expression,n.securityContext,n.sourceSpan);{let i=n.expression;return EU(n.name,n.target,n.name==="animate.enter"?"enter":"leave",[Is(new xr(i,i.sourceSpan))],n.securityContext,n.sourceSpan)}}function dG(n){let i=new Map;for(let e of n.units){for(let t of e.create)t.kind===V.I18nAttributes&&i.set(t.target,t);for(let t of e.update)switch(t.kind){case V.Property:case V.Attribute:if(t.i18nContext===null||!(t.expression instanceof Qo))continue;let o=i.get(t.target);if(o===void 0)throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");if(o.target!==t.target)throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element");let r=[];for(let a=0;a<t.expression.expressions.length;a++){let c=t.expression.expressions[a];if(t.expression.i18nPlaceholders.length!==t.expression.expressions.length)throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${t.expression.i18nPlaceholders.length} placeholders and ${t.expression.expressions.length} expressions`);r.push(vF(t.i18nContext,o.target,o.xref,o.handle,c,null,t.expression.i18nPlaceholders[a],$_.Creation,zh.I18nAttribute,t.name,t.sourceSpan))}qe.replaceWithMany(t,r);break}}}function mG(n){let i=new Map;for(let o of n.units)for(let r of o.ops())switch(r.kind){case V.Binding:case V.Property:case V.Attribute:case V.ExtractedAttribute:if(r.i18nMessage===null)continue;if(!i.has(r.i18nMessage)){let a=bk(Pp.Attr,n.allocateXrefId(),null,r.i18nMessage,null);o.create.push(a),i.set(r.i18nMessage,a.xref)}r.i18nContext=i.get(r.i18nMessage);break}let e=new Map;for(let o of n.units)for(let r of o.create)switch(r.kind){case V.I18nStart:if(r.xref===r.root){let a=bk(Pp.RootI18n,n.allocateXrefId(),r.xref,r.message,null);o.create.push(a),r.context=a.xref,e.set(r.xref,a)}break}for(let o of n.units)for(let r of o.create)if(r.kind===V.I18nStart&&r.xref!==r.root){let a=e.get(r.root);if(a===void 0)throw Error("AssertionError: Root i18n block i18n context should have been created.");r.context=a.xref,e.set(r.xref,a)}let t=null;for(let o of n.units)for(let r of o.create)switch(r.kind){case V.I18nStart:t=r;break;case V.I18nEnd:t=null;break;case V.IcuStart:if(t===null)throw Error("AssertionError: Unexpected ICU outside of an i18n block.");if(r.message.id!==t.message.id){let a=bk(Pp.Icu,n.allocateXrefId(),t.root,r.message,null);o.create.push(a),r.context=a.xref}else r.context=t.context,e.get(t.xref).contextKind=Pp.Icu;break}}function pG(n){let i=new Map;for(let e of n.units)for(let t of e.update.reversed())if(t.kind===V.Binding&&t.isTextAttribute){let o=i.get(t.target)||new Set;o.has(t.name)&&(t.name==="style"||t.name==="class")&&qe.remove(t),o.add(t.name),i.set(t.target,o)}}function uG(n){for(let i of n.units)for(let e of i.create)e.kind===V.Defer&&(e.placeholderMinimumTime!==null&&(e.placeholderConfig=new X_(Fh([e.placeholderMinimumTime]))),(e.loadingMinimumTime!==null||e.loadingAfterTime!==null)&&(e.loadingConfig=new X_(Fh([e.loadingMinimumTime,e.loadingAfterTime]))))}function hG(n){let i=new Map;function e(o){if(i.has(o.xref))return i.get(o.xref);let r=new fG;for(let a of o.create)if(!(!fm(a)||a.localRefs===null)){if(!Array.isArray(a.localRefs))throw new Error("LocalRefs were already processed, but were needed to resolve defer targets.");for(let c of a.localRefs)c.target===""&&r.targets.set(c.name,{xref:a.xref,slot:a.handle})}return i.set(o.xref,r),r}function t(o,r,a){switch(r.trigger.kind){case Ji.Idle:case Ji.Never:case Ji.Immediate:case Ji.Timer:return;case Ji.Hover:case Ji.Interaction:case Ji.Viewport:if(r.trigger.targetName===null){if(a===null)throw new Error("defer on trigger with no target name must have a placeholder block");let u=n.views.get(a);if(u==null)throw new Error("AssertionError: could not find placeholder view for defer on trigger");for(let h of u.create)if(jh(h)&&(fm(h)||h.kind===V.Projection)){r.trigger.targetXref=h.xref,r.trigger.targetView=a,r.trigger.targetSlotViewSteps=-1,r.trigger.targetSlot=h.handle;return}return}let c=a!==null?n.views.get(a):o,p=a!==null?-1:0;for(;c!==null;){let u=e(c);if(u.targets.has(r.trigger.targetName)){let{xref:h,slot:_}=u.targets.get(r.trigger.targetName);r.trigger.targetXref=h,r.trigger.targetView=c.xref,r.trigger.targetSlotViewSteps=p,r.trigger.targetSlot=_;return}c=c.parent!==null?n.views.get(c.parent):null,p++}break;default:throw new Error(`Trigger kind ${r.trigger.kind} not handled`)}}for(let o of n.units){let r=new Map;for(let a of o.create)switch(a.kind){case V.Defer:r.set(a.xref,a);break;case V.DeferOn:let c=r.get(a.defer);t(o,a,a.modifier==="hydrate"?c.mainView:c.placeholderView);break}}}var fG=class{targets=new Map},gG=new Map([[V.ElementEnd,[V.ElementStart,V.Element]],[V.ContainerEnd,[V.ContainerStart,V.Container]],[V.I18nEnd,[V.I18nStart,V.I18n]]]),_G=new Set([V.Pipe]);function vG(n){for(let i of n.units)for(let e of i.create){let t=gG.get(e.kind);if(t===void 0)continue;let[o,r]=t,a=e.prev;for(;a!==null&&_G.has(a.kind);)a=a.prev;a!==null&&a.kind===o&&(a.kind=r,qe.remove(e))}}function CG(n){for(let i of n.units)for(let e of i.ops())Xo(e,t=>MG(t,{job:n}),Wn.None),Xo(e,kG,Wn.None)}function ys(n){return n instanceof jp?ys(n.expr):n instanceof gi?ys(n.lhs)||ys(n.rhs):n instanceof Sc?n.falseCase&&ys(n.falseCase)?!0:ys(n.condition)||ys(n.trueCase):n instanceof p_?ys(n.condition):n instanceof Dc?ys(n.expr):n instanceof Es?ys(n.receiver):n instanceof xd?ys(n.receiver)||ys(n.index):n instanceof Fl?ys(n.expr):n instanceof os||n instanceof wc||n instanceof Rl||n instanceof Zp||n instanceof Yp}function bG(n){let i=new Set;return Vt(n,e=>(e instanceof Dc&&i.add(e.xref),e),Wn.None),i}function xG(n,i,e){return Vt(n,t=>{if(t instanceof Dc&&i.has(t.xref)){let o=new hm(t.xref);return new Dc(o,o.xref)}return t},Wn.None),n}function oh(n,i,e){let t;if(ys(n)){let o=e.job.allocateXrefId();t=[new Dc(n,o),new hm(o)]}else t=[n,n.clone()],xG(t[1],bG(t[0]));return new Nh(t[0],i(t[1]))}function yG(n){return n instanceof Ah||n instanceof Oh||n instanceof Zp}function SG(n){return n instanceof Es||n instanceof xd||n instanceof os}function IF(n){return yG(n)||SG(n)}function wG(n){if(IF(n)&&n.receiver instanceof Nh){let i=n.receiver;for(;i.expr instanceof Nh;)i=i.expr;return i}return null}function MG(n,i){if(!IF(n))return n;let e=wG(n);if(e){if(n instanceof os)return e.expr=e.expr.callFn(n.args),n.receiver;if(n instanceof Es)return e.expr=e.expr.prop(n.name),n.receiver;if(n instanceof xd)return e.expr=e.expr.key(n.index),n.receiver;if(n instanceof Zp)return e.expr=oh(e.expr,t=>t.callFn(n.args),i),n.receiver;if(n instanceof Ah)return e.expr=oh(e.expr,t=>t.prop(n.name),i),n.receiver;if(n instanceof Oh)return e.expr=oh(e.expr,t=>t.key(n.index),i),n.receiver}else{if(n instanceof Zp)return oh(n.receiver,t=>t.callFn(n.args),i);if(n instanceof Ah)return oh(n.receiver,t=>t.prop(n.name),i);if(n instanceof Oh)return oh(n.receiver,t=>t.key(n.index),i)}return n}function kG(n){return n instanceof Nh?new Fl(new Sc(new gi(st.Equals,n.guard,yh),yh,n.expr)):n}var D5="\uFFFD",TG="#",EG="*",DG="/",PG=":",IG="[",AG="]",OG="|";function NG(n){let i=new Map,e=new Map,t=new Map;for(let r of n.units)for(let a of r.create)switch(a.kind){case V.I18nContext:let c=FG(n,a);r.create.push(c),i.set(a.xref,c),t.set(a.xref,a);break;case V.I18nStart:e.set(a.xref,a);break}let o=null;for(let r of n.units)for(let a of r.create)switch(a.kind){case V.IcuStart:o=a,qe.remove(a);let c=t.get(a.context);if(c.contextKind!==Pp.Icu)continue;let p=e.get(c.i18nBlock);if(p.context===c.xref)continue;let u=e.get(p.root),h=i.get(u.context);if(h===void 0)throw Error("AssertionError: ICU sub-message should belong to a root message.");let _=i.get(c.xref);_.messagePlaceholder=a.messagePlaceholder,h.subMessages.push(_.xref);break;case V.IcuEnd:o=null,qe.remove(a);break;case V.IcuPlaceholder:if(o===null||o.context==null)throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context");i.get(o.context).postprocessingParams.set(a.name,Te(RG(a))),qe.remove(a);break}}function FG(n,i,e){let t=P5(i.params),o=P5(i.postprocessingParams),r=[...i.params.values()].some(a=>a.length>1);return FU(n.allocateXrefId(),i.xref,i.i18nBlock,i.message,null,t,o,r)}function RG(n){if(n.strings.length!==n.expressionPlaceholders.length+1)throw Error(`AssertionError: Invalid ICU placeholder with ${n.strings.length} strings and ${n.expressionPlaceholders.length} expressions`);let i=n.expressionPlaceholders.map(uh);return n.strings.flatMap((e,t)=>[e,i[t]||""]).join("")}function P5(n){let i=new Map;for(let[e,t]of n){let o=LG(t);o!==null&&i.set(e,Te(o))}return i}function LG(n){if(n.length===0)return null;let i=n.map(e=>uh(e));return i.length===1?i[0]:`${IG}${i.join(OG)}${AG}`}function uh(n){if(n.flags&ao.ElementTag&&n.flags&ao.TemplateTag){if(typeof n.value!="object")throw Error("AssertionError: Expected i18n param value to have an element and template slot");let o=uh(it(K({},n),{value:n.value.element,flags:n.flags&~ao.TemplateTag})),r=uh(it(K({},n),{value:n.value.template,flags:n.flags&~ao.ElementTag}));return n.flags&ao.OpenTag&&n.flags&ao.CloseTag?`${r}${o}${r}`:n.flags&ao.CloseTag?`${o}${r}`:`${r}${o}`}if(n.flags&ao.OpenTag&&n.flags&ao.CloseTag)return`${uh(it(K({},n),{flags:n.flags&~ao.CloseTag}))}${uh(it(K({},n),{flags:n.flags&~ao.OpenTag}))}`;if(n.flags===ao.None)return`${n.value}`;let i="",e="";n.flags&ao.ElementTag?i=TG:n.flags&ao.TemplateTag&&(i=EG),i!==""&&(e=n.flags&ao.CloseTag?DG:"");let t=n.subTemplateIndex===null?"":`${PG}${n.subTemplateIndex}`;return`${D5}${e}${i}${n.value}${t}${D5}`}function VG(n){for(let i of n.units){let e=new Map;for(let o of i.create){if(jh(o)){if(o.handle.slot===null)throw new Error("AssertionError: expected slots to have been allocated before generating advance() calls")}else continue;e.set(o.xref,o.handle.slot)}let t=0;for(let o of i.update){let r=null;if(H_(o)?r=o:mr(o,c=>{r===null&&H_(c)&&(r=c)}),r===null)continue;if(!e.has(r.target))throw new Error(`AssertionError: reference to unknown slot for target ${r.target}`);let a=e.get(r.target);if(t!==a){let c=a-t;if(c<0)throw new Error("AssertionError: slot counter should never need to move backwards");qe.insertBefore(fU(c,r.sourceSpan),o),t=a}}}}function BG(n){for(let i of n.units)for(let e of i.update){if(e.kind!==V.StoreLet)continue;let t={kind:Wr.Identifier,name:null,identifier:e.declaredName,local:!0};qe.replace(e,tm(n.allocateXrefId(),t,new U_(e.target,e.value,e.sourceSpan),Zs.None))}}function zG(n){let e=[],t=0;for(let o of n.units)for(let r of o.create)r.kind===V.Projection&&(e.push(r.selector),r.projectionSlotIndex=t++);if(e.length>0){let o=null;if(e.length>1||e[0]!=="*"){let r=e.map(a=>a==="*"?a:pE(a));o=n.pool.getConstLiteral(Fh(r),!0)}n.contentSelectors=n.pool.getConstLiteral(Fh(e),!0),n.root.create.prepend([IU(o)])}}function jG(n){Xg(n.root,null)}function Xg(n,i){let e=I5(n,i);for(let t of n.create)switch(t.kind){case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:Xg(n.job.views.get(t.xref),e);break;case V.Projection:t.fallbackView!==null&&Xg(n.job.views.get(t.fallbackView),e);break;case V.RepeaterCreate:Xg(n.job.views.get(t.xref),e),t.emptyView&&Xg(n.job.views.get(t.emptyView),e),t.trackByOps!==null&&t.trackByOps.prepend(Kg(n,e,!1));break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:t.handlerOps.prepend(Kg(n,e,!0));break}n.update.prepend(Kg(n,e,!1));for(let t of n.functions)t.ops.prepend(Kg(n,I5(n,i),!0))}function I5(n,i){let e={view:n.xref,viewContextVariable:{kind:Wr.Context,name:null,view:n.xref},contextVariables:new Map,aliases:n.aliases,references:[],letDeclarations:[],parent:i};for(let t of n.contextVariables.keys())e.contextVariables.set(t,{kind:Wr.Identifier,name:null,identifier:t,local:!1});for(let t of n.create)switch(t.kind){case V.ElementStart:case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:if(!Array.isArray(t.localRefs))throw new Error("AssertionError: expected localRefs to be an array");for(let o=0;o<t.localRefs.length;o++)e.references.push({name:t.localRefs[o].name,targetId:t.xref,targetSlot:t.handle,offset:o,variable:{kind:Wr.Identifier,name:null,identifier:t.localRefs[o].name,local:!1}});break;case V.DeclareLet:e.letDeclarations.push({targetId:t.xref,targetSlot:t.handle,variable:{kind:Wr.Identifier,name:null,identifier:t.declaredName,local:!1}});break}return e}function Kg(n,i,e){let t=[];i.view!==n.xref&&t.push(tm(n.job.allocateXrefId(),i.viewContextVariable,new P1,Zs.None));let o=n.job.views.get(i.view);for(let[r,a]of o.contextVariables){let c=new pm(i.view),p=a===TF?c:new Es(c,a);t.push(tm(n.job.allocateXrefId(),i.contextVariables.get(r),p,Zs.None))}for(let r of o.aliases)t.push(tm(n.job.allocateXrefId(),r,r.expression.clone(),Zs.AlwaysInline));for(let r of i.references)t.push(tm(n.job.allocateXrefId(),r.variable,new D1(r.targetId,r.targetSlot,r.offset),Zs.None));if(i.view!==n.xref||e)for(let r of i.letDeclarations)t.push(tm(n.job.allocateXrefId(),r.variable,new G_(r.targetId,r.targetSlot),Zs.None));return i.parent!==null&&t.push(...Kg(n,i.parent,!1)),t}function $G(n){for(let i of n.units)for(let e of i.ops())Xo(e,t=>t instanceof X_?Te(n.addConst(t.expr)):t,Wn.None)}var A5="style.",O5="class.",HG="style!",N5="class!",F5="!important";function UG(n){for(let i of n.root.update)if(i.kind===V.Binding&&i.bindingKind===jt.Property)if(i.name.endsWith(F5)&&(i.name=i.name.substring(0,i.name.length-F5.length)),i.name.startsWith(A5)){i.bindingKind=jt.StyleProperty,i.name=i.name.substring(A5.length),GG(i.name)||(i.name=WG(i.name));let{property:e,suffix:t}=xk(i.name);i.name=e,i.unit=t}else i.name.startsWith(HG)?(i.bindingKind=jt.StyleProperty,i.name="style"):i.name.startsWith(O5)?(i.bindingKind=jt.ClassName,i.name=xk(i.name.substring(O5.length)).property):i.name.startsWith(N5)&&(i.bindingKind=jt.ClassName,i.name=xk(i.name.substring(N5.length)).property)}function GG(n){return n.startsWith("--")}function WG(n){return n.replace(/[a-z][A-Z]/g,i=>i.charAt(0)+"-"+i.charAt(1)).toLowerCase()}function xk(n){let i=n.indexOf("!important");i!==-1&&(n=i>0?n.substring(0,i):"");let e=null,t=n,o=n.lastIndexOf(".");return o>0&&(e=n.slice(o+1),t=n.substring(0,o)),{property:t,suffix:e}}function ST(n,i=!1){return nl(Object.keys(n).map(e=>({key:e,quoted:i,value:n[e]})))}var wT=class{visitText(i){return i.value}visitContainer(i){return i.children.map(e=>e.visit(this)).join("")}visitIcu(i){let e=Object.keys(i.cases).map(o=>`${o} {${i.cases[o].visit(this)}}`);return`{${i.expressionPlaceholder}, ${i.type}, ${e.join(" ")}}`}visitTagPlaceholder(i){return i.isVoid?this.formatPh(i.startName):`${this.formatPh(i.startName)}${i.children.map(e=>e.visit(this)).join("")}${this.formatPh(i.closeName)}`}visitPlaceholder(i){return this.formatPh(i.name)}visitBlockPlaceholder(i){return`${this.formatPh(i.startName)}${i.children.map(e=>e.visit(this)).join("")}${this.formatPh(i.closeName)}`}visitIcuPlaceholder(i,e){return this.formatPh(i.name)}formatPh(i){return`{${s0(i,!1)}}`}},qG=new wT;function AF(n){return n.visit(qG)}var yd=class{sourceSpan;i18n;constructor(i,e){this.sourceSpan=i,this.i18n=e}},Jp=class extends yd{value;tokens;constructor(i,e,t,o){super(e,o),this.value=i,this.tokens=t}visit(i,e){return i.visitText(this,e)}},Fp=class extends yd{switchValue;type;cases;switchValueSourceSpan;constructor(i,e,t,o,r,a){super(o,a),this.switchValue=i,this.type=e,this.cases=t,this.switchValueSourceSpan=r}visit(i,e){return i.visitExpansion(this,e)}},B1=class{value;expression;sourceSpan;valueSourceSpan;expSourceSpan;constructor(i,e,t,o,r){this.value=i,this.expression=e,this.sourceSpan=t,this.valueSourceSpan=o,this.expSourceSpan=r}visit(i,e){return i.visitExpansionCase(this,e)}},MT=class extends yd{name;value;keySpan;valueSpan;valueTokens;constructor(i,e,t,o,r,a,c){super(t,c),this.name=i,this.value=e,this.keySpan=o,this.valueSpan=r,this.valueTokens=a}visit(i,e){return i.visitAttribute(this,e)}},qs=class extends yd{name;attrs;directives;children;isSelfClosing;startSourceSpan;endSourceSpan;isVoid;constructor(i,e,t,o,r,a,c,p=null,u,h){super(a,h),this.name=i,this.attrs=e,this.directives=t,this.children=o,this.isSelfClosing=r,this.startSourceSpan=c,this.endSourceSpan=p,this.isVoid=u}visit(i,e){return i.visitElement(this,e)}},Y_=class{value;sourceSpan;constructor(i,e){this.value=i,this.sourceSpan=e}visit(i,e){return i.visitComment(this,e)}},Ks=class extends yd{name;parameters;children;nameSpan;startSourceSpan;endSourceSpan;constructor(i,e,t,o,r,a,c=null,p){super(o,p),this.name=i,this.parameters=e,this.children=t,this.nameSpan=r,this.startSourceSpan=a,this.endSourceSpan=c}visit(i,e){return i.visitBlock(this,e)}},Fa=class extends yd{componentName;tagName;fullName;attrs;directives;children;isSelfClosing;startSourceSpan;endSourceSpan;constructor(i,e,t,o,r,a,c,p,u,h=null,_){super(p,_),this.componentName=i,this.tagName=e,this.fullName=t,this.attrs=o,this.directives=r,this.children=a,this.isSelfClosing=c,this.startSourceSpan=u,this.endSourceSpan=h}visit(i,e){return i.visitComponent(this,e)}},kT=class{name;attrs;sourceSpan;startSourceSpan;endSourceSpan;constructor(i,e,t,o,r=null){this.name=i,this.attrs=e,this.sourceSpan=t,this.startSourceSpan=o,this.endSourceSpan=r}visit(i,e){return i.visitDirective(this,e)}},z1=class{expression;sourceSpan;constructor(i,e){this.expression=i,this.sourceSpan=e}visit(i,e){return i.visitBlockParameter(this,e)}},j1=class{name;value;sourceSpan;nameSpan;valueSpan;constructor(i,e,t,o,r){this.name=i,this.value=e,this.sourceSpan=t,this.nameSpan=o,this.valueSpan=r}visit(i,e){return i.visitLetDeclaration(this,e)}};function Co(n,i,e=null){let t=[],o=n.visit?r=>n.visit(r,e)||r.visit(n,e):r=>r.visit(n,e);return i.forEach(r=>{let a=o(r);a&&t.push(a)}),t}var Z_={AElig:"\xC6",AMP:"&",amp:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",af:"\u2061",Aring:"\xC5",angst:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",colone:"\u2254",coloneq:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",setminus:"\u2216",setmn:"\u2216",smallsetminus:"\u2216",ssetmn:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",doublebarwedge:"\u2306",Bcy:"\u0411",Because:"\u2235",becaus:"\u2235",because:"\u2235",Bernoullis:"\u212C",Bscr:"\u212C",bernou:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",breve:"\u02D8",Bumpeq:"\u224E",HumpDownHump:"\u224E",bump:"\u224E",CHcy:"\u0427",COPY:"\xA9",copy:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",DD:"\u2145",Cayleys:"\u212D",Cfr:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",cedil:"\xB8",CenterDot:"\xB7",centerdot:"\xB7",middot:"\xB7",Chi:"\u03A7",CircleDot:"\u2299",odot:"\u2299",CircleMinus:"\u2296",ominus:"\u2296",CirclePlus:"\u2295",oplus:"\u2295",CircleTimes:"\u2297",otimes:"\u2297",ClockwiseContourIntegral:"\u2232",cwconint:"\u2232",CloseCurlyDoubleQuote:"\u201D",rdquo:"\u201D",rdquor:"\u201D",CloseCurlyQuote:"\u2019",rsquo:"\u2019",rsquor:"\u2019",Colon:"\u2237",Proportion:"\u2237",Colone:"\u2A74",Congruent:"\u2261",equiv:"\u2261",Conint:"\u222F",DoubleContourIntegral:"\u222F",ContourIntegral:"\u222E",conint:"\u222E",oint:"\u222E",Copf:"\u2102",complexes:"\u2102",Coproduct:"\u2210",coprod:"\u2210",CounterClockwiseContourIntegral:"\u2233",awconint:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",asympeq:"\u224D",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",ddagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",DoubleLeftTee:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",nabla:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",acute:"\xB4",DiacriticalDot:"\u02D9",dot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",dblac:"\u02DD",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"\u02DC",tilde:"\u02DC",Diamond:"\u22C4",diam:"\u22C4",diamond:"\u22C4",DifferentialD:"\u2146",dd:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DoubleDot:"\xA8",die:"\xA8",uml:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",doteq:"\u2250",esdot:"\u2250",DoubleDownArrow:"\u21D3",Downarrow:"\u21D3",dArr:"\u21D3",DoubleLeftArrow:"\u21D0",Leftarrow:"\u21D0",lArr:"\u21D0",DoubleLeftRightArrow:"\u21D4",Leftrightarrow:"\u21D4",hArr:"\u21D4",iff:"\u21D4",DoubleLongLeftArrow:"\u27F8",Longleftarrow:"\u27F8",xlArr:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",Longleftrightarrow:"\u27FA",xhArr:"\u27FA",DoubleLongRightArrow:"\u27F9",Longrightarrow:"\u27F9",xrArr:"\u27F9",DoubleRightArrow:"\u21D2",Implies:"\u21D2",Rightarrow:"\u21D2",rArr:"\u21D2",DoubleRightTee:"\u22A8",vDash:"\u22A8",DoubleUpArrow:"\u21D1",Uparrow:"\u21D1",uArr:"\u21D1",DoubleUpDownArrow:"\u21D5",Updownarrow:"\u21D5",vArr:"\u21D5",DoubleVerticalBar:"\u2225",par:"\u2225",parallel:"\u2225",shortparallel:"\u2225",spar:"\u2225",DownArrow:"\u2193",ShortDownArrow:"\u2193",darr:"\u2193",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",duarr:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",leftharpoondown:"\u21BD",lhard:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",rhard:"\u21C1",rightharpoondown:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",top:"\u22A4",DownTeeArrow:"\u21A7",mapstodown:"\u21A7",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",in:"\u2208",isin:"\u2208",isinv:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",eqsim:"\u2242",esim:"\u2242",Equilibrium:"\u21CC",rightleftharpoons:"\u21CC",rlhar:"\u21CC",Escr:"\u2130",expectation:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",exist:"\u2203",ExponentialE:"\u2147",ee:"\u2147",exponentiale:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",blacksquare:"\u25AA",squarf:"\u25AA",squf:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",forall:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",gt:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",ggg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",ge:"\u2265",geq:"\u2265",GreaterEqualLess:"\u22DB",gel:"\u22DB",gtreqless:"\u22DB",GreaterFullEqual:"\u2267",gE:"\u2267",geqq:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",gl:"\u2277",gtrless:"\u2277",GreaterSlantEqual:"\u2A7E",geqslant:"\u2A7E",ges:"\u2A7E",GreaterTilde:"\u2273",gsim:"\u2273",gtrsim:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",NestedGreaterGreater:"\u226B",gg:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",caron:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",Poincareplane:"\u210C",HilbertSpace:"\u210B",Hscr:"\u210B",hamilt:"\u210B",Hopf:"\u210D",quaternions:"\u210D",HorizontalLine:"\u2500",boxh:"\u2500",Hstrok:"\u0126",HumpEqual:"\u224F",bumpe:"\u224F",bumpeq:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Im:"\u2111",image:"\u2111",imagpart:"\u2111",Igrave:"\xCC",Imacr:"\u012A",ImaginaryI:"\u2148",ii:"\u2148",Int:"\u222C",Integral:"\u222B",int:"\u222B",Intersection:"\u22C2",bigcap:"\u22C2",xcap:"\u22C2",InvisibleComma:"\u2063",ic:"\u2063",InvisibleTimes:"\u2062",it:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",imagline:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",lt:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Lscr:"\u2112",lagran:"\u2112",Larr:"\u219E",twoheadleftarrow:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",lang:"\u27E8",langle:"\u27E8",LeftArrow:"\u2190",ShortLeftArrow:"\u2190",larr:"\u2190",leftarrow:"\u2190",slarr:"\u2190",LeftArrowBar:"\u21E4",larrb:"\u21E4",LeftArrowRightArrow:"\u21C6",leftrightarrows:"\u21C6",lrarr:"\u21C6",LeftCeiling:"\u2308",lceil:"\u2308",LeftDoubleBracket:"\u27E6",lobrk:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",dharl:"\u21C3",downharpoonleft:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",lfloor:"\u230A",LeftRightArrow:"\u2194",harr:"\u2194",leftrightarrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",dashv:"\u22A3",LeftTeeArrow:"\u21A4",mapstoleft:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",vartriangleleft:"\u22B2",vltri:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",ltrie:"\u22B4",trianglelefteq:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",uharl:"\u21BF",upharpoonleft:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",leftharpoonup:"\u21BC",lharu:"\u21BC",LeftVectorBar:"\u2952",LessEqualGreater:"\u22DA",leg:"\u22DA",lesseqgtr:"\u22DA",LessFullEqual:"\u2266",lE:"\u2266",leqq:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",lg:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",leqslant:"\u2A7D",les:"\u2A7D",LessTilde:"\u2272",lesssim:"\u2272",lsim:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",lAarr:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",longleftarrow:"\u27F5",xlarr:"\u27F5",LongLeftRightArrow:"\u27F7",longleftrightarrow:"\u27F7",xharr:"\u27F7",LongRightArrow:"\u27F6",longrightarrow:"\u27F6",xrarr:"\u27F6",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",swarr:"\u2199",swarrow:"\u2199",LowerRightArrow:"\u2198",searr:"\u2198",searrow:"\u2198",Lsh:"\u21B0",lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",NestedLessLess:"\u226A",ll:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mscr:"\u2133",phmmat:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",mnplus:"\u2213",mp:"\u2213",Mopf:"\u{1D544}",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",ZeroWidthSpace:"\u200B",NewLine:`
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nbsp:"\xA0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226F",ngt:"\u226F",ngtr:"\u226F",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",nGtv:"\u226B\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224E\u0338",nbump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",nbumpe:"\u224F\u0338",NotLeftTriangle:"\u22EA",nltri:"\u22EA",ntriangleleft:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",nltrie:"\u22EC",ntrianglelefteq:"\u22EC",NotLess:"\u226E",nless:"\u226E",nlt:"\u226E",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226A\u0338",nLtv:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",npre:"\u2AAF\u0338",npreceq:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",nprcue:"\u22E0",NotReverseElement:"\u220C",notni:"\u220C",notniva:"\u220C",NotRightTriangle:"\u22EB",nrtri:"\u22EB",ntriangleright:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",nrtrie:"\u22ED",ntrianglerighteq:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",nsqsube:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",nsqsupe:"\u22E3",NotSubset:"\u2282\u20D2",nsubset:"\u2282\u20D2",vnsub:"\u2282\u20D2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",nsce:"\u2AB0\u0338",nsucceq:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",nsccue:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",nsupset:"\u2283\u20D2",vnsup:"\u2283\u20D2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",ohm:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",ldquo:"\u201C",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",oline:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",tbrk:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",part:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",plusmn:"\xB1",pm:"\xB1",Popf:"\u2119",primes:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",pr:"\u227A",prec:"\u227A",PrecedesEqual:"\u2AAF",pre:"\u2AAF",preceq:"\u2AAF",PrecedesSlantEqual:"\u227C",prcue:"\u227C",preccurlyeq:"\u227C",PrecedesTilde:"\u227E",precsim:"\u227E",prsim:"\u227E",Prime:"\u2033",Product:"\u220F",prod:"\u220F",Proportional:"\u221D",prop:"\u221D",propto:"\u221D",varpropto:"\u221D",vprop:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',quot:'"',Qfr:"\u{1D514}",Qopf:"\u211A",rationals:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xAE",circledR:"\xAE",reg:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",twoheadrightarrow:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",Rfr:"\u211C",real:"\u211C",realpart:"\u211C",ReverseElement:"\u220B",SuchThat:"\u220B",ni:"\u220B",niv:"\u220B",ReverseEquilibrium:"\u21CB",leftrightharpoons:"\u21CB",lrhar:"\u21CB",ReverseUpEquilibrium:"\u296F",duhar:"\u296F",Rho:"\u03A1",RightAngleBracket:"\u27E9",rang:"\u27E9",rangle:"\u27E9",RightArrow:"\u2192",ShortRightArrow:"\u2192",rarr:"\u2192",rightarrow:"\u2192",srarr:"\u2192",RightArrowBar:"\u21E5",rarrb:"\u21E5",RightArrowLeftArrow:"\u21C4",rightleftarrows:"\u21C4",rlarr:"\u21C4",RightCeiling:"\u2309",rceil:"\u2309",RightDoubleBracket:"\u27E7",robrk:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",dharr:"\u21C2",downharpoonright:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rfloor:"\u230B",RightTee:"\u22A2",vdash:"\u22A2",RightTeeArrow:"\u21A6",map:"\u21A6",mapsto:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",vartriangleright:"\u22B3",vrtri:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",rtrie:"\u22B5",trianglerighteq:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",uharr:"\u21BE",upharpoonright:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",rharu:"\u21C0",rightharpoonup:"\u21C0",RightVectorBar:"\u2953",Ropf:"\u211D",reals:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",rAarr:"\u21DB",Rscr:"\u211B",realine:"\u211B",Rsh:"\u21B1",rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortUpArrow:"\u2191",UpArrow:"\u2191",uarr:"\u2191",uparrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",compfn:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",radic:"\u221A",Square:"\u25A1",squ:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",sqcap:"\u2293",SquareSubset:"\u228F",sqsub:"\u228F",sqsubset:"\u228F",SquareSubsetEqual:"\u2291",sqsube:"\u2291",sqsubseteq:"\u2291",SquareSuperset:"\u2290",sqsup:"\u2290",sqsupset:"\u2290",SquareSupersetEqual:"\u2292",sqsupe:"\u2292",sqsupseteq:"\u2292",SquareUnion:"\u2294",sqcup:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",sstarf:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",sube:"\u2286",subseteq:"\u2286",Succeeds:"\u227B",sc:"\u227B",succ:"\u227B",SucceedsEqual:"\u2AB0",sce:"\u2AB0",succeq:"\u2AB0",SucceedsSlantEqual:"\u227D",sccue:"\u227D",succcurlyeq:"\u227D",SucceedsTilde:"\u227F",scsim:"\u227F",succsim:"\u227F",Sum:"\u2211",sum:"\u2211",Sup:"\u22D1",Supset:"\u22D1",Superset:"\u2283",sup:"\u2283",supset:"\u2283",SupersetEqual:"\u2287",supe:"\u2287",supseteq:"\u2287",THORN:"\xDE",TRADE:"\u2122",trade:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",there4:"\u2234",therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",Tilde:"\u223C",sim:"\u223C",thicksim:"\u223C",thksim:"\u223C",TildeEqual:"\u2243",sime:"\u2243",simeq:"\u2243",TildeFullEqual:"\u2245",cong:"\u2245",TildeTilde:"\u2248",ap:"\u2248",approx:"\u2248",asymp:"\u2248",thickapprox:"\u2248",thkap:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",tdot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",lowbar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",bbrk:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",bigcup:"\u22C3",xcup:"\u22C3",UnionPlus:"\u228E",uplus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",udarr:"\u21C5",UpDownArrow:"\u2195",updownarrow:"\u2195",varr:"\u2195",UpEquilibrium:"\u296E",udhar:"\u296E",UpTee:"\u22A5",bot:"\u22A5",bottom:"\u22A5",perp:"\u22A5",UpTeeArrow:"\u21A5",mapstoup:"\u21A5",UpperLeftArrow:"\u2196",nwarr:"\u2196",nwarrow:"\u2196",UpperRightArrow:"\u2197",nearr:"\u2197",nearrow:"\u2197",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",bigvee:"\u22C1",xvee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",mid:"\u2223",shortmid:"\u2223",smid:"\u2223",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",wr:"\u2240",wreath:"\u2240",VeryThinSpace:"\u200A",hairsp:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",bigwedge:"\u22C0",xwedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",Zeta:"\u0396",Zfr:"\u2128",zeetrf:"\u2128",Zopf:"\u2124",integers:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",mstpos:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acy:"\u0430",aelig:"\xE6",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",and:"\u2227",wedge:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",angle:"\u2220",ange:"\u29A4",angmsd:"\u2221",measuredangle:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",approxeq:"\u224A",apid:"\u224B",apos:"'",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",midast:"*",atilde:"\xE3",auml:"\xE4",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",bcong:"\u224C",backepsilon:"\u03F6",bepsi:"\u03F6",backprime:"\u2035",bprime:"\u2035",backsim:"\u223D",bsim:"\u223D",backsimeq:"\u22CD",bsime:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrktbrk:"\u23B6",bcy:"\u0431",bdquo:"\u201E",ldquor:"\u201E",bemptyv:"\u29B0",beta:"\u03B2",beth:"\u2136",between:"\u226C",twixt:"\u226C",bfr:"\u{1D51F}",bigcirc:"\u25EF",xcirc:"\u25EF",bigodot:"\u2A00",xodot:"\u2A00",bigoplus:"\u2A01",xoplus:"\u2A01",bigotimes:"\u2A02",xotime:"\u2A02",bigsqcup:"\u2A06",xsqcup:"\u2A06",bigstar:"\u2605",starf:"\u2605",bigtriangledown:"\u25BD",xdtri:"\u25BD",bigtriangleup:"\u25B3",xutri:"\u25B3",biguplus:"\u2A04",xuplus:"\u2A04",bkarow:"\u290D",rbarr:"\u290D",blacklozenge:"\u29EB",lozf:"\u29EB",blacktriangle:"\u25B4",utrif:"\u25B4",blacktriangledown:"\u25BE",dtrif:"\u25BE",blacktriangleleft:"\u25C2",ltrif:"\u25C2",blacktriangleright:"\u25B8",rtrif:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",minusb:"\u229F",boxplus:"\u229E",plusb:"\u229E",boxtimes:"\u22A0",timesb:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bumpE:"\u2AAE",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cemptyv:"\u29B2",cent:"\xA2",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",cire:"\u2257",circlearrowleft:"\u21BA",olarr:"\u21BA",circlearrowright:"\u21BB",orarr:"\u21BB",circledS:"\u24C8",oS:"\u24C8",circledast:"\u229B",oast:"\u229B",circledcirc:"\u229A",ocir:"\u229A",circleddash:"\u229D",odash:"\u229D",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",comma:",",commat:"@",comp:"\u2201",complement:"\u2201",congdot:"\u2A6D",copf:"\u{1D554}",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",curlyeqprec:"\u22DE",cuesc:"\u22DF",curlyeqsucc:"\u22DF",cularr:"\u21B6",curvearrowleft:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curvearrowright:"\u21B7",curarrm:"\u293C",curlyvee:"\u22CE",cuvee:"\u22CE",curlywedge:"\u22CF",cuwed:"\u22CF",curren:"\xA4",cwint:"\u2231",cylcty:"\u232D",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",dash:"\u2010",hyphen:"\u2010",dbkarow:"\u290F",rBarr:"\u290F",dcaron:"\u010F",dcy:"\u0434",ddarr:"\u21CA",downdownarrows:"\u21CA",ddotseq:"\u2A77",eDDot:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",diamondsuit:"\u2666",diams:"\u2666",digamma:"\u03DD",gammad:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",llcorner:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",doteqdot:"\u2251",eDot:"\u2251",dotminus:"\u2238",minusd:"\u2238",dotplus:"\u2214",plusdo:"\u2214",dotsquare:"\u22A1",sdotb:"\u22A1",drcorn:"\u231F",lrcorner:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",triangledown:"\u25BF",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",eqcirc:"\u2256",ecirc:"\xEA",ecolon:"\u2255",eqcolon:"\u2255",ecy:"\u044D",edot:"\u0117",efDot:"\u2252",fallingdotseq:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",eqslantgtr:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",eqslantless:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",varnothing:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",straightepsilon:"\u03F5",varepsilon:"\u03F5",equals:"=",equest:"\u225F",questeq:"\u225F",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",risingdotseq:"\u2253",erarr:"\u2971",escr:"\u212F",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",fork:"\u22D4",pitchfork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",half:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",sfrown:"\u2322",fscr:"\u{1D4BB}",gEl:"\u2A8C",gtreqqless:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gap:"\u2A86",gtrapprox:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gimel:"\u2137",gjcy:"\u0453",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gneqq:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gnsim:"\u22E7",gopf:"\u{1D558}",gscr:"\u210A",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtrdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrarr:"\u2978",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hardcy:"\u044A",harrcir:"\u2948",harrw:"\u21AD",leftrightsquigarrow:"\u21AD",hbar:"\u210F",hslash:"\u210F",planck:"\u210F",plankv:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",mldr:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",searhk:"\u2925",hkswarow:"\u2926",swarhk:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",larrhk:"\u21A9",hookrightarrow:"\u21AA",rarrhk:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hstrok:"\u0127",hybull:"\u2043",iacute:"\xED",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",ifr:"\u{1D526}",igrave:"\xEC",iiiint:"\u2A0C",qint:"\u2A0C",iiint:"\u222D",tint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",imath:"\u0131",inodot:"\u0131",imof:"\u22B7",imped:"\u01B5",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",intcal:"\u22BA",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iquest:"\xBF",iscr:"\u{1D4BE}",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",varkappa:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAtail:"\u291B",lBarr:"\u290E",lEg:"\u2A8B",lesseqqgtr:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lambda:"\u03BB",langd:"\u2991",lap:"\u2A85",lessapprox:"\u2A85",laquo:"\xAB",larrbfs:"\u291F",larrfs:"\u291D",larrlp:"\u21AB",looparrowleft:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",leftarrowtail:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lcy:"\u043B",ldca:"\u2936",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leq:"\u2264",leftleftarrows:"\u21C7",llarr:"\u21C7",leftthreetimes:"\u22CB",lthree:"\u22CB",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessdot:"\u22D6",ltdot:"\u22D6",lfisht:"\u297C",lfr:"\u{1D529}",lgE:"\u2A91",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lneqq:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",longmapsto:"\u27FC",xmap:"\u27FC",looparrowright:"\u21AC",rarrlp:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",loz:"\u25CA",lozenge:"\u25CA",lpar:"(",lparlt:"\u2993",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsime:"\u2A8D",lsimg:"\u2A8F",lsquor:"\u201A",sbquo:"\u201A",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",triangleleft:"\u25C3",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",strns:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midcir:"\u2AF0",minus:"\u2212",minusdu:"\u2A2A",mlcp:"\u2ADB",models:"\u22A7",mopf:"\u{1D55E}",mscr:"\u{1D4C2}",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nLeftarrow:"\u21CD",nlArr:"\u21CD",nLeftrightarrow:"\u21CE",nhArr:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nRightarrow:"\u21CF",nrArr:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nacute:"\u0144",nang:"\u2220\u20D2",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",natur:"\u266E",natural:"\u266E",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",neArr:"\u21D7",nearhk:"\u2924",nedot:"\u2250\u0338",nesear:"\u2928",toea:"\u2928",nfr:"\u{1D52B}",nharr:"\u21AE",nleftrightarrow:"\u21AE",nhpar:"\u2AF2",nis:"\u22FC",nisd:"\u22FA",njcy:"\u045A",nlE:"\u2266\u0338",nleqq:"\u2266\u0338",nlarr:"\u219A",nleftarrow:"\u219A",nldr:"\u2025",nopf:"\u{1D55F}",not:"\xAC",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinvb:"\u22F7",notinvc:"\u22F6",notnivb:"\u22FE",notnivc:"\u22FD",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",nrarr:"\u219B",nrightarrow:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nscr:"\u{1D4C3}",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsubseteqq:"\u2AC5\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupseteqq:"\u2AC6\u0338",ntilde:"\xF1",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwnear:"\u2927",oacute:"\xF3",ocirc:"\xF4",ocy:"\u043E",odblac:"\u0151",odiv:"\u2A38",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",olcir:"\u29BE",olcross:"\u29BB",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",or:"\u2228",vee:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",oscr:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",para:"\xB6",parsim:"\u2AF3",parsl:"\u2AFD",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",straightphi:"\u03D5",varphi:"\u03D5",phone:"\u260E",pi:"\u03C0",piv:"\u03D6",varpi:"\u03D6",planckh:"\u210E",plus:"+",plusacir:"\u2A23",pluscir:"\u2A22",plusdu:"\u2A25",pluse:"\u2A72",plussim:"\u2A26",plustwo:"\u2A27",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",prE:"\u2AB3",prap:"\u2AB7",precapprox:"\u2AB7",precnapprox:"\u2AB9",prnap:"\u2AB9",precneqq:"\u2AB5",prnE:"\u2AB5",precnsim:"\u22E8",prnsim:"\u22E8",prime:"\u2032",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quatint:"\u2A16",quest:"?",rAtail:"\u291C",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",raemptyv:"\u29B3",rangd:"\u2992",range:"\u29A5",raquo:"\xBB",rarrap:"\u2975",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rightarrowtail:"\u21A3",rarrw:"\u219D",rightsquigarrow:"\u219D",ratail:"\u291A",ratio:"\u2236",rbbrk:"\u2773",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdsh:"\u21B3",rect:"\u25AD",rfisht:"\u297D",rfr:"\u{1D52F}",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",varrho:"\u03F1",rightrightarrows:"\u21C9",rrarr:"\u21C9",rightthreetimes:"\u22CC",rthree:"\u22CC",ring:"\u02DA",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rsaquo:"\u203A",rscr:"\u{1D4C7}",rtimes:"\u22CA",rtri:"\u25B9",triangleright:"\u25B9",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",scE:"\u2AB4",scap:"\u2AB8",succapprox:"\u2AB8",scaron:"\u0161",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",succneqq:"\u2AB6",scnap:"\u2ABA",succnapprox:"\u2ABA",scnsim:"\u22E9",succnsim:"\u22E9",scpolint:"\u2A13",scy:"\u0441",sdot:"\u22C5",sdote:"\u2A66",seArr:"\u21D8",sect:"\xA7",semi:";",seswar:"\u2929",tosa:"\u2929",sext:"\u2736",sfr:"\u{1D530}",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",varsigma:"\u03C2",simdot:"\u2A6A",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",smashp:"\u2A33",smeparsl:"\u29E4",smile:"\u2323",ssmile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",sqcaps:"\u2293\uFE00",sqcups:"\u2294\uFE00",sscr:"\u{1D4C8}",star:"\u2606",sub:"\u2282",subset:"\u2282",subE:"\u2AC5",subseteqq:"\u2AC5",subdot:"\u2ABD",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subsetneqq:"\u2ACB",subne:"\u228A",subsetneq:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supE:"\u2AC6",supseteqq:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supsetneqq:"\u2ACC",supne:"\u228B",supsetneq:"\u228B",supplus:"\u2AC0",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",telrec:"\u2315",tfr:"\u{1D531}",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",vartheta:"\u03D1",thorn:"\xFE",times:"\xD7",timesbar:"\u2A31",timesd:"\u2A30",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tprime:"\u2034",triangle:"\u25B5",utri:"\u25B5",triangleq:"\u225C",trie:"\u225C",tridot:"\u25EC",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",uHar:"\u2963",uacute:"\xFA",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udblac:"\u0171",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uogon:"\u0173",uopf:"\u{1D566}",upsi:"\u03C5",upsilon:"\u03C5",upuparrows:"\u21C8",uuarr:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",uuml:"\xFC",uwangle:"\u29A7",vBar:"\u2AE8",vBarv:"\u2AE9",vangrt:"\u299C",varsubsetneq:"\u228A\uFE00",vsubne:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",vsubnE:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",vsupne:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vsupnE:"\u2ACC\uFE00",vcy:"\u0432",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",vfr:"\u{1D533}",vopf:"\u{1D567}",vscr:"\u{1D4CB}",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedgeq:"\u2259",weierp:"\u2118",wp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wscr:"\u{1D4CC}",xfr:"\u{1D535}",xi:"\u03BE",xnis:"\u22FB",xopf:"\u{1D569}",xscr:"\u{1D4CD}",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"},OF="\uE500";Z_.ngsp=OF;var TT=class{tokens;errors;nonNormalizedIcuExpressions;constructor(i,e,t){this.tokens=i,this.errors=e,this.nonNormalizedIcuExpressions=t}};function QG(n,i,e,t={}){let o=new DT(new k1(n,i),e,t);return o.tokenize(),new TT(oW(o.tokens),o.errors,o.nonNormalizedIcuExpressions)}var XG=/\r\n?/g;function rh(n){return`Unexpected character "${n===Gr?"EOF":String.fromCharCode(n)}"`}function R5(n){return`Unknown entity "${n}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`}function KG(n,i){return`Unable to parse entity "${i}" - ${n} character reference entities must end with ";"`}var ET=(function(n){return n.HEX="hexadecimal",n.DEC="decimal",n})(ET||{}),YG=["@if","@else","@for","@switch","@case","@default","@empty","@defer","@placeholder","@loading","@error"],zg={start:"{{",end:"}}"},DT=class{_getTagDefinition;_cursor;_tokenizeIcu;_leadingTriviaCodePoints;_currentTokenStart=null;_currentTokenType=null;_expansionCaseStack=[];_openDirectiveCount=0;_inInterpolation=!1;_preserveLineEndings;_i18nNormalizeLineEndingsInICUs;_tokenizeBlocks;_tokenizeLet;_selectorlessEnabled;tokens=[];errors=[];nonNormalizedIcuExpressions=[];constructor(i,e,t){this._getTagDefinition=e,this._tokenizeIcu=t.tokenizeExpansionForms||!1,this._leadingTriviaCodePoints=t.leadingTriviaChars&&t.leadingTriviaChars.map(r=>r.codePointAt(0)||0);let o=t.range||{endPos:i.content.length,startPos:0,startLine:0,startCol:0};this._cursor=t.escapedString?new PT(i,o):new $1(i,o),this._preserveLineEndings=t.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=t.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=t.tokenizeBlocks??!0,this._tokenizeLet=t.tokenizeLet??!0,this._selectorlessEnabled=t.selectorlessEnabled??!1;try{this._cursor.init()}catch(r){this.handleError(r)}}_processCarriageReturns(i){return this._preserveLineEndings?i:i.replace(XG,`
`)}tokenize(){for(;this._cursor.peek()!==Gr;){let i=this._cursor.clone();try{this._attemptCharCode(_h)?this._attemptCharCode(sT)?this._attemptCharCode(bc)?this._consumeCdata(i):this._attemptCharCode(w1)?this._consumeComment(i):this._consumeDocType(i):this._attemptCharCode(Qs)?this._consumeTagClose(i):this._consumeTagOpen(i):this._tokenizeLet&&this._cursor.peek()===nh&&!this._inInterpolation&&this._isLetStart()?this._consumeLetDeclaration(i):this._tokenizeBlocks&&this._isBlockStart()?this._consumeBlockStart(i):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(Ra)?this._consumeBlockEnd(i):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(e){this.handleError(e)}}this._beginToken(41),this._endToken([])}_getBlockName(){let i=!1,e=this._cursor.clone();return this._attemptCharCodeUntilFn(t=>B_(t)?!i:iW(t)?(i=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeBlockStart(i){this._requireCharCode(nh),this._beginToken(24,i);let e=this._endToken([this._getBlockName()]);if(e.parts[0]==="default never"&&this._attemptCharCode(es)){this._beginToken(25),this._endToken([]),this._beginToken(26),this._endToken([]);return}if(this._cursor.peek()===Va)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(Ro),this._attemptCharCode(Cr))this._attemptCharCodeUntilFn(Ro);else{e.type=28;return}this._attemptCharCode(Ys)?(this._beginToken(25),this._endToken([])):this._isBlockStart()&&(e.parts[0]==="case"||e.parts[0]==="default")?(this._beginToken(25),this._endToken([]),this._beginToken(26),this._endToken([])):e.type=28}_consumeBlockEnd(i){this._beginToken(26,i),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(V5);this._cursor.peek()!==Cr&&this._cursor.peek()!==Gr;){this._beginToken(27);let i=this._cursor.clone(),e=null,t=0;for(;this._cursor.peek()!==es&&this._cursor.peek()!==Gr||e!==null;){let o=this._cursor.peek();if(o===Np)this._cursor.advance();else if(o===e)e=null;else if(e===null&&t_(o))e=o;else if(o===Va&&e===null)t++;else if(o===Cr&&e===null){if(t===0)break;t>0&&t--}this._cursor.advance()}this._endToken([this._cursor.getChars(i)]),this._attemptCharCodeUntilFn(V5)}}_consumeLetDeclaration(i){if(this._requireStr("@let"),this._beginToken(29,i),B_(this._cursor.peek()))this._attemptCharCodeUntilFn(Ro);else{let o=this._endToken([this._cursor.getChars(i)]);o.type=32;return}let e=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(Ro),!this._attemptCharCode(Hr)){e.type=32;return}this._attemptCharCodeUntilFn(o=>Ro(o)&&!M1(o)),this._consumeLetDeclarationValue(),this._cursor.peek()===es?(this._beginToken(31),this._endToken([]),this._cursor.advance()):(e.type=32,e.sourceSpan=this._cursor.getSpan(i))}_getLetDeclarationName(){let i=this._cursor.clone(),e=!1;return this._attemptCharCodeUntilFn(t=>mm(t)||t===ob||t===_m||e&&Xs(t)?(e=!0,!1):!0),this._cursor.getChars(i).trim()}_consumeLetDeclarationValue(){let i=this._cursor.clone();for(this._beginToken(30,i);this._cursor.peek()!==Gr;){let e=this._cursor.peek();if(e===es)break;t_(e)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(t=>t===Np?(this._cursor.advance(),!1):t===e)),this._cursor.advance()}this._endToken([this._cursor.getChars(i)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(tW(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===Ra){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(i,e=this._cursor.clone()){this._currentTokenStart=e,this._currentTokenType=i}_endToken(i,e){if(this._currentTokenStart===null)throw new sn(this._cursor.getSpan(e),"Programming error - attempted to end a token when there was no start to the token");if(this._currentTokenType===null)throw new sn(this._cursor.getSpan(this._currentTokenStart),"Programming error - attempted to end a token which has no token type");let t={type:this._currentTokenType,parts:i,sourceSpan:(e??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(t),this._currentTokenStart=null,this._currentTokenType=null,t}_createError(i,e){this._isInExpansionForm()&&(i+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let t=new sn(e,i);return this._currentTokenStart=null,this._currentTokenType=null,t}handleError(i){if(i instanceof J_&&(i=this._createError(i.msg,this._cursor.getSpan(i.cursor))),i instanceof sn)this.errors.push(i);else throw i}_attemptCharCode(i){return this._cursor.peek()===i?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(i){return nW(this._cursor.peek(),i)?(this._cursor.advance(),!0):!1}_requireCharCode(i){let e=this._cursor.clone();if(!this._attemptCharCode(i))throw this._createError(rh(this._cursor.peek()),this._cursor.getSpan(e))}_attemptStr(i){let e=i.length;if(this._cursor.charsLeft()<e)return!1;let t=this._cursor.clone();for(let o=0;o<e;o++)if(!this._attemptCharCode(i.charCodeAt(o)))return this._cursor=t,!1;return!0}_attemptStrCaseInsensitive(i){for(let e=0;e<i.length;e++)if(!this._attemptCharCodeCaseInsensitive(i.charCodeAt(e)))return!1;return!0}_requireStr(i){let e=this._cursor.clone();if(!this._attemptStr(i))throw this._createError(rh(this._cursor.peek()),this._cursor.getSpan(e))}_attemptCharCodeUntilFn(i){for(;!i(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(i,e){let t=this._cursor.clone();if(this._attemptCharCodeUntilFn(i),this._cursor.diff(t)<e)throw this._createError(rh(this._cursor.peek()),this._cursor.getSpan(t))}_attemptUntilChar(i){for(;this._cursor.peek()!==i;)this._cursor.advance()}_readChar(){let i=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),i}_peekStr(i){let e=i.length;if(this._cursor.charsLeft()<e)return!1;let t=this._cursor.clone();for(let o=0;o<e;o++){if(t.peek()!==i.charCodeAt(o))return!1;t.advance()}return!0}_isBlockStart(){return this._cursor.peek()===nh&&YG.some(i=>this._peekStr(i))}_isLetStart(){return this._cursor.peek()===nh&&this._peekStr("@let")}_consumeEntity(i){this._beginToken(9);let e=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(iF)){let t=this._attemptCharCode(mF)||this._attemptCharCode(uH),o=this._cursor.clone();if(this._attemptCharCodeUntilFn(JG),this._cursor.peek()!=es){this._cursor.advance();let a=t?ET.HEX:ET.DEC;throw this._createError(KG(a,this._cursor.getChars(e)),this._cursor.getSpan())}let r=this._cursor.getChars(o);this._cursor.advance();try{let a=parseInt(r,t?16:10);this._endToken([String.fromCodePoint(a),this._cursor.getChars(e)])}catch{throw this._createError(R5(this._cursor.getChars(e)),this._cursor.getSpan())}}else{let t=this._cursor.clone();if(this._attemptCharCodeUntilFn(eW),this._cursor.peek()!=es)this._beginToken(i,e),this._cursor=t,this._endToken(["&"]);else{let o=this._cursor.getChars(t);this._cursor.advance();let r=Z_.hasOwnProperty(o)&&Z_[o];if(!r)throw this._createError(R5(o),this._cursor.getSpan(e));this._endToken([r,`&${o};`])}}}_consumeRawText(i,e){this._beginToken(i?6:7);let t=[];for(;;){let o=this._cursor.clone(),r=e();if(this._cursor=o,r)break;i&&this._cursor.peek()===S1?(this._endToken([this._processCarriageReturns(t.join(""))]),t.length=0,this._consumeEntity(6),this._beginToken(6)):t.push(this._readChar())}this._endToken([this._processCarriageReturns(t.join(""))])}_consumeComment(i){this._beginToken(10,i),this._requireCharCode(w1),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeCdata(i){this._beginToken(12,i),this._requireStr("CDATA["),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(i){this._beginToken(18,i);let e=this._cursor.clone();this._attemptUntilChar(Ss);let t=this._cursor.getChars(e);this._cursor.advance(),this._endToken([t])}_consumePrefixAndName(i){let e=this._cursor.clone(),t="";for(;this._cursor.peek()!==_c&&!ZG(this._cursor.peek());)this._cursor.advance();let o;this._cursor.peek()===_c?(t=this._cursor.getChars(e),this._cursor.advance(),o=this._cursor.clone()):o=e,this._requireCharCodeUntilFn(i,t===""?0:1);let r=this._cursor.getChars(o);return[t,r]}_consumeTagOpen(i){let e,t,o,r;try{if(this._selectorlessEnabled&&OC(this._cursor.peek()))r=this._consumeComponentOpenStart(i),[o,t,e]=r.parts,t&&(o+=`:${t}`),e&&(o+=`:${e}`),this._attemptCharCodeUntilFn(Ro);else{if(!mm(this._cursor.peek()))throw this._createError(rh(this._cursor.peek()),this._cursor.getSpan(i));r=this._consumeTagOpenStart(i),t=r.parts[0],e=o=r.parts[1],this._attemptCharCodeUntilFn(Ro)}for(;!z5(this._cursor.peek());)if(this._selectorlessEnabled&&this._cursor.peek()===nh){let c=this._cursor.clone(),p=c.clone();p.advance(),OC(p.peek())&&this._consumeDirective(c,p)}else this._consumeAttribute();r.type===33?this._consumeComponentOpenEnd():this._consumeTagOpenEnd()}catch(c){if(c instanceof sn){r?r.type=r.type===33?37:4:(this._beginToken(5,i),this._endToken(["<"]));return}throw c}let a=this._getTagDefinition(e).getContentType(t);a===gc.RAW_TEXT?this._consumeRawTextWithTagClose(r,o,!1):a===gc.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(r,o,!0)}_consumeRawTextWithTagClose(i,e,t){this._consumeRawText(t,()=>!this._attemptCharCode(_h)||!this._attemptCharCode(Qs)||(this._attemptCharCodeUntilFn(Ro),!this._attemptStrCaseInsensitive(e))?!1:(this._attemptCharCodeUntilFn(Ro),this._attemptCharCode(Ss))),this._beginToken(i.type===33?36:3),this._requireCharCodeUntilFn(o=>o===Ss,3),this._cursor.advance(),this._endToken(i.parts)}_consumeTagOpenStart(i){this._beginToken(0,i);let e=this._consumePrefixAndName(xp);return this._endToken(e)}_consumeComponentOpenStart(i){this._beginToken(33,i);let e=this._consumeComponentName();return this._endToken(e)}_consumeComponentName(){let i=this._cursor.clone();for(;B5(this._cursor.peek());)this._cursor.advance();let e=this._cursor.getChars(i),t="",o="";return this._cursor.peek()===_c&&(this._cursor.advance(),[t,o]=this._consumePrefixAndName(xp)),[e,t,o]}_consumeAttribute(){this._consumeAttributeName(),this._attemptCharCodeUntilFn(Ro),this._attemptCharCode(Hr)&&(this._attemptCharCodeUntilFn(Ro),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(Ro)}_consumeAttributeName(){let i=this._cursor.peek();if(i===V_||i===L_)throw this._createError(rh(i),this._cursor.getSpan());this._beginToken(14);let e;if(this._openDirectiveCount>0){let o=0;e=r=>{if(this._openDirectiveCount>0){if(r===Va)o++;else if(r===Cr){if(o===0)return!0;o--}}return xp(r)}}else if(i===bc){let o=0;e=r=>(r===bc?o++:r===_d&&o--,o<=0?xp(r):M1(r))}else e=xp;let t=this._consumePrefixAndName(e);this._endToken(t)}_consumeAttributeValue(){if(this._cursor.peek()===V_||this._cursor.peek()===L_){let i=this._cursor.peek();this._consumeQuote(i);let e=()=>this._cursor.peek()===i;this._consumeWithInterpolation(16,17,e,e),this._consumeQuote(i)}else{let i=()=>xp(this._cursor.peek());this._consumeWithInterpolation(16,17,i,i)}}_consumeQuote(i){this._beginToken(15),this._requireCharCode(i),this._endToken([String.fromCodePoint(i)])}_consumeTagOpenEnd(){let i=this._attemptCharCode(Qs)?2:1;this._beginToken(i),this._requireCharCode(Ss),this._endToken([])}_consumeComponentOpenEnd(){let i=this._attemptCharCode(Qs)?35:34;this._beginToken(i),this._requireCharCode(Ss),this._endToken([])}_consumeTagClose(i){if(this._selectorlessEnabled){let t=i.clone();for(;t.peek()!==Ss&&!OC(t.peek());)t.advance();if(OC(t.peek())){this._beginToken(36,i);let o=this._consumeComponentName();this._attemptCharCodeUntilFn(Ro),this._requireCharCode(Ss),this._endToken(o);return}}this._beginToken(3,i),this._attemptCharCodeUntilFn(Ro);let e=this._consumePrefixAndName(xp);this._attemptCharCodeUntilFn(Ro),this._requireCharCode(Ss),this._endToken(e)}_consumeExpansionFormStart(){this._beginToken(19),this._requireCharCode(Ys),this._endToken([]),this._expansionCaseStack.push(19),this._beginToken(7);let i=this._readUntil(va),e=this._processCarriageReturns(i);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([e]);else{let o=this._endToken([i]);e!==i&&this.nonNormalizedIcuExpressions.push(o)}this._requireCharCode(va),this._attemptCharCodeUntilFn(Ro),this._beginToken(7);let t=this._readUntil(va);this._endToken([t]),this._requireCharCode(va),this._attemptCharCodeUntilFn(Ro)}_consumeExpansionCaseStart(){this._beginToken(20);let i=this._readUntil(Ys).trim();this._endToken([i]),this._attemptCharCodeUntilFn(Ro),this._beginToken(21),this._requireCharCode(Ys),this._endToken([]),this._attemptCharCodeUntilFn(Ro),this._expansionCaseStack.push(21)}_consumeExpansionCaseEnd(){this._beginToken(22),this._requireCharCode(Ra),this._endToken([]),this._attemptCharCodeUntilFn(Ro),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(23),this._requireCharCode(Ra),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(i,e,t,o){this._beginToken(i);let r=[];for(;!t();){let a=this._cursor.clone();this._attemptStr(zg.start)?(this._endToken([this._processCarriageReturns(r.join(""))],a),r.length=0,this._consumeInterpolation(e,a,o),this._beginToken(i)):this._cursor.peek()===S1?(this._endToken([this._processCarriageReturns(r.join(""))]),r.length=0,this._consumeEntity(i),this._beginToken(i)):r.push(this._readChar())}this._inInterpolation=!1,this._endToken([this._processCarriageReturns(r.join(""))])}_consumeInterpolation(i,e,t){let o=[];this._beginToken(i,e),o.push(zg.start);let r=this._cursor.clone(),a=null,c=!1;for(;this._cursor.peek()!==Gr&&(t===null||!t());){let p=this._cursor.clone();if(this._isTagStart()){this._cursor=p,o.push(this._getProcessedChars(r,p)),this._endToken(o);return}if(a===null)if(this._attemptStr(zg.end)){o.push(this._getProcessedChars(r,p)),o.push(zg.end),this._endToken(o);return}else this._attemptStr("//")&&(c=!0);let u=this._cursor.peek();this._cursor.advance(),u===Np?this._cursor.advance():u===a?a=null:!c&&a===null&&t_(u)&&(a=u)}o.push(this._getProcessedChars(r,this._cursor)),this._endToken(o)}_consumeDirective(i,e){for(this._requireCharCode(nh),this._cursor.advance();B5(this._cursor.peek());)this._cursor.advance();this._beginToken(38,i);let t=this._cursor.getChars(e);if(this._endToken([t]),this._attemptCharCodeUntilFn(Ro),this._cursor.peek()===Va){for(this._openDirectiveCount++,this._beginToken(39),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(Ro);!z5(this._cursor.peek())&&this._cursor.peek()!==Cr;)this._consumeAttribute();if(this._attemptCharCodeUntilFn(Ro),this._openDirectiveCount--,this._cursor.peek()!==Cr){if(this._cursor.peek()===Ss||this._cursor.peek()===Qs)return;throw this._createError(rh(this._cursor.peek()),this._cursor.getSpan(i))}this._beginToken(40),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(Ro)}}_getProcessedChars(i,e){return this._processCarriageReturns(e.getChars(i))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===Gr||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===Ra&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._isLetStart()||this._cursor.peek()===Ra))}_isTagStart(){if(this._cursor.peek()===_h){let i=this._cursor.clone();i.advance();let e=i.peek();if(Qp<=e&&e<=l0||gm<=e&&e<=Bh||e===Qs||e===sT)return!0}return!1}_readUntil(i){let e=this._cursor.clone();return this._attemptUntilChar(i),this._cursor.getChars(e)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===21}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===19}isExpansionFormStart(){if(this._cursor.peek()!==Ys)return!1;let i=this._cursor.clone(),e=this._attemptStr(zg.start);return this._cursor=i,!e}};function Ro(n){return!B_(n)||n===Gr}function xp(n){return B_(n)||n===Ss||n===_h||n===Qs||n===V_||n===L_||n===Hr||n===Gr}function ZG(n){return(n<Qp||l0<n)&&(n<gm||Bh<n)&&(n<xE||n>rF)}function JG(n){return n===es||n===Gr||!_H(n)}function eW(n){return n===es||n===Gr||!(mm(n)||Xs(n))}function tW(n){return n!==Ra}function nW(n,i){return L5(n)===L5(i)}function L5(n){return n>=Qp&&n<=l0?n-Qp+gm:n}function iW(n){return mm(n)||Xs(n)||n===_m}function V5(n){return n!==es&&Ro(n)}function OC(n){return n===_m||n>=gm&&n<=Bh}function B5(n){return mm(n)||Xs(n)||n===_m}function z5(n){return n===Qs||n===Ss||n===_h||n===Gr}function oW(n){let i=[],e;for(let t=0;t<n.length;t++){let o=n[t];e&&e.type===5&&o.type===5||e&&e.type===16&&o.type===16?(e.parts[0]+=o.parts[0],e.sourceSpan.end=o.sourceSpan.end):(e=o,i.push(e))}return i}var $1=class n{state;file;input;end;constructor(i,e){if(i instanceof n){this.file=i.file,this.input=i.input,this.end=i.end;let t=i.state;this.state={peek:t.peek,offset:t.offset,line:t.line,column:t.column}}else{if(!e)throw new Error("Programming error: the range argument must be provided with a file argument.");this.file=i,this.input=i.content,this.end=e.endPos,this.state={peek:-1,offset:e.startPos,line:e.startLine,column:e.startCol}}}clone(){return new n(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(i){return this.state.offset-i.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(i,e){i=i||this;let t=i;if(e)for(;this.diff(i)>0&&e.indexOf(i.peek())!==-1;)t===i&&(i=i.clone()),i.advance();let o=this.locationFromCursor(i),r=this.locationFromCursor(this),a=t!==i?this.locationFromCursor(t):o;return new gn(o,r,a)}getChars(i){return this.input.substring(i.state.offset,this.state.offset)}charAt(i){return this.input.charCodeAt(i)}advanceState(i){if(i.offset>=this.end)throw this.state=i,new J_('Unexpected character "EOF"',this);let e=this.charAt(i.offset);e===Op?(i.line++,i.column=0):M1(e)||i.column++,i.offset++,this.updatePeek(i)}updatePeek(i){i.peek=i.offset>=this.end?Gr:this.charAt(i.offset)}locationFromCursor(i){return new z_(i.file,i.state.offset,i.state.line,i.state.column)}},PT=class n extends $1{internalState;constructor(i,e){i instanceof n?(super(i),this.internalState=K({},i.internalState)):(super(i,e),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new n(this)}getChars(i){let e=i.clone(),t="";for(;e.internalState.offset<this.internalState.offset;)t+=String.fromCodePoint(e.peek()),e.advance();return t}processEscapeSequence(){let i=()=>this.internalState.peek;if(i()===Np)if(this.internalState=K({},this.state),this.advanceState(this.internalState),i()===aF)this.state.peek=Op;else if(i()===sF)this.state.peek=bE;else if(i()===dF)this.state.peek=eF;else if(i()===lF)this.state.peek=CE;else if(i()===fH)this.state.peek=lH;else if(i()===yE)this.state.peek=tF;else if(i()===cF)if(this.advanceState(this.internalState),i()===Ys){this.advanceState(this.internalState);let e=this.clone(),t=0;for(;i()!==Ra;)this.advanceState(this.internalState),t++;this.state.peek=this.decodeHexDigits(e,t)}else{let e=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(e,4)}else if(i()===mF){this.advanceState(this.internalState);let e=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(e,2)}else if(h5(i())){let e="",t=0,o=this.clone();for(;h5(i())&&t<3;)o=this.clone(),e+=String.fromCodePoint(i()),this.advanceState(this.internalState),t++;this.state.peek=parseInt(e,8),this.internalState=o.internalState}else M1(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(i,e){let t=this.input.slice(i.internalState.offset,i.internalState.offset+e),o=parseInt(t,16);if(isNaN(o))throw i.state=i.internalState,new J_("Invalid hexadecimal escape sequence",i);return o}},J_=class extends Error{msg;cursor;constructor(i,e){super(i),this.msg=i,this.cursor=e,Object.setPrototypeOf(this,new.target.prototype)}},dr=class n extends sn{elementName;static create(i,e,t){return new n(i,e,t)}constructor(i,e,t){super(e,t),this.elementName=i}},H1=class{rootNodes;errors;constructor(i,e){this.rootNodes=i,this.errors=e}},rW=class{getTagDefinition;constructor(i){this.getTagDefinition=i}parse(i,e,t){let o=QG(i,e,this.getTagDefinition,t),r=new IT(o.tokens,this.getTagDefinition);return r.build(),new H1(r.rootNodes,[...o.errors,...r.errors])}},IT=class n{tokens;tagDefinitionResolver;_index=-1;_peek;_containerStack=[];rootNodes=[];errors=[];constructor(i,e){this.tokens=i,this.tagDefinitionResolver=e,this._advance()}build(){for(;this._peek.type!==41;)this._peek.type===0||this._peek.type===4?this._consumeElementStartTag(this._advance()):this._peek.type===3?this._consumeElementEndTag(this._advance()):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===19?this._consumeExpansion(this._advance()):this._peek.type===24?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===26?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===28?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===29?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===32?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._peek.type===33||this._peek.type===37?this._consumeComponentStartTag(this._advance()):this._peek.type===36?this._consumeComponentEndTag(this._advance()):this._advance();for(let i of this._containerStack)i instanceof Ks&&this.errors.push(dr.create(i.name,i.sourceSpan,`Unclosed block "${i.name}"`))}_advance(){let i=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],i}_advanceIf(i){return this._peek.type===i?this._advance():null}_consumeCdata(i){this._consumeText(this._advance()),this._advanceIf(13)}_consumeComment(i){let e=this._advanceIf(7),t=this._advanceIf(11),o=e!=null?e.parts[0].trim():null,r=t==null?i.sourceSpan:new gn(i.sourceSpan.start,t.sourceSpan.end,i.sourceSpan.fullStart);this._addToParent(new Y_(o,r))}_consumeExpansion(i){let e=this._advance(),t=this._advance(),o=[];for(;this._peek.type===20;){let a=this._parseExpansionCase();if(!a)return;o.push(a)}if(this._peek.type!==23){this.errors.push(dr.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));return}let r=new gn(i.sourceSpan.start,this._peek.sourceSpan.end,i.sourceSpan.fullStart);this._addToParent(new Fp(e.parts[0],t.parts[0],o,r,e.sourceSpan)),this._advance()}_parseExpansionCase(){let i=this._advance();if(this._peek.type!==21)return this.errors.push(dr.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;let e=this._advance(),t=this._collectExpansionExpTokens(e);if(!t)return null;let o=this._advance();t.push({type:41,parts:[],sourceSpan:o.sourceSpan});let r=new n(t,this.tagDefinitionResolver);if(r.build(),r.errors.length>0)return this.errors=this.errors.concat(r.errors),null;let a=new gn(i.sourceSpan.start,o.sourceSpan.end,i.sourceSpan.fullStart),c=new gn(e.sourceSpan.start,o.sourceSpan.end,e.sourceSpan.fullStart);return new B1(i.parts[0],r.rootNodes,a,i.sourceSpan,c)}_collectExpansionExpTokens(i){let e=[],t=[21];for(;;){if((this._peek.type===19||this._peek.type===21)&&t.push(this._peek.type),this._peek.type===22)if(j5(t,21)){if(t.pop(),t.length===0)return e}else return this.errors.push(dr.create(null,i.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===23)if(j5(t,19))t.pop();else return this.errors.push(dr.create(null,i.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===41)return this.errors.push(dr.create(null,i.sourceSpan,"Invalid ICU message. Missing '}'.")),null;e.push(this._advance())}}_consumeText(i){let e=[i],t=i.sourceSpan,o=i.parts[0];if(o.length>0&&o[0]===`
`){let r=this._getContainer();r!=null&&r.children.length===0&&this._getTagDefinition(r)?.ignoreFirstLf&&(o=o.substring(1),e[0]={type:i.type,sourceSpan:i.sourceSpan,parts:[o]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)i=this._advance(),e.push(i),i.type===8?o+=i.parts.join("").replace(/&([^;]+);/g,$5):i.type===9?o+=i.parts[0]:o+=i.parts.join("");if(o.length>0){let r=i.sourceSpan;this._addToParent(new Jp(o,new gn(t.start,r.end,t.fullStart,t.details),e))}}_closeVoidElement(){let i=this._getContainer();i!==null&&this._getTagDefinition(i)?.isVoid&&this._containerStack.pop()}_consumeElementStartTag(i){let e=[],t=[];this._consumeAttributesAndDirectives(e,t);let o=this._getElementFullName(i,this._getClosestElementLikeParent()),r=this._getTagDefinition(o),a=!1;this._peek.type===2?(this._advance(),a=!0,r?.canSelfClose||Kk(o)!==null||r?.isVoid||this.errors.push(dr.create(o,i.sourceSpan,`Only void, custom and foreign elements can be self closed "${i.parts[1]}"`))):this._peek.type===1&&(this._advance(),a=!1);let c=this._peek.sourceSpan.fullStart,p=new gn(i.sourceSpan.start,c,i.sourceSpan.fullStart),u=new gn(i.sourceSpan.start,c,i.sourceSpan.fullStart),h=new qs(o,e,t,[],a,p,u,void 0,r?.isVoid??!1),_=this._getContainer(),S=_!==null&&!!this._getTagDefinition(_)?.isClosedByChild(h.name);this._pushContainer(h,S),a?this._popContainer(o,qs,p):i.type===4&&(this._popContainer(o,qs,null),this.errors.push(dr.create(o,p,`Opening tag "${o}" not terminated.`)))}_consumeComponentStartTag(i){let e=i.parts[0],t=[],o=[];this._consumeAttributesAndDirectives(t,o);let r=this._getClosestElementLikeParent(),a=this._getComponentTagName(i,r),c=this._getComponentFullName(i,r),p=this._peek.type===35;this._advance();let u=this._peek.sourceSpan.fullStart,h=new gn(i.sourceSpan.start,u,i.sourceSpan.fullStart),_=new gn(i.sourceSpan.start,u,i.sourceSpan.fullStart),S=new Fa(e,a,c,t,o,[],p,h,_,void 0),x=this._getContainer(),b=x!==null&&S.tagName!==null&&!!this._getTagDefinition(x)?.isClosedByChild(S.tagName);this._pushContainer(S,b),p?this._popContainer(c,Fa,h):i.type===37&&(this._popContainer(c,Fa,null),this.errors.push(dr.create(c,h,`Opening tag "${c}" not terminated.`)))}_consumeAttributesAndDirectives(i,e){for(;this._peek.type===14||this._peek.type===38;)this._peek.type===38?e.push(this._consumeDirective(this._peek)):i.push(this._consumeAttr(this._advance()))}_consumeComponentEndTag(i){let e=this._getComponentFullName(i,this._getClosestElementLikeParent());if(!this._popContainer(e,Fa,i.sourceSpan)){let t=this._containerStack[this._containerStack.length-1],o;t instanceof Fa&&t.componentName===i.parts[0]?o=`, did you mean "${t.fullName}"?`:o=". It may happen when the tag has already been closed by another tag.";let r=`Unexpected closing tag "${e}"${o}`;this.errors.push(dr.create(e,i.sourceSpan,r))}}_getTagDefinition(i){return typeof i=="string"?this.tagDefinitionResolver(i):i instanceof qs?this.tagDefinitionResolver(i.name):i instanceof Fa&&i.tagName!==null?this.tagDefinitionResolver(i.tagName):null}_pushContainer(i,e){e&&this._containerStack.pop(),this._addToParent(i),this._containerStack.push(i)}_consumeElementEndTag(i){let e=this._getElementFullName(i,this._getClosestElementLikeParent());if(this._getTagDefinition(e)?.isVoid)this.errors.push(dr.create(e,i.sourceSpan,`Void elements do not have end tags "${i.parts[1]}"`));else if(!this._popContainer(e,qs,i.sourceSpan)){let t=`Unexpected closing tag "${e}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(dr.create(e,i.sourceSpan,t))}}_popContainer(i,e,t){let o=!1;for(let r=this._containerStack.length-1;r>=0;r--){let a=this._containerStack[r];if(((a instanceof Fa?a.fullName:a.name)===i||i===null)&&a instanceof e)return a.endSourceSpan=t,a.sourceSpan.end=t!==null?t.end:a.sourceSpan.end,this._containerStack.splice(r,this._containerStack.length-r),!o;(a instanceof Ks||!this._getTagDefinition(a)?.closedByParent)&&(o=!0)}return!1}_consumeAttr(i){let e=UC(i.parts[0],i.parts[1]),t=i.sourceSpan.end;this._peek.type===15&&this._advance();let o="",r=[],a,c;if(this._peek.type===16)for(a=this._peek.sourceSpan,c=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let h=this._advance();r.push(h),h.type===17?o+=h.parts.join("").replace(/&([^;]+);/g,$5):h.type===9?o+=h.parts[0]:o+=h.parts.join(""),c=t=h.sourceSpan.end}this._peek.type===15&&(t=this._advance().sourceSpan.end);let u=a&&c&&new gn(a.start,c,a.fullStart);return new MT(e,o,new gn(i.sourceSpan.start,t,i.sourceSpan.fullStart),i.sourceSpan,u,r.length>0?r:void 0,void 0)}_consumeDirective(i){let e=[],t=i.sourceSpan.end,o=null;if(this._advance(),this._peek.type===39){for(t=this._peek.sourceSpan.end,this._advance();this._peek.type===14;)e.push(this._consumeAttr(this._advance()));this._peek.type===40?(o=this._peek.sourceSpan,this._advance()):this.errors.push(dr.create(null,i.sourceSpan,"Unterminated directive definition"))}let r=new gn(i.sourceSpan.start,t,i.sourceSpan.fullStart),a=new gn(r.start,o===null?i.sourceSpan.end:o.end,r.fullStart);return new kT(i.parts[0],e,a,r,o)}_consumeBlockOpen(i){let e=[];for(;this._peek.type===27;){let c=this._advance();e.push(new z1(c.parts[0],c.sourceSpan))}this._peek.type===25&&this._advance();let t=this._peek.sourceSpan.fullStart,o=new gn(i.sourceSpan.start,t,i.sourceSpan.fullStart),r=new gn(i.sourceSpan.start,t,i.sourceSpan.fullStart),a=new Ks(i.parts[0],e,[],o,i.sourceSpan,r);this._pushContainer(a,!1)}_consumeBlockClose(i){let e=this._containerStack.length,t=this._containerStack[e-1];if(!this._popContainer(null,Ks,i.sourceSpan)){if(this._containerStack.length<e){let o=t instanceof Fa?t.fullName:t.name;this.errors.push(dr.create(null,i.sourceSpan,`Unexpected closing block. The block may have been closed earlier. Did you forget to close the <${o}> element? If you meant to write the \`}\` character, you should use the "&#125;" HTML entity instead.`));return}this.errors.push(dr.create(null,i.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the `}` character, you should use the "&#125;" HTML entity instead.'))}}_consumeIncompleteBlock(i){let e=[];for(;this._peek.type===27;){let c=this._advance();e.push(new z1(c.parts[0],c.sourceSpan))}let t=this._peek.sourceSpan.fullStart,o=new gn(i.sourceSpan.start,t,i.sourceSpan.fullStart),r=new gn(i.sourceSpan.start,t,i.sourceSpan.fullStart),a=new Ks(i.parts[0],e,[],o,i.sourceSpan,r);this._pushContainer(a,!1),this._popContainer(null,Ks,null),this.errors.push(dr.create(i.parts[0],o,`Incomplete block "${i.parts[0]}". If you meant to write the @ character, you should use the "&#64;" HTML entity instead.`))}_consumeLet(i){let e=i.parts[0],t,o;if(this._peek.type!==30){this.errors.push(dr.create(i.parts[0],i.sourceSpan,`Invalid @let declaration "${e}". Declaration must have a value.`));return}else t=this._advance();if(this._peek.type!==31){this.errors.push(dr.create(i.parts[0],i.sourceSpan,`Unterminated @let declaration "${e}". Declaration must be terminated with a semicolon.`));return}else o=this._advance();let r=o.sourceSpan.fullStart,a=new gn(i.sourceSpan.start,r,i.sourceSpan.fullStart),c=i.sourceSpan.toString().lastIndexOf(e),p=i.sourceSpan.start.moveBy(c),u=new gn(p,i.sourceSpan.end),h=new j1(e,t.parts[0],a,u,t.sourceSpan);this._addToParent(h)}_consumeIncompleteLet(i){let e=i.parts[0]??"",t=e?` "${e}"`:"";if(e.length>0){let o=i.sourceSpan.toString().lastIndexOf(e),r=i.sourceSpan.start.moveBy(o),a=new gn(r,i.sourceSpan.end),c=new gn(i.sourceSpan.start,i.sourceSpan.start.moveBy(0)),p=new j1(e,"",i.sourceSpan,a,c);this._addToParent(p)}this.errors.push(dr.create(i.parts[0],i.sourceSpan,`Incomplete @let declaration${t}. @let declarations must be written as \`@let <name> = <value>;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestElementLikeParent(){for(let i=this._containerStack.length-1;i>-1;i--){let e=this._containerStack[i];if(e instanceof qs||e instanceof Fa)return e}return null}_addToParent(i){let e=this._getContainer();e===null?this.rootNodes.push(i):e.children.push(i)}_getElementFullName(i,e){let t=this._getPrefix(i,e);return UC(t,i.parts[1])}_getComponentFullName(i,e){let t=i.parts[0],o=this._getComponentTagName(i,e);return o===null?t:o.startsWith(":")?t+o:`${t}:${o}`}_getComponentTagName(i,e){let t=this._getPrefix(i,e),o=i.parts[2];return!t&&!o?null:!t&&o?o:UC(t,o||"ng-component")}_getPrefix(i,e){let t,o;if(i.type===33||i.type===37||i.type===36?(t=i.parts[1],o=i.parts[2]):(t=i.parts[0],o=i.parts[1]),t=t||this._getTagDefinition(o)?.implicitNamespacePrefix||"",!t&&e){let r=e instanceof qs?e.name:e.tagName;if(r!==null){let a=Ll(r)[1],c=this._getTagDefinition(a);c!==null&&!c.preventNamespaceInheritance&&(t=Kk(r))}}return t}};function j5(n,i){return n.length>0&&n[n.length-1]===i}function $5(n,i){return Z_[i]!==void 0?Z_[i]||n:/^#x[a-f0-9]+$/i.test(i)?String.fromCodePoint(parseInt(i.slice(2),16)):/^#\d+$/.test(i)?String.fromCodePoint(parseInt(i.slice(1),10)):n}var NF="ngPreserveWhitespaces",H5=new Set(["pre","template","textarea","script","style"]),FF=` \f
\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,aW=new RegExp(`[^${FF}]`),sW=new RegExp(`[${FF}]{2,}`,"g");function U5(n){return n.some(i=>i.name===NF)}function RF(n){return n.replace(new RegExp(OF,"g")," ")}var U1=class{preserveSignificantWhitespace;originalNodeMap;requireContext;icuExpansionDepth=0;constructor(i,e,t=!0){this.preserveSignificantWhitespace=i,this.originalNodeMap=e,this.requireContext=t}visitElement(i,e){if(H5.has(i.name)||U5(i.attrs)){let o=new qs(i.name,uc(this,i.attrs),uc(this,i.directives),i.children,i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.isVoid,i.i18n);return this.originalNodeMap?.set(o,i),o}let t=new qs(i.name,i.attrs,i.directives,uc(this,i.children),i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.isVoid,i.i18n);return this.originalNodeMap?.set(t,i),t}visitAttribute(i,e){return i.name!==NF?i:null}visitText(i,e){let t=i.value.match(aW),o=e&&(e.prev instanceof Fp||e.next instanceof Fp);if(this.icuExpansionDepth>0&&this.preserveSignificantWhitespace)return i;if(t||o){let a=i.tokens.map(h=>h.type===5?mW(h):h);if(!this.preserveSignificantWhitespace&&a.length>0){let h=a[0];a.splice(0,1,lW(h,e));let _=a[a.length-1];a.splice(a.length-1,1,cW(_,e))}let c=VF(i.value),p=this.preserveSignificantWhitespace?c:dW(c,e),u=new Jp(p,i.sourceSpan,a,i.i18n);return this.originalNodeMap?.set(u,i),u}return null}visitComment(i,e){return i}visitExpansion(i,e){this.icuExpansionDepth++;let t;try{t=new Fp(i.switchValue,i.type,uc(this,i.cases),i.sourceSpan,i.switchValueSourceSpan,i.i18n)}finally{this.icuExpansionDepth--}return this.originalNodeMap?.set(t,i),t}visitExpansionCase(i,e){let t=new B1(i.value,uc(this,i.expression),i.sourceSpan,i.valueSourceSpan,i.expSourceSpan);return this.originalNodeMap?.set(t,i),t}visitBlock(i,e){let t=new Ks(i.name,i.parameters,uc(this,i.children),i.sourceSpan,i.nameSpan,i.startSourceSpan,i.endSourceSpan);return this.originalNodeMap?.set(t,i),t}visitBlockParameter(i,e){return i}visitLetDeclaration(i,e){return i}visitComponent(i,e){if(i.tagName&&H5.has(i.tagName)||U5(i.attrs)){let o=new Fa(i.componentName,i.tagName,i.fullName,uc(this,i.attrs),uc(this,i.directives),i.children,i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.i18n);return this.originalNodeMap?.set(o,i),o}let t=new Fa(i.componentName,i.tagName,i.fullName,i.attrs,i.directives,uc(this,i.children),i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.i18n);return this.originalNodeMap?.set(t,i),t}visitDirective(i,e){return i}visit(i,e){if(this.requireContext&&!e)throw new Error("WhitespaceVisitor requires context. Visit via `visitAllWithSiblings` to get this context.");return!1}};function lW(n,i){return n.type!==5||!!i?.prev?n:LF(n,t=>t.trimStart())}function cW(n,i){return n.type!==5||!!i?.next?n:LF(n,t=>t.trimEnd())}function dW(n,i){let e=!i?.prev,t=!i?.next,o=e?n.trimStart():n;return t?o.trimEnd():o}function mW({type:n,parts:i,sourceSpan:e}){return{type:n,parts:[VF(i[0])],sourceSpan:e}}function LF({type:n,parts:i,sourceSpan:e},t){return{type:n,parts:[t(i[0])],sourceSpan:e}}function VF(n){return RF(n).replace(sW," ")}function uc(n,i){let e=[];return i.forEach((t,o)=>{let r={prev:i[o-1],next:i[o+1]},a=t.visit(n,r);a&&e.push(a)}),e}var un=(function(n){return n[n.Character=0]="Character",n[n.Identifier=1]="Identifier",n[n.PrivateIdentifier=2]="PrivateIdentifier",n[n.Keyword=3]="Keyword",n[n.String=4]="String",n[n.Operator=5]="Operator",n[n.Number=6]="Number",n[n.RegExpBody=7]="RegExpBody",n[n.RegExpFlags=8]="RegExpFlags",n[n.Error=9]="Error",n})(un||{}),Rp=(function(n){return n[n.Plain=0]="Plain",n[n.TemplateLiteralPart=1]="TemplateLiteralPart",n[n.TemplateLiteralEnd=2]="TemplateLiteralEnd",n})(Rp||{}),pW=["var","let","as","null","undefined","true","false","if","else","this","typeof","void","in","instanceof"],e0=class{tokenize(i){return new AT(i).scan()}},As=class{index;end;type;numValue;strValue;constructor(i,e,t,o,r){this.index=i,this.end=e,this.type=t,this.numValue=o,this.strValue=r}isCharacter(i){return this.type===un.Character&&this.numValue===i}isNumber(){return this.type===un.Number}isString(){return this.type===un.String}isOperator(i){return this.type===un.Operator&&this.strValue===i}isIdentifier(){return this.type===un.Identifier}isPrivateIdentifier(){return this.type===un.PrivateIdentifier}isKeyword(){return this.type===un.Keyword}isKeywordLet(){return this.type===un.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===un.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===un.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===un.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===un.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===un.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===un.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===un.Keyword&&this.strValue==="typeof"}isKeywordVoid(){return this.type===un.Keyword&&this.strValue==="void"}isKeywordIn(){return this.type===un.Keyword&&this.strValue==="in"}isKeywordInstanceOf(){return this.type===un.Keyword&&this.strValue==="instanceof"}isError(){return this.type===un.Error}isRegExpBody(){return this.type===un.RegExpBody}isRegExpFlags(){return this.type===un.RegExpFlags}toNumber(){return this.type===un.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===Rp.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===Rp.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}toString(){switch(this.type){case un.Character:case un.Identifier:case un.Keyword:case un.Operator:case un.PrivateIdentifier:case un.String:case un.Error:case un.RegExpBody:case un.RegExpFlags:return this.strValue;case un.Number:return this.numValue.toString();default:return null}}},n_=class extends As{kind;constructor(i,e,t,o){super(i,e,un.String,0,t),this.kind=o}};function jg(n,i,e){return new As(n,i,un.Character,e,String.fromCharCode(e))}function uW(n,i,e){return new As(n,i,un.Identifier,0,e)}function hW(n,i,e){return new As(n,i,un.PrivateIdentifier,0,e)}function fW(n,i,e){return new As(n,i,un.Keyword,0,e)}function Xd(n,i,e){return new As(n,i,un.Operator,0,e)}function gW(n,i,e){return new As(n,i,un.Number,e,"")}function _W(n,i,e){return new As(n,i,un.Error,0,e)}function vW(n,i,e){return new As(n,i,un.RegExpBody,0,e)}function CW(n,i,e){return new As(n,i,un.RegExpFlags,0,e)}var $g=new As(-1,-1,un.Character,0,""),AT=class{input;tokens=[];length;peek=0;index=-1;braceStack=[];constructor(i){this.input=i,this.length=i.length,this.advance()}scan(){let i=this.scanToken();for(;i!==null;)this.tokens.push(i),i=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?Gr:this.input.charCodeAt(this.index)}scanToken(){let i=this.input,e=this.length,t=this.peek,o=this.index;for(;t<=nF;)if(++o>=e){t=Gr;break}else t=i.charCodeAt(o);if(this.peek=t,this.index=o,o>=e)return null;if(G5(t))return this.scanIdentifier();if(Xs(t))return this.scanNumber(o);let r=o;switch(t){case yp:return this.advance(),Xs(this.peek)?this.scanNumber(r):this.peek!==yp?jg(r,this.index,yp):(this.advance(),this.peek===yp?(this.advance(),Xd(r,this.index,"...")):this.error(`Unexpected character [${String.fromCharCode(t)}]`,0));case Va:case Cr:case bc:case _d:case va:case _c:case es:return this.scanCharacter(r,t);case Ys:return this.scanOpenBrace(r,t);case Ra:return this.scanCloseBrace(r,t);case V_:case L_:return this.scanString();case lT:return this.advance(),this.scanTemplateLiteralPart(r);case iF:return this.scanPrivateIdentifier();case oF:return this.scanComplexOperator(r,"+",Hr,"=");case w1:return this.scanComplexOperator(r,"-",Hr,"=");case Qs:return this.isStartOfRegex()?this.scanRegex(o):this.scanComplexOperator(r,"/",Hr,"=");case cH:return this.scanComplexOperator(r,"%",Hr,"=");case hH:return this.scanOperator(r,"^");case m5:return this.scanStar(r);case p5:return this.scanQuestion(r);case _h:case Ss:return this.scanComplexOperator(r,String.fromCharCode(t),Hr,"=");case sT:return this.scanComplexOperator(r,"!",Hr,"=",Hr,"=");case Hr:return this.scanEquals(r);case S1:return this.scanComplexOperator(r,"&",S1,"&",Hr,"=");case u5:return this.scanComplexOperator(r,"|",u5,"|",Hr,"=");case pF:for(;B_(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(t)}]`,0)}scanCharacter(i,e){return this.advance(),jg(i,this.index,e)}scanOperator(i,e){return this.advance(),Xd(i,this.index,e)}scanOpenBrace(i,e){return this.braceStack.push("expression"),this.advance(),jg(i,this.index,e)}scanCloseBrace(i,e){return this.advance(),this.braceStack.pop()==="interpolation"?(this.tokens.push(jg(i,this.index,Ra)),this.scanTemplateLiteralPart(this.index)):jg(i,this.index,e)}scanComplexOperator(i,e,t,o,r,a){this.advance();let c=e;return this.peek==t&&(this.advance(),c+=o),r!=null&&this.peek==r&&(this.advance(),c+=a),Xd(i,this.index,c)}scanEquals(i){this.advance();let e="=";if(this.peek===Hr)this.advance(),e+="=";else if(this.peek===Ss)return this.advance(),e+=">",Xd(i,this.index,e);return this.peek===Hr&&(this.advance(),e+="="),Xd(i,this.index,e)}scanIdentifier(){let i=this.index;for(this.advance();W5(this.peek);)this.advance();let e=this.input.substring(i,this.index);return pW.indexOf(e)>-1?fW(i,this.index,e):uW(i,this.index,e)}scanPrivateIdentifier(){let i=this.index;if(this.advance(),!G5(this.peek))return this.error("Invalid character [#]",-1);for(;W5(this.peek);)this.advance();let e=this.input.substring(i,this.index);return hW(i,this.index,e)}scanNumber(i){let e=this.index===i,t=!1;for(this.advance();;){if(!Xs(this.peek))if(this.peek===_m){if(!Xs(this.input.charCodeAt(this.index-1))||!Xs(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);t=!0}else if(this.peek===yp)e=!1;else if(bW(this.peek)){if(this.advance(),xW(this.peek)&&this.advance(),!Xs(this.peek))return this.error("Invalid exponent",-1);e=!1}else break;this.advance()}let o=this.input.substring(i,this.index);t&&(o=o.replace(/_/g,""));let r=e?SW(o):parseFloat(o);return gW(i,this.index,r)}scanString(){let i=this.index,e=this.peek;this.advance();let t="",o=this.index,r=this.input;for(;this.peek!=e;)if(this.peek==Np){let c=this.scanStringBackslash(t,o);if(typeof c!="string")return c;t=c,o=this.index}else{if(this.peek==Gr)return this.error("Unterminated quote",0);this.advance()}let a=r.substring(o,this.index);return this.advance(),new n_(i,this.index,t+a,Rp.Plain)}scanQuestion(i){this.advance();let e="?";return this.peek===p5?(e+="?",this.advance(),this.peek===Hr&&(e+="=",this.advance())):this.peek===yp&&(e+=".",this.advance()),Xd(i,this.index,e)}scanTemplateLiteralPart(i){let e="",t=this.index;for(;this.peek!==lT;)if(this.peek===Np){let r=this.scanStringBackslash(e,t);if(typeof r!="string")return r;e=r,t=this.index}else if(this.peek===ob){let r=this.index;if(this.advance(),this.peek===Ys)return this.braceStack.push("interpolation"),this.tokens.push(new n_(i,r,e+this.input.substring(t,r),Rp.TemplateLiteralPart)),this.advance(),Xd(r,this.index,this.input.substring(r,this.index))}else{if(this.peek===Gr)return this.error("Unterminated template literal",0);this.advance()}let o=this.input.substring(t,this.index);return this.advance(),new n_(i,this.index,e+o,Rp.TemplateLiteralEnd)}error(i,e){let t=this.index+e;return _W(t,this.index,`Lexer Error: ${i} at column ${t} in expression [${this.input}]`)}scanStringBackslash(i,e){i+=this.input.substring(e,this.index);let t;if(this.advance(),this.peek===cF){let o=this.input.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(o))t=parseInt(o,16);else return this.error(`Invalid unicode escape [\\u${o}]`,0);for(let r=0;r<5;r++)this.advance()}else t=yW(this.peek),this.advance();return i+=String.fromCharCode(t),i}scanStar(i){this.advance();let e="*";return this.peek===m5?(e+="*",this.advance(),this.peek===Hr&&(e+="=",this.advance())):this.peek===Hr&&(e+="=",this.advance()),Xd(i,this.index,e)}isStartOfRegex(){if(this.tokens.length===0)return!0;let i=this.tokens[this.tokens.length-1];if(i.isOperator("!")){let e=this.tokens.length>1?this.tokens[this.tokens.length-2]:null;return e===null||e.type!==un.Identifier&&!e.isCharacter(Cr)&&!e.isCharacter(_d)}return i.type===un.Operator||i.isCharacter(Va)||i.isCharacter(bc)||i.isCharacter(va)||i.isCharacter(_c)}scanRegex(i){this.advance();let e=this.index,t=!1,o=!1;for(;;){let p=this.peek;if(p===Gr)return this.error("Unterminated regular expression",0);if(t)t=!1;else if(p===Np)t=!0;else if(p===bc)o=!0;else if(p===_d)o=!1;else if(p===Qs&&!o)break;this.advance()}let r=this.input.substring(e,this.index);this.advance();let a=vW(i,this.index,r),c=this.scanRegexFlags(this.index);return c!==null?(this.tokens.push(a),c):a}scanRegexFlags(i){if(!mm(this.peek))return null;for(;mm(this.peek);)this.advance();return CW(i,this.index,this.input.substring(i,this.index))}};function G5(n){return Qp<=n&&n<=l0||gm<=n&&n<=Bh||n==_m||n==ob}function W5(n){return mm(n)||Xs(n)||n==_m||n==ob}function bW(n){return n==gH||n==mH}function xW(n){return n==w1||n==oF}function yW(n){switch(n){case aF:return Op;case yE:return tF;case sF:return bE;case lF:return CE;case dF:return eF;default:return n}}function SW(n){let i=parseInt(n);if(isNaN(i))throw new Error("Invalid integer literal when parsing "+n);return i}var OT=class{strings;expressions;offsets;constructor(i,e,t){this.strings=i,this.expressions=e,this.offsets=t}},NT=class{templateBindings;warnings;errors;constructor(i,e,t){this.templateBindings=i,this.warnings=e,this.errors=t}};function em(n){return n.start.toString()||"(unknown)"}var G1=class{_lexer;_supportsDirectPipeReferences;constructor(i,e=!1){this._lexer=i,this._supportsDirectPipeReferences=e}parseAction(i,e,t){let o=[];this._checkNoInterpolation(o,i,e);let{stripped:r}=this._stripComments(i),a=this._lexer.tokenize(r),c=new kp(i,e,t,a,1,o,0,this._supportsDirectPipeReferences).parseChain();return new ts(c,i,em(e),t,o)}parseBinding(i,e,t){let o=[],r=this._parseBindingAst(i,e,t,o);return new ts(r,i,em(e),t,o)}checkSimpleExpression(i){let e=new FT;return i.visit(e),e.errors}parseSimpleBinding(i,e,t){let o=[],r=this._parseBindingAst(i,e,t,o),a=this.checkSimpleExpression(r);return a.length>0&&o.push(hh(`Host binding expression cannot contain ${a.join(" ")}`,i,"",e)),new ts(r,i,em(e),t,o)}_parseBindingAst(i,e,t,o){this._checkNoInterpolation(o,i,e);let{stripped:r}=this._stripComments(i),a=this._lexer.tokenize(r);return new kp(i,e,t,a,0,o,0,this._supportsDirectPipeReferences).parseChain()}parseTemplateBindings(i,e,t,o,r){let a=this._lexer.tokenize(e),c=[];return new kp(e,t,r,a,0,c,0,this._supportsDirectPipeReferences).parseTemplateBindings({source:i,span:new Ms(o,o+i.length)})}parseInterpolation(i,e,t,o){let r=[],{strings:a,expressions:c,offsets:p}=this.splitInterpolation(i,e,r,o);if(c.length===0)return null;let u=[];for(let h=0;h<c.length;++h){let _=o?.[h*2+1]?.sourceSpan,S=c[h].text,{stripped:x,hasComments:b}=this._stripComments(S),M=this._lexer.tokenize(x);if(b&&x.trim().length===0&&M.length===0){r.push(hh("Interpolation expression cannot only contain a comment",i,`at column ${c[h].start} in`,e));continue}let w=new kp(_?S:i,_||e,t,M,0,r,p[h],this._supportsDirectPipeReferences).parseChain();u.push(w)}return this.createInterpolationAst(a.map(h=>h.text),u,i,em(e),t,r)}parseInterpolationExpression(i,e,t){let{stripped:o}=this._stripComments(i),r=this._lexer.tokenize(o),a=[],c=new kp(i,e,t,r,0,a,0,this._supportsDirectPipeReferences).parseChain(),p=["",""];return this.createInterpolationAst(p,[c],i,em(e),t,a)}createInterpolationAst(i,e,t,o,r,a){let c=new Up(0,t.length),p=new a0(c,c.toAbsolute(r),i,e);return new ts(p,t,o,r,a)}splitInterpolation(i,e,t,o){let r=[],a=[],c=[],p=o?wW(o):null,u=0,h=!1,_=!1,S="{{",x="}}";for(;u<i.length;)if(h){let b=u,M=b+S.length,w=this._getInterpolationEndIndex(i,x,M);if(w===-1){h=!1,_=!0;break}let y=w+x.length,E=i.substring(M,w);E.trim().length===0&&t.push(hh("Blank expressions are not allowed in interpolated strings",i,`at column ${u} in`,e)),a.push({text:E,start:b,end:y});let D=(p?.get(b)??b)+S.length;c.push(D),u=y,h=!1}else{let b=u;u=i.indexOf(S,u),u===-1&&(u=i.length);let M=i.substring(b,u);r.push({text:M,start:b,end:u}),h=!0}if(!h)if(_){let b=r[r.length-1];b.text+=i.substring(u),b.end=i.length}else r.push({text:i.substring(u),start:u,end:i.length});return new OT(r,a,c)}wrapLiteralPrimitive(i,e,t){let o=new Up(0,i==null?0:i.length);return new ts(new Ja(o,o.toAbsolute(t),i),i,typeof e=="string"?e:em(e),t,[])}_stripComments(i){let e=this._commentStart(i);return e!=null?{stripped:i.substring(0,e),hasComments:!0}:{stripped:i,hasComments:!1}}_commentStart(i){let e=null;for(let t=0;t<i.length-1;t++){let o=i.charCodeAt(t),r=i.charCodeAt(t+1);if(o===Qs&&r==Qs&&e==null)return t;e===o?e=null:e==null&&t_(o)&&(e=o)}return null}_checkNoInterpolation(i,e,t){let o=-1,r=-1;for(let a of this._forEachUnquotedChar(e,0))if(o===-1)e.startsWith("{{")&&(o=a);else if(r=this._getInterpolationEndIndex(e,"}}",a),r>-1)break;o>-1&&r>-1&&i.push(hh("Got interpolation ({{}}) where expression was expected",e,`at column ${o} in`,t))}_getInterpolationEndIndex(i,e,t){for(let o of this._forEachUnquotedChar(i,t)){if(i.startsWith(e,o))return o;if(i.startsWith("//",o))return i.indexOf(e,o)}return-1}*_forEachUnquotedChar(i,e){let t=null,o=0;for(let r=e;r<i.length;r++){let a=i[r];t_(i.charCodeAt(r))&&(t===null||t===a)&&o%2===0?t=t===null?a:null:t===null&&(yield r),o=a==="\\"?o+1:0}}},Yg=(function(n){return n[n.None=0]="None",n[n.Writable=1]="Writable",n})(Yg||{}),q5=new Set(["d","g","i","m","s","u","v","y"]),kp=class{input;parseSourceSpan;absoluteOffset;tokens;parseFlags;errors;offset;supportsDirectPipeReferences;rparensExpected=0;rbracketsExpected=0;rbracesExpected=0;context=Yg.None;sourceSpanCache=new Map;index=0;constructor(i,e,t,o,r,a,c,p){this.input=i,this.parseSourceSpan=e,this.absoluteOffset=t,this.tokens=o,this.parseFlags=r,this.errors=a,this.offset=c,this.supportsDirectPipeReferences=p}peek(i){let e=this.index+i;return e<this.tokens.length?this.tokens[e]:$g}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(i,e){let t=this.currentEndIndex;if(e!==void 0&&e>this.currentEndIndex&&(t=e),i>t){let o=t;t=i,i=o}return new Up(i,t)}sourceSpan(i,e){let t=`${i}@${this.inputIndex}:${e}`;return this.sourceSpanCache.has(t)||this.sourceSpanCache.set(t,this.span(i,e).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(t)}advance(){this.index++}withContext(i,e){this.context|=i;let t=e();return this.context^=i,t}consumeOptionalCharacter(i){return this.next.isCharacter(i)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(i){this.consumeOptionalCharacter(i)||this.error(`Missing expected ${String.fromCharCode(i)}`)}consumeOptionalOperator(i){return this.next.isOperator(i)?(this.advance(),!0):!1}isAssignmentOperator(i){return i.type===un.Operator&&Na.isAssignmentOperation(i.strValue)}expectOperator(i){this.consumeOptionalOperator(i)||this.error(`Missing expected operator ${i}`)}prettyPrintToken(i){return i===$g?"end of input":`token ${i}`}expectIdentifierOrKeyword(){let i=this.next;return!i.isIdentifier()&&!i.isKeyword()?(i.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(i,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(i)}, expected identifier or keyword`),null):(this.advance(),i.toString())}expectIdentifierOrKeywordOrString(){let i=this.next;return!i.isIdentifier()&&!i.isKeyword()&&!i.isString()?(i.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(i,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(i)}, expected identifier, keyword, or string`),""):(this.advance(),i.toString())}parseChain(){let i=[],e=this.inputIndex;for(;this.index<this.tokens.length;){let t=this.parsePipe();if(i.push(t),this.consumeOptionalCharacter(es))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(es););else if(this.index<this.tokens.length){let o=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===o)break}}if(i.length===0){let t=this.offset,o=this.offset+this.input.length;return new _a(this.span(t,o),this.sourceSpan(t,o))}return i.length==1?i[0]:new Sh(this.span(e),this.sourceSpan(e),i)}parsePipe(){let i=this.inputIndex,e=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseFlags&1&&this.error("Cannot have a pipe in an action expression");do{let t=this.inputIndex,o=this.expectIdentifierOrKeyword(),r,a;o!==null?r=this.sourceSpan(t):(o="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,r=new Up(a,a).toAbsolute(this.absoluteOffset));let c=[];for(;this.consumeOptionalCharacter(_c);)c.push(this.parseExpression());let p;if(this.supportsDirectPipeReferences){let u=o.charCodeAt(0);p=u===_m||u>=gm&&u<=Bh?HC.ReferencedDirectly:HC.ReferencedByName}else p=HC.ReferencedByName;e=new l1(this.span(i),this.sourceSpan(i,a),e,o,c,p,r)}while(this.consumeOptionalOperator("|"))}return e}parseExpression(){return this.parseConditional()}parseConditional(){let i=this.inputIndex,e=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let t=this.parsePipe(),o;if(this.consumeOptionalCharacter(_c))o=this.parsePipe();else{let r=this.inputIndex,a=this.input.substring(i,r);this.error(`Conditional expression ${a} requires all 3 expressions`),o=new _a(this.span(i),this.sourceSpan(i))}return new s1(this.span(i),this.sourceSpan(i),e,t,o)}else return e}parseLogicalOr(){let i=this.inputIndex,e=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let t=this.parseLogicalAnd();e=new Na(this.span(i),this.sourceSpan(i),"||",e,t)}return e}parseLogicalAnd(){let i=this.inputIndex,e=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let t=this.parseNullishCoalescing();e=new Na(this.span(i),this.sourceSpan(i),"&&",e,t)}return e}parseNullishCoalescing(){let i=this.inputIndex,e=this.parseEquality();for(;this.consumeOptionalOperator("??");){let t=this.parseEquality();e=new Na(this.span(i),this.sourceSpan(i),"??",e,t)}return e}parseEquality(){let i=this.inputIndex,e=this.parseRelational();for(;this.next.type==un.Operator;){let t=this.next.strValue;switch(t){case"==":case"===":case"!=":case"!==":this.advance();let o=this.parseRelational();e=new Na(this.span(i),this.sourceSpan(i),t,e,o);continue}break}return e}parseRelational(){let i=this.inputIndex,e=this.parseAdditive();for(;this.next.type==un.Operator||this.next.isKeywordIn()||this.next.isKeywordInstanceOf();){let t=this.next.strValue;switch(t){case"<":case">":case"<=":case">=":case"in":case"instanceof":this.advance();let o=this.parseAdditive();e=new Na(this.span(i),this.sourceSpan(i),t,e,o);continue}break}return e}parseAdditive(){let i=this.inputIndex,e=this.parseMultiplicative();for(;this.next.type==un.Operator;){let t=this.next.strValue;switch(t){case"+":case"-":this.advance();let o=this.parseMultiplicative();e=new Na(this.span(i),this.sourceSpan(i),t,e,o);continue}break}return e}parseMultiplicative(){let i=this.inputIndex,e=this.parseExponentiation();for(;this.next.type==un.Operator;){let t=this.next.strValue;switch(t){case"*":case"%":case"/":this.advance();let o=this.parseExponentiation();e=new Na(this.span(i),this.sourceSpan(i),t,e,o);continue}break}return e}parseExponentiation(){let i=this.inputIndex,e=this.parsePrefix();for(;this.next.type==un.Operator&&this.next.strValue==="**";){(e instanceof gh||e instanceof b_||e instanceof x_||e instanceof y_)&&this.error("Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence"),this.advance();let t=this.parseExponentiation();e=new Na(this.span(i),this.sourceSpan(i),"**",e,t)}return e}parsePrefix(){if(this.next.type==un.Operator){let i=this.inputIndex,e=this.next.strValue,t;switch(e){case"+":return this.advance(),t=this.parsePrefix(),gh.createPlus(this.span(i),this.sourceSpan(i),t);case"-":return this.advance(),t=this.parsePrefix(),gh.createMinus(this.span(i),this.sourceSpan(i),t);case"!":return this.advance(),t=this.parsePrefix(),new b_(this.span(i),this.sourceSpan(i),t)}}else if(this.next.isKeywordTypeof()){let i=this.inputIndex;this.advance();let e=this.parsePrefix();return new x_(this.span(i),this.sourceSpan(i),e)}else if(this.next.isKeywordVoid()){let i=this.inputIndex;this.advance();let e=this.parsePrefix();return new y_(this.span(i),this.sourceSpan(i),e)}return this.parseCallChain()}parseCallChain(){let i=this.inputIndex,e=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(yp))e=this.parseAccessMember(e,i,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(Va)?e=this.parseCall(e,i,!0):e=this.consumeOptionalCharacter(bc)?this.parseKeyedReadOrWrite(e,i,!0):this.parseAccessMember(e,i,!0);else if(this.consumeOptionalCharacter(bc))e=this.parseKeyedReadOrWrite(e,i,!1);else if(this.consumeOptionalCharacter(Va))e=this.parseCall(e,i,!1);else if(this.consumeOptionalOperator("!"))e=new S_(this.span(i),this.sourceSpan(i),e);else if(this.next.isTemplateLiteralEnd())e=this.parseNoInterpolationTaggedTemplateLiteral(e,i);else if(this.next.isTemplateLiteralPart())e=this.parseTaggedTemplateLiteral(e,i);else return e}parsePrimary(){let i=this.inputIndex;if(this.isArrowFunction())return this.parseArrowFunction(i);if(this.consumeOptionalCharacter(Va)){this.rparensExpected++;let e=this.parsePipe();return this.consumeOptionalCharacter(Cr)||(this.error("Missing closing parentheses"),this.consumeOptionalCharacter(Cr)),this.rparensExpected--,new k_(this.span(i),this.sourceSpan(i),e)}else{if(this.next.isKeywordNull())return this.advance(),new Ja(this.span(i),this.sourceSpan(i),null);if(this.next.isKeywordUndefined())return this.advance(),new Ja(this.span(i),this.sourceSpan(i),void 0);if(this.next.isKeywordTrue())return this.advance(),new Ja(this.span(i),this.sourceSpan(i),!0);if(this.next.isKeywordFalse())return this.advance(),new Ja(this.span(i),this.sourceSpan(i),!1);if(this.next.isKeywordIn())return this.advance(),new Ja(this.span(i),this.sourceSpan(i),"in");if(this.next.isKeywordThis())return this.advance(),new g_(this.span(i),this.sourceSpan(i));if(this.consumeOptionalCharacter(bc))return this.parseLiteralArray(i);if(this.next.isCharacter(Ys))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new Mc(this.span(i),this.sourceSpan(i)),i,!1);if(this.next.isNumber()){let e=this.next.toNumber();return this.advance(),new Ja(this.span(i),this.sourceSpan(i),e)}else{if(this.next.isTemplateLiteralEnd())return this.parseNoInterpolationTemplateLiteral();if(this.next.isTemplateLiteralPart())return this.parseTemplateLiteral();if(this.next.isString()&&this.next.kind===Rp.Plain){let e=this.next.toString();return this.advance(),new Ja(this.span(i),this.sourceSpan(i),e)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new _a(this.span(i),this.sourceSpan(i))):this.next.isRegExpBody()?this.parseRegularExpressionLiteral():this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new _a(this.span(i),this.sourceSpan(i))):(this.error(`Unexpected token ${this.next}`),new _a(this.span(i),this.sourceSpan(i)))}}}parseLiteralArray(i){this.rbracketsExpected++;let e=[];do if(this.next.isOperator("..."))e.push(this.parseSpreadElement());else if(!this.next.isCharacter(_d))e.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(va));return this.rbracketsExpected--,this.expectCharacter(_d),new C_(this.span(i),this.sourceSpan(i),e)}parseLiteralMap(){let i=[],e=[],t=this.inputIndex;if(this.expectCharacter(Ys),!this.consumeOptionalCharacter(Ra)){this.rbracesExpected++;do{let o=this.inputIndex;if(this.next.isOperator("...")){this.advance(),i.push({kind:"spread",span:this.span(o),sourceSpan:this.sourceSpan(o)}),e.push(this.parsePipe());continue}let r=this.next.isString(),a=this.expectIdentifierOrKeywordOrString(),c=this.span(o),p=this.sourceSpan(o),u={kind:"property",key:a,quoted:r,span:c,sourceSpan:p};i.push(u),r?(this.expectCharacter(_c),e.push(this.parsePipe())):this.consumeOptionalCharacter(_c)?e.push(this.parsePipe()):(u.isShorthandInitialized=!0,e.push(new Cc(c,p,p,new Mc(c,p),a)))}while(this.consumeOptionalCharacter(va)&&!this.next.isCharacter(Ra));this.rbracesExpected--,this.expectCharacter(Ra)}return new Wp(this.span(t),this.sourceSpan(t),i,e)}parseAccessMember(i,e,t){let o=this.inputIndex,r=this.withContext(Yg.Writable,()=>{let c=this.expectIdentifierOrKeyword()??"";return c.length===0&&this.error("Expected identifier for property access",i.span.end),c}),a=this.sourceSpan(o);if(t)return this.isAssignmentOperator(this.next)?(this.advance(),this.error("The '?.' operator cannot be used in the assignment"),new _a(this.span(e),this.sourceSpan(e))):new __(this.span(e),this.sourceSpan(e),a,i,r);if(this.isAssignmentOperator(this.next)){let c=this.next.strValue;if(!(this.parseFlags&1))return this.advance(),this.error("Bindings cannot contain assignments"),new _a(this.span(e),this.sourceSpan(e));let p=new Cc(this.span(e),this.sourceSpan(e),a,i,r);this.advance();let u=this.parseConditional();return new Na(this.span(e),this.sourceSpan(e),c,p,u)}else return new Cc(this.span(e),this.sourceSpan(e),a,i,r)}parseCall(i,e,t){let o=this.inputIndex;this.rparensExpected++;let r=this.parseCallArguments(),a=this.span(o,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(Cr),this.rparensExpected--;let c=this.span(e),p=this.sourceSpan(e);return t?new d1(c,p,i,r,a):new wh(c,p,i,r,a)}parseCallArguments(){if(this.next.isCharacter(Cr))return[];let i=[];do i.push(this.next.isOperator("...")?this.parseSpreadElement():this.parsePipe());while(this.consumeOptionalCharacter(va));return i}parseSpreadElement(){this.next.isOperator("...")||this.error("Spread element must start with '...' operator");let i=this.inputIndex;this.advance();let e=this.parsePipe(),t=this.span(i),o=this.sourceSpan(i);return new c1(t,o,e)}expectTemplateBindingKey(){let i="",e=!1,t=this.currentAbsoluteOffset;do i+=this.expectIdentifierOrKeywordOrString(),e=this.consumeOptionalOperator("-"),e&&(i+="-");while(e);return{source:i,span:new Ms(t,t+i.length)}}parseTemplateBindings(i){let e=[];for(e.push(...this.parseDirectiveKeywordBindings(i));this.index<this.tokens.length;){let t=this.parseLetBinding();if(t)e.push(t);else{let o=this.expectTemplateBindingKey(),r=this.parseAsBinding(o);r?e.push(r):(o.source=i.source+o.source.charAt(0).toUpperCase()+o.source.substring(1),e.push(...this.parseDirectiveKeywordBindings(o)))}this.consumeStatementTerminator()}return new NT(e,[],this.errors)}parseKeyedReadOrWrite(i,e,t){return this.withContext(Yg.Writable,()=>{this.rbracketsExpected++;let o=this.parsePipe();if(o instanceof _a&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(_d),this.isAssignmentOperator(this.next)){let r=this.next.strValue;if(t)this.advance(),this.error("The '?.' operator cannot be used in the assignment");else{let a=new Gp(this.span(e),this.sourceSpan(e),i,o);this.advance();let c=this.parseConditional();return new Na(this.span(e),this.sourceSpan(e),r,a,c)}}else return t?new v_(this.span(e),this.sourceSpan(e),i,o):new Gp(this.span(e),this.sourceSpan(e),i,o);return new _a(this.span(e),this.sourceSpan(e))})}parseDirectiveKeywordBindings(i){let e=[];this.consumeOptionalCharacter(_c);let t=this.getDirectiveBoundTarget(),o=this.currentAbsoluteOffset,r=this.parseAsBinding(i);r||(this.consumeStatementTerminator(),o=this.currentAbsoluteOffset);let a=new Ms(i.span.start,o);return e.push(new qk(a,i,t)),r&&e.push(r),e}getDirectiveBoundTarget(){if(this.next===$g||this.peekKeywordAs()||this.peekKeywordLet())return null;let i=this.parsePipe(),{start:e,end:t}=i.span,o=this.input.substring(e,t);return new ts(i,o,em(this.parseSourceSpan),this.absoluteOffset+e,this.errors)}parseAsBinding(i){if(!this.peekKeywordAs())return null;this.advance();let e=this.expectTemplateBindingKey();this.consumeStatementTerminator();let t=new Ms(i.span.start,this.currentAbsoluteOffset);return new T_(t,e,i)}parseLetBinding(){if(!this.peekKeywordLet())return null;let i=this.currentAbsoluteOffset;this.advance();let e=this.expectTemplateBindingKey(),t=null;this.consumeOptionalOperator("=")&&(t=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let o=new Ms(i,this.currentAbsoluteOffset);return new T_(o,e,t)}parseNoInterpolationTaggedTemplateLiteral(i,e){let t=this.parseNoInterpolationTemplateLiteral();return new w_(this.span(e),this.sourceSpan(e),i,t)}parseNoInterpolationTemplateLiteral(){let i=this.next.strValue,e=this.inputIndex;this.advance();let t=this.span(e),o=this.sourceSpan(e);return new M_(t,o,[new m1(t,o,i)],[])}parseTaggedTemplateLiteral(i,e){let t=this.parseTemplateLiteral();return new w_(this.span(e),this.sourceSpan(e),i,t)}parseTemplateLiteral(){let i=[],e=[],t=this.inputIndex;for(;this.next!==$g;){let o=this.next;if(o.isTemplateLiteralPart()||o.isTemplateLiteralEnd()){let r=this.inputIndex;if(this.advance(),i.push(new m1(this.span(r),this.sourceSpan(r),o.strValue)),o.isTemplateLiteralEnd())break}else if(o.isTemplateLiteralInterpolationStart()){this.advance(),this.rbracesExpected++;let r=this.parsePipe();r instanceof _a?this.error("Template literal interpolation cannot be empty"):e.push(r),this.rbracesExpected--}else this.advance()}return new M_(this.span(t),this.sourceSpan(t),i,e)}parseRegularExpressionLiteral(){let i=this.next;if(this.advance(),!i.isRegExpBody())return new _a(this.span(this.inputIndex),this.sourceSpan(this.inputIndex));let e=null;if(this.next.isRegExpFlags()){e=this.next,this.advance();let r=new Set;for(let a=0;a<e.strValue.length;a++){let c=e.strValue[a];q5.has(c)?r.has(c)?this.error(`Duplicate regular expression flag "${c}"`,e.index+a):r.add(c):this.error(`Unsupported regular expression flag "${c}". The supported flags are: `+Array.from(q5,p=>`"${p}"`).join(", "),e.index+a)}}let t=i.index,o=e?e.end:i.end;return new u1(this.span(t,o),this.sourceSpan(t,o),i.strValue,e?e.strValue:null)}parseArrowFunction(i){let e;if(this.next.isIdentifier()){let o=this.next;this.advance(),e=[this.getArrowFunctionIdentifierArg(o)]}else this.next.isCharacter(Va)?(this.rparensExpected++,this.advance(),e=this.parseArrowFunctionParameters(),this.rparensExpected--):(e=[],this.error(`Unexpected token ${this.next}`));this.expectOperator("=>");let t;if(this.next.isCharacter(Ys))this.error("Multi-line arrow functions are not supported. If you meant to return an object literal, wrap it with parentheses."),t=new _a(this.span(i),this.sourceSpan(i));else{let o=this.parseFlags;this.parseFlags=1,t=this.parseExpression(),this.parseFlags=o}return new p1(this.span(i),this.sourceSpan(i),e,t)}parseArrowFunctionParameters(){let i=[];if(!this.consumeOptionalCharacter(Cr))for(;this.next!==$g;)if(this.next.isIdentifier()){let e=this.next;if(this.advance(),i.push(this.getArrowFunctionIdentifierArg(e)),this.consumeOptionalCharacter(Cr))break;this.expectCharacter(va)}else{this.error(`Unexpected token ${this.next}`);break}return i}getArrowFunctionIdentifierArg(i){return new Wk(i.strValue,this.span(i.index),this.sourceSpan(i.index))}isArrowFunction(){let i=this.index,e=this.tokens;if(i>e.length-2)return!1;if(e[i].isIdentifier()&&e[i+1].isOperator("=>"))return!0;if(e[i].isCharacter(Va)){let t=i+1;for(t;t<e.length&&!(!e[t].isIdentifier()&&!e[t].isCharacter(va));t++);return t<e.length-1&&e[t].isCharacter(Cr)&&e[t+1].isOperator("=>")}return!1}consumeStatementTerminator(){this.consumeOptionalCharacter(es)||this.consumeOptionalCharacter(va)}error(i,e=this.index){this.errors.push(hh(i,this.input,this.getErrorLocationText(e),this.parseSourceSpan)),this.skip()}getErrorLocationText(i){return i<this.tokens.length?`at column ${this.tokens[i].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(i,e){let t=`Private identifiers are not supported. Unexpected private identifier: ${i}`;e!==null&&(t+=`, ${e}`),this.error(t)}skip(){let i=this.next;for(;this.index<this.tokens.length&&!i.isCharacter(es)&&!i.isOperator("|")&&(this.rparensExpected<=0||!i.isCharacter(Cr))&&(this.rbracesExpected<=0||!i.isCharacter(Ra))&&(this.rbracketsExpected<=0||!i.isCharacter(_d))&&(!(this.context&Yg.Writable)||!this.isAssignmentOperator(i));)this.next.isError()&&this.errors.push(hh(this.next.toString(),this.input,this.getErrorLocationText(this.next.index),this.parseSourceSpan)),this.advance(),i=this.next}};function hh(n,i,e,t){e.length>0&&(e=` ${e} `);let o=em(t),r=`Parser Error: ${n}${e}[${i}] in ${o}`;return new sn(t,r)}var FT=class extends Mh{errors=[];visitPipe(){this.errors.push("pipes")}};function wW(n){let i=new Map,e=0,t=0,o=0;for(;o<n.length;){let r=n[o];if(r.type===9){let[a,c]=r.parts;e+=c.length,t+=a.length}else{let a=r.parts.reduce((c,p)=>c+p.length,0);t+=a,e+=a}i.set(t,e),o++}return i}function MW(n){return n.visit(new RT)}var RT=class{visitUnary(i,e){return`${i.operator}${i.expr.visit(this,e)}`}visitBinary(i,e){return`${i.left.visit(this,e)} ${i.operation} ${i.right.visit(this,e)}`}visitChain(i,e){return i.expressions.map(t=>t.visit(this,e)).join("; ")}visitConditional(i,e){return`${i.condition.visit(this,e)} ? ${i.trueExp.visit(this,e)} : ${i.falseExp.visit(this,e)}`}visitThisReceiver(){return"this"}visitImplicitReceiver(){return""}visitInterpolation(i,e){return TW(i.strings,i.expressions.map(t=>t.visit(this,e))).join("")}visitKeyedRead(i,e){return`${i.receiver.visit(this,e)}[${i.key.visit(this,e)}]`}visitLiteralArray(i,e){return`[${i.expressions.map(t=>t.visit(this,e)).join(", ")}]`}visitLiteralMap(i,e){return`{${kW(i.keys.map(t=>t.kind==="spread"?"...":t.quoted?`'${t.key}'`:t.key),i.values.map(t=>t.visit(this,e))).map(([t,o])=>`${t}: ${o}`).join(", ")}}`}visitLiteralPrimitive(i){if(i.value===null)return"null";switch(typeof i.value){case"number":case"boolean":return i.value.toString();case"undefined":return"undefined";case"string":return`'${i.value.replace(/'/g,"\\'")}'`;default:throw new Error(`Unsupported primitive type: ${i.value}`)}}visitPipe(i,e){return`${i.exp.visit(this,e)} | ${i.name}`}visitPrefixNot(i,e){return`!${i.expression.visit(this,e)}`}visitNonNullAssert(i,e){return`${i.expression.visit(this,e)}!`}visitPropertyRead(i,e){return i.receiver instanceof Mc||i.receiver instanceof g_?i.name:`${i.receiver.visit(this,e)}.${i.name}`}visitSafePropertyRead(i,e){return`${i.receiver.visit(this,e)}?.${i.name}`}visitSafeKeyedRead(i,e){return`${i.receiver.visit(this,e)}?.[${i.key.visit(this,e)}]`}visitCall(i,e){return`${i.receiver.visit(this,e)}(${i.args.map(t=>t.visit(this,e)).join(", ")})`}visitSafeCall(i,e){return`${i.receiver.visit(this,e)}?.(${i.args.map(t=>t.visit(this,e)).join(", ")})`}visitTypeofExpression(i,e){return`typeof ${i.expression.visit(this,e)}`}visitVoidExpression(i,e){return`void ${i.expression.visit(this,e)}`}visitRegularExpressionLiteral(i,e){return`/${i.body}/${i.flags||""}`}visitArrowFunction(i,e){let t;return i.parameters.length===1?t=i.parameters[0].name:t=`(${i.parameters.map(o=>o.name).join(", ")})`,`${t} => ${i.body.visit(this,e)}`}visitASTWithSource(i,e){return i.ast.visit(this,e)}visitTemplateLiteral(i,e){let t="";for(let o=0;o<i.elements.length;o++){t+=i.elements[o].visit(this,e);let r=o<i.expressions.length?i.expressions[o]:null;r!==null&&(t+="${"+r.visit(this,e)+"}")}return"`"+t+"`"}visitTemplateLiteralElement(i,e){return i.text}visitTaggedTemplateLiteral(i,e){return i.tag.visit(this,e)+i.template.visit(this,e)}visitSpreadElement(i,e){return`...${i.expression.visit(this,e)}`}visitParenthesizedExpression(i,e){return"("+i.expression.visit(this,e)+")"}};function kW(n,i){if(n.length!==i.length)throw new Error("Array lengths must match");return n.map((e,t)=>[e,i[t]])}function TW(n,i){let e=[];for(let t=0;t<Math.max(n.length,i.length);t++)t<n.length&&e.push(n[t]),t<i.length&&e.push(i[t]);return e}var GC;function Q5(){return GC||(GC={},Hg(eo.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),Hg(eo.STYLE,["*|style"]),Hg(eo.URL,["*|formAction","area|href","a|href","a|xlink:href","form|action","annotation|href","annotation|xlink:href","annotation-xml|href","annotation-xml|xlink:href","maction|href","maction|xlink:href","malignmark|href","malignmark|xlink:href","math|href","math|xlink:href","mroot|href","mroot|xlink:href","msqrt|href","msqrt|xlink:href","merror|href","merror|xlink:href","mfrac|href","mfrac|xlink:href","mglyph|href","mglyph|xlink:href","msub|href","msub|xlink:href","msup|href","msup|xlink:href","msubsup|href","msubsup|xlink:href","mmultiscripts|href","mmultiscripts|xlink:href","mprescripts|href","mprescripts|xlink:href","mi|href","mi|xlink:href","mn|href","mn|xlink:href","mo|href","mo|xlink:href","mpadded|href","mpadded|xlink:href","mphantom|href","mphantom|xlink:href","mrow|href","mrow|xlink:href","ms|href","ms|xlink:href","mspace|href","mspace|xlink:href","mstyle|href","mstyle|xlink:href","mtable|href","mtable|xlink:href","mtd|href","mtd|xlink:href","mtr|href","mtr|xlink:href","mtext|href","mtext|xlink:href","mover|href","mover|xlink:href","munder|href","munder|xlink:href","munderover|href","munderover|xlink:href","semantics|href","semantics|xlink:href","none|href","none|xlink:href","img|src","video|src"]),Hg(eo.RESOURCE_URL,["base|href","embed|src","frame|src","iframe|src","link|href","object|codebase","object|data","script|src","script|href","script|xlink:href"]),Hg(eo.ATTRIBUTE_NO_BINDING,["animate|attributeName","set|attributeName","animateMotion|attributeName","animateTransform|attributeName","unknown|attributeName","iframe|sandbox","iframe|allow","iframe|allowFullscreen","iframe|referrerPolicy","iframe|csp","iframe|fetchPriority","unknown|sandbox","unknown|allow","unknown|allowFullscreen","unknown|referrerPolicy","unknown|csp","unknown|fetchPriority"])),GC}function Hg(n,i){for(let e of i)GC[e.toLowerCase()]=n}var LT=class{},EW="boolean",DW="number",PW="string",IW="object",AW=["[Element]|textContent,%ariaActiveDescendantElement,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColIndexText,%ariaColSpan,%ariaControlsElements,%ariaCurrent,%ariaDescribedByElements,%ariaDescription,%ariaDetailsElements,%ariaDisabled,%ariaErrorMessageElements,%ariaExpanded,%ariaFlowToElements,%ariaHasPopup,%ariaHidden,%ariaInvalid,%ariaKeyShortcuts,%ariaLabel,%ariaLabelledByElements,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaOwnsElements,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowIndexText,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,search,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","geolocation^[HTMLElement]|accuracymode,!autolocate,*location,*promptaction,*promptdismiss,*validationstatuschange,!watch","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","selectedcontent^[HTMLElement]|","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","search^[HTMLELement]|","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"],BF=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex","aria-activedescendant":"ariaActiveDescendantElement","aria-atomic":"ariaAtomic","aria-autocomplete":"ariaAutoComplete","aria-busy":"ariaBusy","aria-checked":"ariaChecked","aria-colcount":"ariaColCount","aria-colindex":"ariaColIndex","aria-colindextext":"ariaColIndexText","aria-colspan":"ariaColSpan","aria-controls":"ariaControlsElements","aria-current":"ariaCurrent","aria-describedby":"ariaDescribedByElements","aria-description":"ariaDescription","aria-details":"ariaDetailsElements","aria-disabled":"ariaDisabled","aria-errormessage":"ariaErrorMessageElements","aria-expanded":"ariaExpanded","aria-flowto":"ariaFlowToElements","aria-haspopup":"ariaHasPopup","aria-hidden":"ariaHidden","aria-invalid":"ariaInvalid","aria-keyshortcuts":"ariaKeyShortcuts","aria-label":"ariaLabel","aria-labelledby":"ariaLabelledByElements","aria-level":"ariaLevel","aria-live":"ariaLive","aria-modal":"ariaModal","aria-multiline":"ariaMultiLine","aria-multiselectable":"ariaMultiSelectable","aria-orientation":"ariaOrientation","aria-owns":"ariaOwnsElements","aria-placeholder":"ariaPlaceholder","aria-posinset":"ariaPosInSet","aria-pressed":"ariaPressed","aria-readonly":"ariaReadOnly","aria-required":"ariaRequired","aria-roledescription":"ariaRoleDescription","aria-rowcount":"ariaRowCount","aria-rowindex":"ariaRowIndex","aria-rowindextext":"ariaRowIndexText","aria-rowspan":"ariaRowSpan","aria-selected":"ariaSelected","aria-setsize":"ariaSetSize","aria-sort":"ariaSort","aria-valuemax":"ariaValueMax","aria-valuemin":"ariaValueMin","aria-valuenow":"ariaValueNow","aria-valuetext":"ariaValueText"})),OW=Array.from(BF).reduce((n,[i,e])=>(n.set(i,e),n),new Map),Rh=class extends LT{_schema=new Map;_eventSchema=new Map;constructor(){super(),AW.forEach(i=>{let e=new Map,t=new Set,[o,r]=i.split("|"),a=r.split(","),[c,p]=o.split("^");c.split(",").forEach(h=>{this._schema.set(h.toLowerCase(),e),this._eventSchema.set(h.toLowerCase(),t)});let u=p&&this._schema.get(p.toLowerCase());if(u){for(let[h,_]of u)e.set(h,_);for(let h of this._eventSchema.get(p.toLowerCase()))t.add(h)}a.forEach(h=>{if(h.length>0)switch(h[0]){case"*":t.add(h.substring(1));break;case"!":e.set(h.substring(1),EW);break;case"#":e.set(h.substring(1),DW);break;case"%":e.set(h.substring(1),IW);break;default:e.set(h,PW)}})})}hasProperty(i,e,t){if(t.some(r=>r.name===Q4.name))return!0;if(i.indexOf("-")>-1){if(a5(i)||Xk(i))return!1;if(t.some(r=>r.name===q4.name))return!0}return(this._schema.get(i.toLowerCase())||this._schema.get("unknown")).has(e)}hasElement(i,e){return e.some(t=>t.name===Q4.name)||i.indexOf("-")>-1&&(a5(i)||Xk(i)||e.some(t=>t.name===q4.name))?!0:this._schema.has(i.toLowerCase())}securityContext(i,e,t){t&&(e=this.getMappedPropName(e)),i=i.toLowerCase(),e=e.toLowerCase();let o=Q5()[i+"|"+e];return o||(o=Q5()["*|"+e],o||eo.NONE)}getMappedPropName(i){return BF.get(i)??i}getDefaultComponentElementName(){return"ng-component"}validateProperty(i){return i.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${i}' is disallowed for security reasons, please use (${i.slice(2)})=...
If '${i}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(i){return i.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${i}' is disallowed for security reasons, please use (${i.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(i){let e=this._schema.get(i.toLowerCase())||this._schema.get("unknown");return Array.from(e.keys()).map(t=>OW.get(t)??t)}allKnownEventsOfElement(i){return Array.from(this._eventSchema.get(i.toLowerCase())??[])}normalizeAnimationStyleProperty(i){return D$(i)}normalizeAnimationStyleValue(i,e,t){let o="",r=t.toString().trim(),a=null;if(NW(i)&&t!==0&&t!=="0")if(typeof t=="number")o="px";else{let c=t.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&(a=`Please provide a CSS unit value for ${e}:${t}`)}return{error:a,value:r+o}}};function NW(n){switch(n){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var Kn=class{closedByChildren={};contentType;closedByParent=!1;implicitNamespacePrefix;isVoid;ignoreFirstLf;canSelfClose;preventNamespaceInheritance;constructor({closedByChildren:i,implicitNamespacePrefix:e,contentType:t=gc.PARSABLE_DATA,closedByParent:o=!1,isVoid:r=!1,ignoreFirstLf:a=!1,preventNamespaceInheritance:c=!1,canSelfClose:p=!1}={}){i&&i.length>0&&i.forEach(u=>this.closedByChildren[u]=!0),this.isVoid=r,this.closedByParent=o||r,this.implicitNamespacePrefix=e||null,this.contentType=t,this.ignoreFirstLf=a,this.preventNamespaceInheritance=c,this.canSelfClose=p??r}isClosedByChild(i){return this.isVoid||i.toLowerCase()in this.closedByChildren}getContentType(i){return typeof this.contentType=="object"?(i===void 0?void 0:this.contentType[i])??this.contentType.default:this.contentType}},X5,ah;function VT(n){return ah||(X5=new Kn({canSelfClose:!0}),ah=Object.assign(Object.create(null),{base:new Kn({isVoid:!0}),meta:new Kn({isVoid:!0}),area:new Kn({isVoid:!0}),embed:new Kn({isVoid:!0}),link:new Kn({isVoid:!0}),img:new Kn({isVoid:!0}),input:new Kn({isVoid:!0}),param:new Kn({isVoid:!0}),hr:new Kn({isVoid:!0}),br:new Kn({isVoid:!0}),source:new Kn({isVoid:!0}),track:new Kn({isVoid:!0}),wbr:new Kn({isVoid:!0}),p:new Kn({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new Kn({closedByChildren:["tbody","tfoot"]}),tbody:new Kn({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new Kn({closedByChildren:["tbody"],closedByParent:!0}),tr:new Kn({closedByChildren:["tr"],closedByParent:!0}),td:new Kn({closedByChildren:["td","th"],closedByParent:!0}),th:new Kn({closedByChildren:["td","th"],closedByParent:!0}),col:new Kn({isVoid:!0}),svg:new Kn({implicitNamespacePrefix:"svg"}),foreignObject:new Kn({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new Kn({implicitNamespacePrefix:"math"}),li:new Kn({closedByChildren:["li"],closedByParent:!0}),dt:new Kn({closedByChildren:["dt","dd"]}),dd:new Kn({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new Kn({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new Kn({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new Kn({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new Kn({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new Kn({closedByChildren:["optgroup"],closedByParent:!0}),option:new Kn({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new Kn({ignoreFirstLf:!0}),listing:new Kn({ignoreFirstLf:!0}),style:new Kn({contentType:gc.RAW_TEXT}),script:new Kn({contentType:gc.RAW_TEXT}),title:new Kn({contentType:{default:gc.ESCAPABLE_RAW_TEXT,svg:gc.PARSABLE_DATA}}),textarea:new Kn({contentType:gc.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new Rh().allKnownElementNames().forEach(i=>{!ah[i]&&Kk(i)===null&&(ah[i]=new Kn({canSelfClose:!1}))})),ah[n]??ah[n.toLowerCase()]??X5}var K5={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"},BT=class{_placeHolderNameCounts={};_signatureToName={};getStartTagPlaceholderName(i,e,t){let o=this._hashTag(i,e,t);if(this._signatureToName[o])return this._signatureToName[o];let r=i.toUpperCase(),a=K5[r]||`TAG_${r}`,c=this._generateUniqueName(t?a:`START_${a}`);return this._signatureToName[o]=c,c}getCloseTagPlaceholderName(i){let e=this._hashClosingTag(i);if(this._signatureToName[e])return this._signatureToName[e];let t=i.toUpperCase(),o=K5[t]||`TAG_${t}`,r=this._generateUniqueName(`CLOSE_${o}`);return this._signatureToName[e]=r,r}getPlaceholderName(i,e){let t=i.toUpperCase(),o=`PH: ${t}=${e}`;if(this._signatureToName[o])return this._signatureToName[o];let r=this._generateUniqueName(t);return this._signatureToName[o]=r,r}getUniquePlaceholder(i){return this._generateUniqueName(i.toUpperCase())}getStartBlockPlaceholderName(i,e){let t=this._hashBlock(i,e);if(this._signatureToName[t])return this._signatureToName[t];let o=this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(i)}`);return this._signatureToName[t]=o,o}getCloseBlockPlaceholderName(i){let e=this._hashClosingBlock(i);if(this._signatureToName[e])return this._signatureToName[e];let t=this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(i)}`);return this._signatureToName[e]=t,t}_hashTag(i,e,t){let o=`<${i}`,r=Object.keys(e).sort().map(c=>` ${c}=${e[c]}`).join(""),a=t?"/>":`></${i}>`;return o+r+a}_hashClosingTag(i){return this._hashTag(`/${i}`,{},!1)}_hashBlock(i,e){let t=e.length===0?"":` (${e.sort().join("; ")})`;return`@${i}${t} {}`}_hashClosingBlock(i){return this._hashBlock(`close_${i}`,[])}_toSnakeCase(i){return i.toUpperCase().replace(/[^A-Z0-9]/g,"_")}_generateUniqueName(i){if(!this._placeHolderNameCounts.hasOwnProperty(i))return this._placeHolderNameCounts[i]=1,i;let t=this._placeHolderNameCounts[i];return this._placeHolderNameCounts[i]=t+1,`${i}_${t}`}},FW=new G1(new e0);function RW(n,i){let e=new zT(FW,n,i);return(t,o,r,a,c)=>e.toI18nMessage(t,o,r,a,c)}function LW(n,i){return i}var zT=class{_expressionParser;_retainEmptyTokens;_preserveExpressionWhitespace;constructor(i,e,t){this._expressionParser=i,this._retainEmptyTokens=e,this._preserveExpressionWhitespace=t}toI18nMessage(i,e="",t="",o="",r){let a={isIcu:i.length==1&&i[0]instanceof Fp,icuDepth:0,placeholderRegistry:new BT,placeholderToContent:{},placeholderToMessage:{},visitNodeFn:r||LW},c=Co(this,i,a);return new za(c,a.placeholderToContent,a.placeholderToMessage,e,t,o)}visitElement(i,e){return this._visitElementLike(i,e)}visitComponent(i,e){return this._visitElementLike(i,e)}visitDirective(i,e){throw new Error("Unreachable code")}visitAttribute(i,e){let t=i.valueTokens===void 0||i.valueTokens.length===1?new Vg(i.value,i.valueSpan||i.sourceSpan):this._visitTextWithInterpolation(i.valueTokens,i.valueSpan||i.sourceSpan,e,i.i18n);return e.visitNodeFn(i,t)}visitText(i,e){let t=i.tokens.length===1?new Vg(i.value,i.sourceSpan):this._visitTextWithInterpolation(i.tokens,i.sourceSpan,e,i.i18n);return e.visitNodeFn(i,t)}visitComment(i,e){return null}visitExpansion(i,e){e.icuDepth++;let t={},o=new y1(i.switchValue,i.type,t,i.sourceSpan);if(i.cases.forEach(c=>{t[c.value]=new Cd(c.expression.map(p=>p.visit(this,e)),c.expSourceSpan)}),e.icuDepth--,e.isIcu||e.icuDepth>0){let c=e.placeholderRegistry.getUniquePlaceholder(`VAR_${i.type}`);return o.expressionPlaceholder=c,e.placeholderToContent[c]={text:i.switchValue,sourceSpan:i.switchValueSourceSpan},e.visitNodeFn(i,o)}let r=e.placeholderRegistry.getPlaceholderName("ICU",i.sourceSpan.toString());e.placeholderToMessage[r]=this.toI18nMessage([i],"","","",void 0);let a=new Ph(o,r,i.sourceSpan);return e.visitNodeFn(i,a)}visitExpansionCase(i,e){throw new Error("Unreachable code")}visitBlock(i,e){let t=Co(this,i.children,e);if(i.name==="switch")return new Cd(t,i.sourceSpan);let o=i.parameters.map(p=>p.expression),r=e.placeholderRegistry.getStartBlockPlaceholderName(i.name,o),a=e.placeholderRegistry.getCloseBlockPlaceholderName(i.name);e.placeholderToContent[r]={text:i.startSourceSpan.toString(),sourceSpan:i.startSourceSpan},e.placeholderToContent[a]={text:i.endSourceSpan?i.endSourceSpan.toString():"}",sourceSpan:i.endSourceSpan??i.sourceSpan};let c=new cm(i.name,o,r,a,t,i.sourceSpan,i.startSourceSpan,i.endSourceSpan);return e.visitNodeFn(i,c)}visitBlockParameter(i,e){throw new Error("Unreachable code")}visitLetDeclaration(i,e){return null}_visitElementLike(i,e){let t=Co(this,i.children,e),o={},r=_=>{o[_.name]=_.value},a,c;i instanceof qs?(a=i.name,c=VT(i.name).isVoid):(a=i.fullName,c=i.tagName?VT(i.tagName).isVoid:!1),i.attrs.forEach(r),i.directives.forEach(_=>_.attrs.forEach(r));let p=e.placeholderRegistry.getStartTagPlaceholderName(a,o,c);e.placeholderToContent[p]={text:i.startSourceSpan.toString(),sourceSpan:i.startSourceSpan};let u="";c||(u=e.placeholderRegistry.getCloseTagPlaceholderName(a),e.placeholderToContent[u]={text:`</${a}>`,sourceSpan:i.endSourceSpan??i.sourceSpan});let h=new lm(a,o,p,u,t,c,i.sourceSpan,i.startSourceSpan,i.endSourceSpan);return e.visitNodeFn(i,h)}_visitTextWithInterpolation(i,e,t,o){let r=[],a=!1;for(let c of i)switch(c.type){case 8:case 17:a=!0;let[p,u,h]=c.parts,_=$W(u)||"INTERPOLATION",S=t.placeholderRegistry.getPlaceholderName(_,u);if(this._preserveExpressionWhitespace)t.placeholderToContent[S]={text:c.parts.join(""),sourceSpan:c.sourceSpan},r.push(new R_(u,S,c.sourceSpan));else{let x=this.normalizeExpression(c);t.placeholderToContent[S]={text:`${p}${x}${h}`,sourceSpan:c.sourceSpan},r.push(new R_(x,S,c.sourceSpan))}break;default:if(c.parts[0].length>0||this._retainEmptyTokens){let x=r[r.length-1];x instanceof Vg?(x.value+=c.parts[0],x.sourceSpan=new gn(x.sourceSpan.start,c.sourceSpan.end,x.sourceSpan.fullStart,x.sourceSpan.details)):r.push(new Vg(c.parts[0],c.sourceSpan))}else this._retainEmptyTokens&&r.push(new Vg(c.parts[0],c.sourceSpan));break}return a?(VW(r,o),new Cd(r,e)):r[0]}normalizeExpression(i){let e=i.parts[1],t=this._expressionParser.parseBinding(e,i.sourceSpan,i.sourceSpan.start.offset);return MW(t)}};function VW(n,i){if(i instanceof za&&(BW(i),i=i.nodes[0]),i instanceof Cd){zW(i.children,n);for(let e=0;e<n.length;e++)n[e].sourceSpan=i.children[e].sourceSpan}}function BW(n){let i=n.nodes;if(i.length!==1||!(i[0]instanceof Cd))throw new Error("Unexpected previous i18n message - expected it to consist of only a single `Container` node.")}function zW(n,i){if(n.length!==i.length)throw new Error(`
The number of i18n message children changed between first and second pass.
First pass (${n.length} tokens):
${n.map(e=>`"${e.sourceSpan.toString()}"`).join(`
`)}
Second pass (${i.length} tokens):
${i.map(e=>`"${e.sourceSpan.toString()}"`).join(`
`)}
`.trim());if(n.some((e,t)=>i[t].constructor!==e.constructor))throw new Error("The types of the i18n message children changed between first and second pass.")}var jW=/\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;function $W(n){return n.split(jW)[2]}var Y5=new Set(["iframe|srcdoc","*|innerhtml","*|outerhtml","embed|src","iframe|src","object|codebase","object|data"]);function Z5(n,i){return n=n.toLowerCase(),i=i.toLowerCase(),Y5.has(n+"|"+i)||Y5.has("*|"+i)}var HW=n=>(i,e)=>{let t=n.get(i)??i;return t instanceof yd&&(e instanceof Ph&&t.i18n instanceof za&&(e.previousMessage=t.i18n),t.i18n=e),e},W1=class{keepI18nAttrs;enableI18nLegacyMessageIdFormat;preserveSignificantWhitespace;retainEmptyTokens;hasI18nMeta=!1;_errors=[];constructor(i=!1,e=!1,t=!0,o=!t){this.keepI18nAttrs=i,this.enableI18nLegacyMessageIdFormat=e,this.preserveSignificantWhitespace=t,this.retainEmptyTokens=o}_generateI18nMessage(i,e="",t){let{meaning:o,description:r,customId:a}=this._parseMetadata(e),p=RW(this.retainEmptyTokens,this.preserveSignificantWhitespace)(i,o,r,a,t);return this._setMessageId(p,e),this._setLegacyIds(p,e),p}visitAllWithErrors(i){let e=i.map(t=>t.visit(this,null));return new H1(e,this._errors)}visitElement(i){return this._visitElementLike(i),i}visitComponent(i,e){return this._visitElementLike(i),i}visitExpansion(i,e){let t,o=i.i18n;if(this.hasI18nMeta=!0,o instanceof Ph){let r=o.name;t=this._generateI18nMessage([i],o);let a=ZN(t);a.name=r,e!==null&&(e.placeholderToMessage[r]=t)}else t=this._generateI18nMessage([i],e||o);return i.i18n=t,i}visitText(i){return i}visitAttribute(i){return i}visitComment(i){return i}visitExpansionCase(i){return i}visitBlock(i,e){return Co(this,i.children,e),i}visitBlockParameter(i,e){return i}visitLetDeclaration(i,e){return i}visitDirective(i,e){return i}_visitElementLike(i){let e;if(iH(i)){this.hasI18nMeta=!0;let t=[],o={};for(let r of i.attrs)if(r.name===KN){let a=i.i18n||r.value,c=new Map,p=this.preserveSignificantWhitespace?i.children:uc(new U1(!1,c),i.children);e=this._generateI18nMessage(p,a,HW(c)),e.nodes.length===0&&(e=void 0),i.i18n=e}else if(r.name.startsWith(aT)){let a=r.name.slice(aT.length),c;i instanceof Fa?c=i.tagName===null?!1:Z5(i.tagName,a):c=Z5(i.name,a),c?this._reportError(r,`Translating attribute '${a}' is disallowed for security reasons.`):o[a]=r.value}else t.push(r);if(Object.keys(o).length)for(let r of t){let a=o[r.name];a!==void 0&&r.value&&(r.i18n=this._generateI18nMessage([r],r.i18n||a))}this.keepI18nAttrs||(i.attrs=t)}Co(this,i.children,e)}_parseMetadata(i){return typeof i=="string"?WW(i):i instanceof za?i:{}}_setMessageId(i,e){i.id||(i.id=e instanceof za&&e.id||r$(i))}_setLegacyIds(i,e){if(this.enableI18nLegacyMessageIdFormat)i.legacyIds=[o$(i),jN(i)];else if(typeof e!="string"){let t=e instanceof za?e:e instanceof Ph?e.previousMessage:void 0;i.legacyIds=t?t.legacyIds:[]}}_reportError(i,e){this._errors.push(new sn(i.sourceSpan,e))}},UW="|",GW="@@";function WW(n=""){let i,e,t;if(n=n.trim(),n){let o=n.indexOf(GW),r=n.indexOf(UW),a;[a,i]=o>-1?[n.slice(0,o),n.slice(o+2)]:[n,""],[e,t]=r>-1?[a.slice(0,r),a.slice(r+1)]:["",a]}return{customId:i,meaning:e,description:t}}function qW(n){let i=[];return n.description?i.push({tagName:"desc",text:n.description}):i.push({tagName:"suppress",text:"{msgDescriptions}"}),n.meaning&&i.push({tagName:"meaning",text:n.meaning}),b$(i)}var QW="goog.getMsg";function XW(n,i,e,t){let o=YW(i),r=[Te(o)];Object.keys(t).length&&(r.push(ST(_E(t,!0),!0)),r.push(ST({original_code:nl(Object.keys(t).map(p=>({key:s0(p),quoted:!0,value:i.placeholders[p]?Te(i.placeholders[p].sourceSpan.toString()):Te(i.placeholderToMessage[p].nodes.map(u=>u.sourceSpan.toString()).join(""))})))})));let a=new Rr(e.name,Yn(QW).callFn(r),Ol,oa.Final);a.addLeadingComment(qW(i));let c=new sa(n.set(e));return[a,c]}var jT=class{formatPh(i){return`{$${s0(i)}}`}visitText(i){return i.value}visitContainer(i){return i.children.map(e=>e.visit(this)).join("")}visitIcu(i){return AF(i)}visitTagPlaceholder(i){return i.isVoid?this.formatPh(i.startName):`${this.formatPh(i.startName)}${i.children.map(e=>e.visit(this)).join("")}${this.formatPh(i.closeName)}`}visitPlaceholder(i){return this.formatPh(i.name)}visitBlockPlaceholder(i){return`${this.formatPh(i.startName)}${i.children.map(e=>e.visit(this)).join("")}${this.formatPh(i.closeName)}`}visitIcuPlaceholder(i,e){return this.formatPh(i.name)}},KW=new jT;function YW(n){return n.nodes.map(i=>i.visit(KW,null)).join("")}function ZW(n,i,e){let{messageParts:t,placeHolders:o}=JW(i),r=eq(i),a=o.map(u=>e[u.text]),c=S$(i,t,o,a,r),p=n.set(c);return[new sa(p)]}var $T=class{placeholderToMessage;pieces;constructor(i,e){this.placeholderToMessage=i,this.pieces=e}visitText(i){if(this.pieces[this.pieces.length-1]instanceof Ip)this.pieces[this.pieces.length-1].text+=i.value;else{let e=new gn(i.sourceSpan.fullStart,i.sourceSpan.end,i.sourceSpan.fullStart,i.sourceSpan.details);this.pieces.push(new Ip(i.value,e))}}visitContainer(i){i.children.forEach(e=>e.visit(this))}visitIcu(i){this.pieces.push(new Ip(AF(i),i.sourceSpan))}visitTagPlaceholder(i){this.pieces.push(this.createPlaceholderPiece(i.startName,i.startSourceSpan??i.sourceSpan)),i.isVoid||(i.children.forEach(e=>e.visit(this)),this.pieces.push(this.createPlaceholderPiece(i.closeName,i.endSourceSpan??i.sourceSpan)))}visitPlaceholder(i){this.pieces.push(this.createPlaceholderPiece(i.name,i.sourceSpan))}visitBlockPlaceholder(i){this.pieces.push(this.createPlaceholderPiece(i.startName,i.startSourceSpan??i.sourceSpan)),i.children.forEach(e=>e.visit(this)),this.pieces.push(this.createPlaceholderPiece(i.closeName,i.endSourceSpan??i.sourceSpan))}visitIcuPlaceholder(i){this.pieces.push(this.createPlaceholderPiece(i.name,i.sourceSpan,this.placeholderToMessage[i.name]))}createPlaceholderPiece(i,e,t){return new fh(s0(i,!1),e,t)}};function JW(n){let i=[],e=new $T(n.placeholderToMessage,i);return n.nodes.forEach(t=>t.visit(e)),tq(i)}function eq(n){let i=n.nodes[0],e=n.nodes[n.nodes.length-1];return new gn(i.sourceSpan.fullStart,e.sourceSpan.end,i.sourceSpan.fullStart,i.sourceSpan.details)}function tq(n){let i=[],e=[];n[0]instanceof fh&&i.push(yk(n[0].sourceSpan.start));for(let t=0;t<n.length;t++){let o=n[t];o instanceof Ip?i.push(o):(e.push(o),n[t-1]instanceof fh&&i.push(yk(n[t-1].sourceSpan.end)))}return n[n.length-1]instanceof fh&&i.push(yk(n[n.length-1].sourceSpan.end)),{messageParts:i,placeHolders:e}}function yk(n){return new Ip("",new gn(n,n))}var J5="ngI18nClosureMode",nq="i18n_",iq="I18N_EXP_",eN="\uFFFD",oq="MSG_";function tN(n){return`${oq}${n}`.toUpperCase()}function rq(n){return new Rr(n.name,void 0,Ol,void 0,n.sourceSpan)}function aq(n){let i=n.relativeContextFilePath.replace(/[^A-Za-z0-9]/g,"_").toUpperCase()+"_",e=new Map,t=new Map,o=new Map,r=new Map;for(let p of n.units)for(let u of p.ops())if(u.kind===V.ExtractedAttribute&&u.i18nContext!==null){let h=e.get(u.i18nContext)??[];h.push(u),e.set(u.i18nContext,h)}else if(u.kind===V.I18nAttributes)t.set(u.target,u);else if(u.kind===V.I18nExpression&&u.usage===zh.I18nAttribute){let h=o.get(u.target)??[];h.push(u),o.set(u.target,h)}else u.kind===V.I18nMessage&&r.set(u.xref,u);let a=new Map,c=new Map;for(let p of n.units)for(let u of p.create)if(u.kind===V.I18nMessage){if(u.messagePlaceholder===null){let{mainVar:h,statements:_}=zF(n,i,r,u);if(u.i18nBlock!==null){let S=n.addConst(h,_);c.set(u.i18nBlock,S)}else{n.constsInitializers.push(..._),a.set(u.i18nContext,h);let S=e.get(u.i18nContext);if(S!==void 0)for(let x of S)x.expression=h.clone()}}qe.remove(u)}for(let p of n.units)for(let u of p.create)if(fm(u)){let h=t.get(u.xref);if(h===void 0)continue;let _=o.get(u.xref);if(_===void 0)throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction");let S=new Set;_=_.filter(b=>{let M=S.has(b.name);return S.add(b.name),!M});let x=_.flatMap(b=>{let M=a.get(b.context);if(M===void 0)throw new Error("AssertionError: Could not find i18n expression's value");return[Te(b.name),M]});h.i18nAttributesConfig=n.addConst(new wc(x))}for(let p of n.units)for(let u of p.create)if(u.kind===V.I18nStart){let h=c.get(u.root);if(h===void 0)throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?");u.messageIndex=h}}function zF(n,i,e,t){let o=[],r=new Map;for(let u of t.subMessages){let h=e.get(u),{mainVar:_,statements:S}=zF(n,i,e,h);o.push(...S);let x=r.get(h.messagePlaceholder)??[];x.push(_),r.set(h.messagePlaceholder,x)}sq(t,r),t.params=new Map([...t.params.entries()].sort());let a=Yn(n.pool.uniqueName(nq)),c=dq(n.pool,t.message.id,i,n.i18nUseExternalIds),p;if(t.needsPostprocessing||t.postprocessingParams.size>0){let u=Object.fromEntries([...t.postprocessingParams.entries()].sort()),h=_E(u,!1),_=[];t.postprocessingParams.size>0&&_.push(ST(h,!0)),p=S=>Ut(fe.i18nPostprocess).callFn([S,..._])}return o.push(...lq(t.message,a,c,t.params,p)),{mainVar:a,statements:o}}function sq(n,i){for(let[e,t]of i)t.length===1?n.params.set(e,t[0]):(n.params.set(e,Te(`${eN}${iq}${e}${eN}`)),n.postprocessingParams.set(e,Gi(t)))}function lq(n,i,e,t,o){let r=Object.fromEntries(t),a=[rq(i),tb(cq(),XW(i,n,e,r),ZW(i,n,_E(r,!1)))];return o&&a.push(new sa(i.set(o(i)))),a}function cq(){return r0(Yn(J5)).notIdentical(Te("undefined",hE)).and(Yn(J5))}function dq(n,i,e,t){let o,r=e;if(t){let a=tN("EXTERNAL_"),c=n.uniqueName(r);o=`${a}${Mp(i)}$$${c}`}else{let a=tN(r);o=n.uniqueName(a)}return Yn(o)}function mq(n){for(let i of n.units){let e=null,t=null,o=new Map,r=new Map,a=new Map;for(let c of i.create)switch(c.kind){case V.I18nStart:if(c.context===null)throw Error("I18n op should have its context set.");e=c;break;case V.I18nEnd:e=null;break;case V.IcuStart:if(c.context===null)throw Error("Icu op should have its context set.");t=c;break;case V.IcuEnd:t=null;break;case V.Text:if(e!==null)if(o.set(c.xref,e),r.set(c.xref,t),c.icuPlaceholder!==null){let p=VU(n.allocateXrefId(),c.icuPlaceholder,[c.initialValue]);qe.replace(c,p),a.set(c.xref,p)}else qe.remove(c);break}for(let c of i.update)switch(c.kind){case V.InterpolateText:if(!o.has(c.target))continue;let p=o.get(c.target),u=r.get(c.target),h=a.get(c.target),_=u?u.context:p.context,S=u?$_.Postproccessing:$_.Creation,x=[];for(let b=0;b<c.interpolation.expressions.length;b++){let M=c.interpolation.expressions[b];x.push(vF(_,p.xref,p.xref,p.handle,M,h?.xref??null,c.interpolation.i18nPlaceholders[b]??null,S,zh.I18nText,"",M.sourceSpan??c.sourceSpan))}qe.replaceWithMany(c,x),h!==void 0&&(h.strings=c.interpolation.strings);break}}}function pq(n){for(let i of n.units)for(let e of i.create)switch(e.kind){case V.ElementStart:case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:if(!Array.isArray(e.localRefs))throw new Error("AssertionError: expected localRefs to be an array still");if(e.numSlotsUsed+=e.localRefs.length,e.localRefs.length>0){let t=uq(e.localRefs);e.localRefs=n.addConst(t)}else e.localRefs=null;break}}function uq(n){let i=[];for(let e of n)i.push(Te(e.name),Te(e.target));return Gi(i)}function hq(n){for(let i of n.units){let e=Ca.HTML;for(let t of i.create)t.kind===V.ElementStart&&t.namespace!==e&&(qe.insertBefore(PU(t.namespace),t),e=t.namespace)}}function fq(n){let i=[],e=0,t=0,o=0,r=0,a=0,c=null;for(;e<n.length;)switch(n.charCodeAt(e++)){case 40:t++;break;case 41:t--;break;case 39:o===0?o=39:o===39&&n.charCodeAt(e-1)!==92&&(o=0);break;case 34:o===0?o=34:o===34&&n.charCodeAt(e-1)!==92&&(o=0);break;case 58:!c&&t===0&&o===0&&(c=jF(n.substring(a,e-1).trim()),r=e);break;case 59:if(c&&r>0&&t===0&&o===0){let u=n.substring(r,e-1).trim();i.push(c,u),a=e,r=0,c=null}break}if(c&&r){let p=n.slice(r).trim();i.push(c,p)}return i}function jF(n){return n.replace(/[a-z][A-Z]/g,i=>i.charAt(0)+"-"+i.charAt(1)).toLowerCase()}function gq(n){let i=new Map;for(let e of n.units)for(let t of e.create)fm(t)&&i.set(t.xref,t);for(let e of n.units)for(let t of e.create)if(t.kind===V.ExtractedAttribute&&t.bindingKind===jt.Attribute&&CF(t.expression)){let o=i.get(t.target);if(o!==void 0&&(o.kind===V.Template||o.kind===V.ConditionalCreate||o.kind===V.ConditionalBranchCreate)&&o.templateKind===ns.Structural)continue;if(t.name==="style"){let r=fq(t.expression.value);for(let a=0;a<r.length-1;a+=2)qe.insertBefore(Js(t.target,jt.StyleProperty,null,r[a],Te(r[a+1]),null,null,eo.STYLE),t);qe.remove(t)}else if(t.name==="class"){let r=t.expression.value.trim().split(/\s+/g);for(let a of r)qe.insertBefore(Js(t.target,jt.ClassName,null,a,null,null,null,eo.NONE),t);qe.remove(t)}}}function _q(n){Zg(n.root,n.componentName,{index:0})}function Zg(n,i,e){n.fnName===null&&(n.fnName=n.job.pool.uniqueName(Mp(`${i}_${n.job.fnSuffix}`),!1));let t=new Map;for(let o of n.ops())switch(o.kind){case V.Property:case V.DomProperty:o.bindingKind===jt.LegacyAnimation&&(o.name="@"+o.name);break;case V.Animation:if(o.handlerFnName===null){let u=o.name.replace(".","");o.handlerFnName=`${n.fnName}_${u}_cb`,o.handlerFnName=Mp(o.handlerFnName)}break;case V.AnimationListener:if(o.handlerFnName!==null)break;if(!o.hostListener&&o.targetSlot.slot===null)throw new Error("Expected a slot to be assigned");let r=o.name.replace(".","");o.hostListener?o.handlerFnName=`${i}_${r}_HostBindingHandler`:o.handlerFnName=`${n.fnName}_${o.tag.replace("-","_")}_${r}_${o.targetSlot.slot}_listener`,o.handlerFnName=Mp(o.handlerFnName);break;case V.Listener:if(o.handlerFnName!==null)break;if(!o.hostListener&&o.targetSlot.slot===null)throw new Error("Expected a slot to be assigned");let a="";o.isLegacyAnimationListener&&(o.name=`@${o.name}.${o.legacyAnimationPhase}`,a="animation"),o.hostListener?o.handlerFnName=`${i}_${a}${o.name}_HostBindingHandler`:o.handlerFnName=`${n.fnName}_${o.tag.replace("-","_")}_${a}${o.name}_${o.targetSlot.slot}_listener`,o.handlerFnName=Mp(o.handlerFnName);break;case V.TwoWayListener:if(o.handlerFnName!==null)break;if(o.targetSlot.slot===null)throw new Error("Expected a slot to be assigned");o.handlerFnName=Mp(`${n.fnName}_${o.tag.replace("-","_")}_${o.name}_${o.targetSlot.slot}_listener`);break;case V.Variable:t.set(o.xref,vq(o.variable,e));break;case V.RepeaterCreate:if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");if(o.handle.slot===null)throw new Error("Expected slot to be assigned");if(o.emptyView!==null){let u=n.job.views.get(o.emptyView);Zg(u,`${i}_${o.functionNameSuffix}Empty_${o.handle.slot+2}`,e)}Zg(n.job.views.get(o.xref),`${i}_${o.functionNameSuffix}_${o.handle.slot+1}`,e);break;case V.Projection:if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");if(o.handle.slot===null)throw new Error("Expected slot to be assigned");if(o.fallbackView!==null){let u=n.job.views.get(o.fallbackView);Zg(u,`${i}_ProjectionFallback_${o.handle.slot}`,e)}break;case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");let c=n.job.views.get(o.xref);if(o.handle.slot===null)throw new Error("Expected slot to be assigned");let p=o.functionNameSuffix.length===0?"":`_${o.functionNameSuffix}`;Zg(c,`${i}${p}_${o.handle.slot}`,e);break;case V.StyleProp:o.name=nN(Cq(o.name));break;case V.ClassProp:o.name=nN(o.name);break}for(let o of n.ops())mr(o,r=>{if(!(!(r instanceof bd)||r.name!==null)){if(!t.has(r.xref))throw new Error(`Variable ${r.xref} not yet named`);r.name=t.get(r.xref)}})}function vq(n,i){if(n.name===null)switch(n.kind){case Wr.Context:n.name=`ctx_r${i.index++}`;break;case Wr.Identifier:let e=n.identifier===Ps?"i":"";n.name=`${n.identifier}_${e}r${++i.index}`;break;default:n.name=`_r${++i.index}`;break}return n.name}function Cq(n){return n.startsWith("--")?n:jF(n)}function nN(n){let i=n.indexOf("!important");return i>-1?n.substring(0,i):n}function bq(n){for(let i of n.units){for(let e of i.functions)Sk(e.ops);for(let e of i.create)(e.kind===V.Listener||e.kind===V.Animation||e.kind===V.AnimationListener||e.kind===V.TwoWayListener)&&Sk(e.handlerOps);Sk(i.update)}}function Sk(n){for(let i of n){if(i.kind!==V.Statement||!(i.statement instanceof sa)||!(i.statement.expr instanceof P1))continue;let e=i.statement.expr.steps,t=!0;for(let o=i.next;o.kind!==V.ListEnd&&t;o=o.next)mr(o,(r,a)=>{if(!Ec(r))return r;if(t&&!(a&Wn.InChildOperation))switch(r.kind){case Qt.NextContext:r.steps+=e,qe.remove(i),t=!1;break;case Qt.GetCurrentView:case Qt.Reference:case Qt.ContextLetReference:t=!1;break}})}}var xq="ng-container";function yq(n){for(let i of n.units){let e=new Set;for(let t of i.create)t.kind===V.ElementStart&&t.tag===xq&&(t.kind=V.ContainerStart,e.add(t.xref)),t.kind===V.ElementEnd&&e.has(t.xref)&&(t.kind=V.ContainerEnd)}}function Sq(n,i){let e=n.get(i);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function wq(n){let i=new Map;for(let e of n.units)for(let t of e.create)fm(t)&&i.set(t.xref,t);for(let e of n.units)for(let t of e.create)(t.kind===V.ElementStart||t.kind===V.ContainerStart)&&t.nonBindable&&qe.insertAfter(MU(t.xref),t),(t.kind===V.ElementEnd||t.kind===V.ContainerEnd)&&Sq(i,t.xref).nonBindable&&qe.insertBefore(kU(t.xref),t)}function vc(n){return i=>i.kind===n}function i_(n,i){return e=>e.kind===n&&i===e.expression instanceof Qo}function Mq(n){return n.kind===V.Listener&&!(n.hostListener&&n.isLegacyAnimationListener)||n.kind===V.TwoWayListener||n.kind===V.Animation||n.kind===V.AnimationListener}function kq(n){return(n.kind===V.Property||n.kind===V.TwoWayProperty)&&!(n.expression instanceof Qo)}var Tq=[{test:n=>n.kind===V.Listener&&n.hostListener&&n.isLegacyAnimationListener},{test:Mq}],Eq=[{test:vc(V.StyleMap),transform:q1},{test:vc(V.ClassMap),transform:q1},{test:vc(V.StyleProp)},{test:vc(V.ClassProp)},{test:i_(V.Attribute,!0)},{test:i_(V.Property,!0)},{test:kq},{test:i_(V.Attribute,!1)},{test:vc(V.Control)}],Dq=[{test:i_(V.DomProperty,!0)},{test:i_(V.DomProperty,!1)},{test:vc(V.Attribute)},{test:vc(V.StyleMap),transform:q1},{test:vc(V.ClassMap),transform:q1},{test:vc(V.StyleProp)},{test:vc(V.ClassProp)}],iN=new Set([V.Listener,V.TwoWayListener,V.AnimationListener,V.StyleMap,V.ClassMap,V.StyleProp,V.ClassProp,V.Property,V.TwoWayProperty,V.DomProperty,V.Attribute,V.Animation,V.Control]);function Pq(n){for(let i of n.units){oN(i.create,Tq);let e=i.job.kind===Et.Host?Dq:Eq;oN(i.update,e)}}function oN(n,i){let e=[],t=null;for(let o of n){let r=H_(o)?o.target:null;(!iN.has(o.kind)||r!==t&&t!==null&&r!==null)&&(qe.insertBefore(rN(e,i),o),e=[],t=null),iN.has(o.kind)&&(e.push(o),qe.remove(o),t=r??t)}n.push(rN(e,i))}function rN(n,i){let e=Array.from(i,()=>new Array);for(let t of n){let o=i.findIndex(r=>r.test(t));e[o].push(t)}return e.flatMap((t,o)=>{let r=i[o].transform;return r?r(t):t})}function q1(n){return n.slice(n.length-1)}function Iq(n){for(let i of n.units){let e=EF(i);for(let t of i.ops())if(t.kind===V.Binding){let o=Oq(e,t.target);Aq(t.name)&&o.kind===V.Projection&&qe.remove(t)}}}function Aq(n){return n.toLowerCase()==="select"}function Oq(n,i){let e=n.get(i);if(e===void 0)throw new Error("All attributes should have an slottable target.");return e}function Nq(n){for(let i of n.units)Fq(i)}function Fq(n){for(let i of n.update)mr(i,(e,t)=>{if(!Ec(e)||e.kind!==Qt.PipeBinding)return;if(t&Wn.InChildOperation)throw new Error("AssertionError: pipe bindings should not appear in child expressions");if(i.target==null)throw new Error("AssertionError: expected slot handle to be assigned for pipe creation");Rq(n,i.target,e)})}function Rq(n,i,e){for(let t=n.create.head.next;t.kind!==V.ListEnd;t=t.next){if(!jh(t)||t.xref!==i)continue;for(;t.next.kind===V.Pipe;)t=t.next;let o=DU(e.target,e.targetSlot,e.name);qe.insertBefore(o,t.next);return}throw new Error(`AssertionError: unable to find insertion point for pipe ${e.name}`)}function Lq(n){for(let i of n.units)for(let e of i.update)Xo(e,t=>!(t instanceof Yp)||t.args.length<=4?t:new q_(t.target,t.targetSlot,t.name,Gi(t.args),t.args.length),Wn.None)}function Vq(n){$F(n.root,0)}function $F(n,i){let e=null;for(let t of n.create)switch(t.kind){case V.I18nStart:t.subTemplateIndex=i===0?null:i,e=t;break;case V.I18nEnd:e.subTemplateIndex===null&&(i=0),e=null;break;case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:i=NC(n.job.views.get(t.xref),e,t.i18nPlaceholder,i);break;case V.RepeaterCreate:let o=n.job.views.get(t.xref);i=NC(o,e,t.i18nPlaceholder,i),t.emptyView!==null&&(i=NC(n.job.views.get(t.emptyView),e,t.emptyI18nPlaceholder,i));break;case V.Projection:t.fallbackView!==null&&(i=NC(n.job.views.get(t.fallbackView),e,t.fallbackViewI18nPlaceholder,i));break}return i}function NC(n,i,e,t){if(e!==void 0){if(i===null)throw Error("Expected template with i18n placeholder to be in an i18n block.");t++,Bq(n,i)}return $F(n,t)}function Bq(n,i){if(n.create.head.next?.kind!==V.I18nStart){let e=n.job.allocateXrefId();qe.insertAfter(rb(e,i.message,i.root,null),n.create.head),qe.insertBefore(ab(e,null),n.create.tail)}}function zq(n){for(let i of n.units)for(let e of i.ops())mr(e,t=>{if(!(t instanceof Kp)||t.body===null)return;let o=new HT(t.args.length);t.fn=n.pool.getSharedConstant(o,t.body),t.body=null})}var HT=class extends h_{numArgs;constructor(i){super(),this.numArgs=i}keyOf(i){return i instanceof um?`param(${i.index})`:super.keyOf(i)}toSharedConstantDeclaration(i,e){let t=[];for(let r=0;r<this.numArgs;r++)t.push(new br("a"+r,is));let o=Vt(e,r=>r instanceof um?Yn("a"+r.index):r,Wn.None);return new Rr(i,new eu(t,o),void 0,oa.Final)}};function jq(n){for(let i of n.units)for(let e of i.update)Xo(e,(t,o)=>o&Wn.InChildOperation?t:t instanceof wc?$q(t):t instanceof Rl?Hq(t):t,Wn.None)}function $q(n){let i=[],e=[];for(let t of n.entries){if(t instanceof $p){if(t.expression.isConstant())i.push(t);else{let o=e.length;e.push(t.expression),i.push(new $p(new um(o)))}continue}if(t.isConstant())i.push(t);else{let o=e.length;e.push(t),i.push(new um(o))}}return new Kp(Gi(i),e)}function Hq(n){let i=[],e=[];for(let t of n.entries){if(t instanceof rm){if(t.expression.isConstant())i.push(t);else{let o=e.length;e.push(t.expression),i.push(new rm(new um(o)))}continue}if(t.value.isConstant())i.push(t);else{let o=e.length;e.push(t.value),i.push(new xh(t.key,new um(o),t.quoted))}}return new Kp(new Rl(i),e)}function Uq(n){for(let i of n.units)for(let e of i.ops())Xo(e,t=>t instanceof bh&&(t.flags===null||!t.flags.includes("g"))?n.pool.getSharedConstant(new UT,t):t,Wn.None)}var UT=class extends h_{toSharedConstantDeclaration(i,e){return new Rr(i,e,void 0,oa.Final)}};function Gq(n,i,e,t,o){return vm(fe.element,n,i,e,t,o)}function Wq(n,i,e,t,o){return vm(fe.elementStart,n,i,e,t,o)}function vm(n,i,e,t,o,r){let a=[Te(i)];return e!==null&&a.push(Te(e)),o!==null?a.push(Te(t),Te(o)):t!==null&&a.push(Te(t)),yn(n,a,r)}function HF(n,i,e,t,o,r,a,c,p){let u=[Te(i),e,Te(t),Te(o),Te(r),Te(a)];for(c!==null&&(u.push(Te(c)),u.push(Ut(fe.templateRefExtractor)));u[u.length-1].isEquivalent(yh);)u.pop();return yn(n,u,p)}function TE(n,i,e,t,o){let r=[Te(i)];return e instanceof Qo?r.push($h(e,o)):r.push(e),t!==null&&r.push(t),yn(n,r,o)}function qq(n){return yn(fe.elementEnd,[],n)}function Qq(n,i,e,t){return vm(fe.elementContainerStart,n,null,i,e,t)}function Xq(n,i,e,t){return vm(fe.elementContainer,n,null,i,e,t)}function Kq(){return yn(fe.elementContainerEnd,[],null)}function Yq(n,i,e,t,o,r,a,c){return HF(fe.templateCreate,n,i,e,t,o,r,a,c)}function Zq(){return yn(fe.disableBindings,[],null)}function Jq(){return yn(fe.enableBindings,[],null)}function eQ(n,i,e,t,o){let r=[Te(n),i];return e!==null&&r.push(Ut(e)),yn(t?fe.syntheticHostListener:fe.listener,r,o)}function aN(n,i){return Ut(fe.twoWayBindingSet).callFn([n,i])}function tQ(n,i,e){return yn(fe.twoWayListener,[Te(n),i],e)}function nQ(n,i){return yn(fe.pipe,[Te(n),Te(i)],null)}function iQ(){return yn(fe.namespaceHTML,[],null)}function oQ(){return yn(fe.namespaceSVG,[],null)}function rQ(){return yn(fe.namespaceMathML,[],null)}function aQ(n,i){return yn(fe.advance,n>1?[Te(n)]:[],i)}function sQ(n){return Ut(fe.reference).callFn([Te(n)])}function lQ(n){return Ut(fe.nextContext).callFn(n===1?[]:[Te(n)])}function cQ(){return Ut(fe.getCurrentView).callFn([])}function dQ(n){return Ut(fe.restoreView).callFn([n])}function mQ(n){return Ut(fe.resetView).callFn([n])}function pQ(n,i,e){let t=[Te(n,null)];return i!==""&&t.push(Te(i)),yn(fe.text,t,e)}function uQ(n,i,e,t,o,r,a,c,p,u,h){let _=[Te(n),Te(i),e??Te(null),Te(t),Te(o),Te(r),a??Te(null),c??Te(null),p?Ut(fe.deferEnableTimerScheduling):Te(null),Te(h)],S;for(;(S=_[_.length-1])!==null&&S instanceof aa&&S.value===null;)_.pop();return yn(fe.defer,_,u)}var hQ=new Map([[Ji.Idle,{none:fe.deferOnIdle,prefetch:fe.deferPrefetchOnIdle,hydrate:fe.deferHydrateOnIdle}],[Ji.Immediate,{none:fe.deferOnImmediate,prefetch:fe.deferPrefetchOnImmediate,hydrate:fe.deferHydrateOnImmediate}],[Ji.Timer,{none:fe.deferOnTimer,prefetch:fe.deferPrefetchOnTimer,hydrate:fe.deferHydrateOnTimer}],[Ji.Hover,{none:fe.deferOnHover,prefetch:fe.deferPrefetchOnHover,hydrate:fe.deferHydrateOnHover}],[Ji.Interaction,{none:fe.deferOnInteraction,prefetch:fe.deferPrefetchOnInteraction,hydrate:fe.deferHydrateOnInteraction}],[Ji.Viewport,{none:fe.deferOnViewport,prefetch:fe.deferPrefetchOnViewport,hydrate:fe.deferHydrateOnViewport}],[Ji.Never,{none:fe.deferHydrateNever,prefetch:fe.deferHydrateNever,hydrate:fe.deferHydrateNever}]]);function fQ(n,i,e,t){let o=hQ.get(n)?.[e];if(o===void 0)throw new Error(`Unable to determine instruction for trigger ${n}`);return yn(o,i,t)}function gQ(n){return yn(fe.projectionDef,n?[n]:[],null)}function _Q(n,i,e,t,o,r,a){let c=[Te(n)];return(i!==0||e!==null||t!==null)&&(c.push(Te(i)),e!==null&&c.push(e),t!==null&&(e===null&&c.push(Te(null)),c.push(Yn(t),Te(o),Te(r)))),yn(fe.projection,c,a)}function vQ(n,i,e,t){let o=[Te(n),Te(i)];return e!==null&&o.push(Te(e)),yn(fe.i18nStart,o,t)}function CQ(n,i,e,t,o,r,a,c){let p=[Te(n),i,Te(e),Te(t),Te(o),Te(r)];for(a!==null&&(p.push(Te(a)),p.push(Ut(fe.templateRefExtractor)));p[p.length-1].isEquivalent(yh);)p.pop();return yn(fe.conditionalCreate,p,c)}function bQ(n,i,e,t,o,r,a,c){let p=[Te(n),i,Te(e),Te(t),Te(o),Te(r)];for(a!==null&&(p.push(Te(a)),p.push(Ut(fe.templateRefExtractor)));p[p.length-1].isEquivalent(yh);)p.pop();return yn(fe.conditionalBranchCreate,p,c)}function xQ(n,i,e,t,o,r,a,c,p,u,h,_,S,x){let b=[Te(n),Yn(i),Te(e),Te(t),Te(o),Te(r),a];return(c||p!==null)&&(b.push(Te(c)),p!==null&&(b.push(Yn(p),Te(u),Te(h)),(_!==null||S!==null)&&b.push(Te(_)),S!==null&&b.push(Te(S)))),yn(fe.repeaterCreate,b,x)}function yQ(n,i){return yn(fe.repeater,[n],i)}function SQ(n,i,e){return n==="prefetch"?yn(fe.deferPrefetchWhen,[i],e):n==="hydrate"?yn(fe.deferHydrateWhen,[i],e):yn(fe.deferWhen,[i],e)}function wQ(n,i){return yn(fe.declareLet,[Te(n)],i)}function MQ(n,i){return Ut(fe.storeLet).callFn([n],i)}function kQ(n){return Ut(fe.readContextLet).callFn([Te(n)])}function TQ(n,i,e,t){let o=[Te(n),Te(i)];return e&&o.push(Te(e)),yn(fe.i18n,o,t)}function EQ(n){return yn(fe.i18nEnd,[],n)}function DQ(n,i){let e=[Te(n),Te(i)];return yn(fe.i18nAttributes,e,null)}function PQ(n,i,e){return TE(fe.ariaProperty,n,i,null,e)}function IQ(n,i,e,t){return TE(fe.property,n,i,e,t)}function AQ(n){return yn(fe.control,[],n)}function OQ(n){return yn(fe.controlCreate,[],n)}function NQ(n,i,e,t){let o=[Te(n),i];return e!==null&&o.push(e),yn(fe.twoWayProperty,o,t)}function FQ(n,i,e,t,o){let r=[Te(n)];return i instanceof Qo?r.push($h(i,o)):r.push(i),(e!==null||t!==null)&&r.push(e??Te(null)),t!==null&&r.push(Te(t)),yn(fe.attribute,r,null)}function RQ(n,i,e,t){let o=[Te(n)];return i instanceof Qo?o.push($h(i,t)):o.push(i),e!==null&&o.push(Te(e)),yn(fe.styleProp,o,t)}function LQ(n,i,e){return yn(fe.classProp,[Te(n),i],e)}function VQ(n,i){let e=n instanceof Qo?$h(n,i):n;return yn(fe.styleMap,[e],i)}function BQ(n,i){let e=n instanceof Qo?$h(n,i):n;return yn(fe.classMap,[e],i)}function zQ(n,i,e,t,o){return vm(fe.domElement,n,i,e,t,o)}function jQ(n,i,e,t,o){return vm(fe.domElementStart,n,i,e,t,o)}function $Q(n){return yn(fe.domElementEnd,[],n)}function HQ(n,i,e,t){return vm(fe.domElementContainerStart,n,null,i,e,t)}function UQ(n,i,e,t){return vm(fe.domElementContainer,n,null,i,e,t)}function GQ(){return yn(fe.domElementContainerEnd,[],null)}function WQ(n,i,e,t){let o=[Te(n),i];return e!==null&&o.push(Ut(e)),yn(fe.domListener,o,t)}function qQ(n,i,e,t,o,r,a,c){return HF(fe.domTemplate,n,i,e,t,o,r,a,c)}var sN=[fe.pipeBind1,fe.pipeBind2,fe.pipeBind3,fe.pipeBind4];function QQ(n,i,e){if(e.length<1||e.length>sN.length)throw new Error("pipeBind() argument count out of bounds");let t=sN[e.length-1];return Ut(t).callFn([Te(n),Te(i),...e])}function XQ(n,i,e){return Ut(fe.pipeBindV).callFn([Te(n),Te(i),e])}function KQ(n,i,e){let t=UF(n,i);return mX(lX,[],t,e)}function YQ(n,i){return yn(fe.i18nExp,[n],i)}function ZQ(n,i){return yn(fe.i18nApply,[Te(n)],i)}function JQ(n,i,e,t){return TE(fe.domProperty,n,i,e,t)}function eX(n,i,e,t){let o=[i];e!==null&&o.push(e);let r=n==="enter"?fe.animationEnter:fe.animationLeave;return yn(r,o,t)}function tX(n,i,e,t){let r=[i instanceof Qo?$h(i,t):i];e!==null&&r.push(e);let a=n==="enter"?fe.animationEnter:fe.animationLeave;return yn(a,r,t)}function nX(n,i,e,t){let o=[i],r=n==="enter"?fe.animationEnterListener:fe.animationLeaveListener;return yn(r,o,t)}function iX(n,i,e){return yn(fe.syntheticHostProperty,[Te(n),i],e)}function oX(n,i,e){return EE(dX,[Te(n),i],e,null)}function rX(n,i){return yn(fe.attachSourceLocations,[Te(n),i],null)}function aX(n,i,e){return Ut(fe.arrowFunction).callFn([Te(n),i,e])}function UF(n,i){if(n.length<1||i.length!==n.length-1)throw new Error("AssertionError: expected specific shape of args for strings/expressions in interpolation");let e=[];if(i.length===1&&n[0]===""&&n[1]==="")e.push(i[0]);else{let t;for(t=0;t<i.length;t++)e.push(Te(n[t]),i[t]);e.push(Te(n[t]))}return e}function $h(n,i){let e=UF(n.strings,n.expressions);return EE(cX,[],e,i)}function yn(n,i,e){let t=Ut(n).callFn(i,e);return Is(new sa(t,e))}function sX(n,i,e){let t=[n];return i!==null&&t.push(i),yn(fe.conditional,t,e)}var lX={constant:[fe.textInterpolate,fe.textInterpolate1,fe.textInterpolate2,fe.textInterpolate3,fe.textInterpolate4,fe.textInterpolate5,fe.textInterpolate6,fe.textInterpolate7,fe.textInterpolate8],variable:fe.textInterpolateV,mapping:n=>{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},cX={constant:[fe.interpolate,fe.interpolate1,fe.interpolate2,fe.interpolate3,fe.interpolate4,fe.interpolate5,fe.interpolate6,fe.interpolate7,fe.interpolate8],variable:fe.interpolateV,mapping:n=>{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},dX={constant:[fe.pureFunction0,fe.pureFunction1,fe.pureFunction2,fe.pureFunction3,fe.pureFunction4,fe.pureFunction5,fe.pureFunction6,fe.pureFunction7,fe.pureFunction8],variable:fe.pureFunctionV,mapping:n=>n};function EE(n,i,e,t){let o=n.mapping(e.length),r=e.at(-1);if(e.length>1&&r instanceof aa&&r.value===""&&e.pop(),o<n.constant.length)return Ut(n.constant[o]).callFn([...i,...e],t);if(n.variable!==null)return Ut(n.variable).callFn([...i,Gi(e)],t);throw new Error("AssertionError: unable to call variadic function")}function mX(n,i,e,t){return Is(EE(n,i,e,t).toStmt())}var pX=new Map([["window",fe.resolveWindow],["document",fe.resolveDocument],["body",fe.resolveBody]]),uX=new Map([["class","className"],["for","htmlFor"],["formaction","formAction"],["innerHtml","innerHTML"],["readonly","readOnly"],["tabindex","tabIndex"]]);function hX(n){for(let i of n.units)fX(i,i.create),sb(i,i.update)}function fX(n,i){for(let e of i)switch(Xo(e,t=>GF(n,t),Wn.None),e.kind){case V.Text:qe.replace(e,pQ(e.handle.slot,e.initialValue,e.sourceSpan));break;case V.ElementStart:qe.replace(e,n.job.mode===Za.DomOnly?jQ(e.handle.slot,e.tag,e.attributes,e.localRefs,e.startSourceSpan):Wq(e.handle.slot,e.tag,e.attributes,e.localRefs,e.startSourceSpan));break;case V.Element:qe.replace(e,n.job.mode===Za.DomOnly?zQ(e.handle.slot,e.tag,e.attributes,e.localRefs,e.wholeSourceSpan):Gq(e.handle.slot,e.tag,e.attributes,e.localRefs,e.wholeSourceSpan));break;case V.ElementEnd:qe.replace(e,n.job.mode===Za.DomOnly?$Q(e.sourceSpan):qq(e.sourceSpan));break;case V.ContainerStart:qe.replace(e,n.job.mode===Za.DomOnly?HQ(e.handle.slot,e.attributes,e.localRefs,e.startSourceSpan):Qq(e.handle.slot,e.attributes,e.localRefs,e.startSourceSpan));break;case V.Container:qe.replace(e,n.job.mode===Za.DomOnly?UQ(e.handle.slot,e.attributes,e.localRefs,e.wholeSourceSpan):Xq(e.handle.slot,e.attributes,e.localRefs,e.wholeSourceSpan));break;case V.ContainerEnd:qe.replace(e,n.job.mode===Za.DomOnly?GQ():Kq());break;case V.I18nStart:qe.replace(e,vQ(e.handle.slot,e.messageIndex,e.subTemplateIndex,e.sourceSpan));break;case V.I18nEnd:qe.replace(e,EQ(e.sourceSpan));break;case V.I18n:qe.replace(e,TQ(e.handle.slot,e.messageIndex,e.subTemplateIndex,e.sourceSpan));break;case V.I18nAttributes:if(e.i18nAttributesConfig===null)throw new Error("AssertionError: i18nAttributesConfig was not set");qe.replace(e,DQ(e.handle.slot,e.i18nAttributesConfig));break;case V.Template:if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");if(Array.isArray(e.localRefs))throw new Error("AssertionError: local refs array should have been extracted into a constant");let t=n.job.views.get(e.xref);qe.replace(e,e.templateKind===ns.Block||n.job.mode===Za.DomOnly?qQ(e.handle.slot,Yn(t.fnName),t.decls,t.vars,e.tag,e.attributes,e.localRefs,e.startSourceSpan):Yq(e.handle.slot,Yn(t.fnName),t.decls,t.vars,e.tag,e.attributes,e.localRefs,e.startSourceSpan));break;case V.DisableBindings:qe.replace(e,Zq());break;case V.EnableBindings:qe.replace(e,Jq());break;case V.Pipe:qe.replace(e,nQ(e.handle.slot,e.name));break;case V.DeclareLet:qe.replace(e,wQ(e.handle.slot,e.sourceSpan));break;case V.AnimationString:qe.replace(e,tX(e.animationKind,e.expression,e.sanitizer,e.sourceSpan));break;case V.Animation:let o=FC(n,e.handlerFnName,e.handlerOps,!1);qe.replace(e,eX(e.animationKind,o,e.sanitizer,e.sourceSpan));break;case V.AnimationListener:let r=FC(n,e.handlerFnName,e.handlerOps,e.consumesDollarEvent);qe.replace(e,nX(e.animationKind,r,null,e.sourceSpan));break;case V.Listener:let a=FC(n,e.handlerFnName,e.handlerOps,e.consumesDollarEvent),c=e.eventTarget?pX.get(e.eventTarget):null;if(c===void 0)throw new Error(`Unexpected global target '${e.eventTarget}' defined for '${e.name}' event. Supported list of global targets: window,document,body.`);qe.replace(e,n.job.mode===Za.DomOnly&&!e.hostListener&&!e.isLegacyAnimationListener?WQ(e.name,a,c,e.sourceSpan):eQ(e.name,a,c,e.hostListener&&e.isLegacyAnimationListener,e.sourceSpan));break;case V.TwoWayListener:qe.replace(e,tQ(e.name,FC(n,e.handlerFnName,e.handlerOps,!0),e.sourceSpan));break;case V.Variable:if(e.variable.name===null)throw new Error(`AssertionError: unnamed variable ${e.xref}`);qe.replace(e,Is(new Rr(e.variable.name,e.initializer,void 0,oa.Final)));break;case V.Namespace:switch(e.active){case Ca.HTML:qe.replace(e,iQ());break;case Ca.SVG:qe.replace(e,oQ());break;case Ca.Math:qe.replace(e,rQ());break}break;case V.Defer:let p=!!e.loadingMinimumTime||!!e.loadingAfterTime||!!e.placeholderMinimumTime;qe.replace(e,uQ(e.handle.slot,e.mainSlot.slot,e.resolverFn,e.loadingSlot?.slot??null,e.placeholderSlot?.slot??null,e.errorSlot?.slot??null,e.loadingConfig,e.placeholderConfig,p,e.sourceSpan,e.flags));break;case V.DeferOn:let u=[];switch(e.trigger.kind){case Ji.Never:case Ji.Idle:case Ji.Immediate:break;case Ji.Timer:u=[Te(e.trigger.delay)];break;case Ji.Viewport:e.modifier==="hydrate"?u=e.trigger.options?[e.trigger.options]:[]:(u=[Te(e.trigger.targetSlot?.slot??null)],e.trigger.targetSlotViewSteps!==0?u.push(Te(e.trigger.targetSlotViewSteps)):e.trigger.options&&u.push(Te(null)),e.trigger.options&&u.push(e.trigger.options));break;case Ji.Interaction:case Ji.Hover:e.modifier==="hydrate"?u=[]:(u=[Te(e.trigger.targetSlot?.slot??null)],e.trigger.targetSlotViewSteps!==0&&u.push(Te(e.trigger.targetSlotViewSteps)));break;default:throw new Error(`AssertionError: Unsupported reification of defer trigger kind ${e.trigger.kind}`)}qe.replace(e,fQ(e.trigger.kind,u,e.modifier,e.sourceSpan));break;case V.ProjectionDef:qe.replace(e,gQ(e.def));break;case V.Projection:if(e.handle.slot===null)throw new Error("No slot was assigned for project instruction");let h=null,_=null,S=null;if(e.fallbackView!==null){if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");let D=n.job.views.get(e.fallbackView);if(D===void 0)throw new Error("AssertionError: projection had fallback view xref, but fallback view was not found");if(D.fnName===null||D.decls===null||D.vars===null)throw new Error("AssertionError: expected projection fallback view to have been named and counted");h=D.fnName,_=D.decls,S=D.vars}qe.replace(e,_Q(e.handle.slot,e.projectionSlotIndex,e.attributes,h,_,S,e.sourceSpan));break;case V.ConditionalCreate:if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");if(Array.isArray(e.localRefs))throw new Error("AssertionError: local refs array should have been extracted into a constant");let x=n.job.views.get(e.xref);qe.replace(e,CQ(e.handle.slot,Yn(x.fnName),x.decls,x.vars,e.tag,e.attributes,e.localRefs,e.startSourceSpan));break;case V.ConditionalBranchCreate:if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");if(Array.isArray(e.localRefs))throw new Error("AssertionError: local refs array should have been extracted into a constant");let b=n.job.views.get(e.xref);qe.replace(e,bQ(e.handle.slot,Yn(b.fnName),b.decls,b.vars,e.tag,e.attributes,e.localRefs,e.startSourceSpan));break;case V.RepeaterCreate:if(e.handle.slot===null)throw new Error("No slot was assigned for repeater instruction");if(!(n instanceof el))throw new Error("AssertionError: must be compiling a component");let M=n.job.views.get(e.xref);if(M.fnName===null)throw new Error("AssertionError: expected repeater primary view to have been named");let w=null,y=null,E=null;if(e.emptyView!==null){let D=n.job.views.get(e.emptyView);if(D===void 0)throw new Error("AssertionError: repeater had empty view xref, but empty view was not found");if(D.fnName===null||D.decls===null||D.vars===null)throw new Error("AssertionError: expected repeater empty view to have been named and counted");w=D.fnName,y=D.decls,E=D.vars}qe.replace(e,xQ(e.handle.slot,M.fnName,e.decls,e.vars,e.tag,e.attributes,vX(n,e),e.usesComponentInstance,w,y,E,e.emptyTag,e.emptyAttributes,e.wholeSourceSpan));break;case V.SourceLocation:let I=Gi(e.locations.map(({targetSlot:D,offset:N,line:P,column:L})=>{if(D.slot===null)throw new Error("No slot was assigned for source location");return Gi([Te(D.slot),Te(N),Te(P),Te(L)])}));qe.replace(e,rX(e.templatePath,I));break;case V.ControlCreate:qe.replace(e,OQ(e.sourceSpan));break;case V.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of create op ${V[e.kind]}`)}}function sb(n,i){for(let e of i)switch(Xo(e,t=>GF(n,t),Wn.None),e.kind){case V.Advance:qe.replace(e,aQ(e.delta,e.sourceSpan));break;case V.Property:qe.replace(e,n.job.mode===Za.DomOnly&&e.bindingKind!==jt.LegacyAnimation&&e.bindingKind!==jt.Animation?lN(e):gX(e));break;case V.Control:qe.replace(e,_X(e));break;case V.TwoWayProperty:qe.replace(e,NQ(e.name,e.expression,e.sanitizer,e.sourceSpan));break;case V.StyleProp:qe.replace(e,RQ(e.name,e.expression,e.unit,e.sourceSpan));break;case V.ClassProp:qe.replace(e,LQ(e.name,e.expression,e.sourceSpan));break;case V.StyleMap:qe.replace(e,VQ(e.expression,e.sourceSpan));break;case V.ClassMap:qe.replace(e,BQ(e.expression,e.sourceSpan));break;case V.I18nExpression:qe.replace(e,YQ(e.expression,e.sourceSpan));break;case V.I18nApply:qe.replace(e,ZQ(e.handle.slot,e.sourceSpan));break;case V.InterpolateText:qe.replace(e,KQ(e.interpolation.strings,e.interpolation.expressions,e.sourceSpan));break;case V.Attribute:qe.replace(e,FQ(e.name,e.expression,e.sanitizer,e.namespace,e.sourceSpan));break;case V.DomProperty:if(e.expression instanceof Qo)throw new Error("not yet handled");e.bindingKind===jt.LegacyAnimation||e.bindingKind===jt.Animation?qe.replace(e,iX(e.name,e.expression,e.sourceSpan)):qe.replace(e,lN(e));break;case V.Variable:if(e.variable.name===null)throw new Error(`AssertionError: unnamed variable ${e.xref}`);qe.replace(e,Is(new Rr(e.variable.name,e.initializer,void 0,oa.Final)));break;case V.Conditional:if(e.processed===null)throw new Error("Conditional test was not set.");qe.replace(e,sX(e.processed,e.contextValue,e.sourceSpan));break;case V.Repeater:qe.replace(e,yQ(e.collection,e.sourceSpan));break;case V.DeferWhen:qe.replace(e,SQ(e.modifier,e.expr,e.sourceSpan));break;case V.StoreLet:throw new Error(`AssertionError: unexpected storeLet ${e.declaredName}`);case V.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of update op ${V[e.kind]}`)}}function lN(n){return JQ(uX.get(n.name)??n.name,n.expression,n.sanitizer,n.sourceSpan)}function gX(n){return DF(n.name)?PQ(n.name,n.expression,n.sourceSpan):IQ(n.name,n.expression,n.sanitizer,n.sourceSpan)}function _X(n){return AQ(n.sourceSpan)}function GF(n,i){if(!Ec(i))return i;switch(i.kind){case Qt.NextContext:return lQ(i.steps);case Qt.Reference:return sQ(i.targetSlot.slot+1+i.offset);case Qt.LexicalRead:throw new Error(`AssertionError: unresolved LexicalRead of ${i.name}`);case Qt.TwoWayBindingSet:throw new Error("AssertionError: unresolved TwoWayBindingSet");case Qt.RestoreView:if(typeof i.view=="number")throw new Error("AssertionError: unresolved RestoreView");return dQ(i.view);case Qt.ResetView:return mQ(i.expr);case Qt.GetCurrentView:return cQ();case Qt.ReadVariable:if(i.name===null)throw new Error(`Read of unnamed variable ${i.xref}`);return Yn(i.name);case Qt.ReadTemporaryExpr:if(i.name===null)throw new Error(`Read of unnamed temporary ${i.xref}`);return Yn(i.name);case Qt.AssignTemporaryExpr:if(i.name===null)throw new Error(`Assign of unnamed temporary ${i.xref}`);return Yn(i.name).set(i.expr);case Qt.PureFunctionExpr:if(i.fn===null)throw new Error("AssertionError: expected PureFunctions to have been extracted");return oX(i.varOffset,i.fn,i.args);case Qt.PureFunctionParameterExpr:throw new Error("AssertionError: expected PureFunctionParameterExpr to have been extracted");case Qt.PipeBinding:return QQ(i.targetSlot.slot,i.varOffset,i.args);case Qt.PipeBindingVariadic:return XQ(i.targetSlot.slot,i.varOffset,i.args);case Qt.SlotLiteralExpr:return Te(i.slot.slot);case Qt.ContextLetReference:return kQ(i.targetSlot.slot);case Qt.StoreLet:return MQ(i.value,i.sourceSpan);case Qt.TrackContext:return Yn("this");case Qt.ArrowFunction:if(i.varOffset===null)throw new Error("AssertionError: variable offset was not assigned to arrow function");return aX(i.varOffset,n.job.pool.getSharedFunctionReference(CX(n,i),"arrowFn"),Yn(Ps));default:throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${Qt[i.kind]}`)}}function FC(n,i,e,t){sb(n,e);let o=[];for(let a of e){if(a.kind!==V.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${V[a.kind]}`);o.push(a.statement)}let r=[];return t&&r.push(new br("$event",is)),am(r,o,void 0,void 0,i)}function vX(n,i){if(i.trackByFn!==null)return i.trackByFn;let e=[new br("$index",Bp),new br("$item",is)],t;if(i.trackByOps===null)t=i.usesComponentInstance?am(e,[new xr(i.track)]):Ds(e,i.track);else{sb(n,i.trackByOps);let o=[];for(let r of i.trackByOps){if(r.kind!==V.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${V[r.kind]}`);o.push(r.statement)}t=i.usesComponentInstance||o.length!==1||!(o[0]instanceof xr)?am(e,o):Ds(e,o[0].value)}return i.trackByFn=n.job.pool.getSharedFunctionReference(t,"_forTrack"),i.trackByFn}function CX(n,i){sb(n,i.ops);let e=[];for(let o of i.ops){if(o.kind!==V.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${V[o.kind]}`);e.push(o.statement)}let t=e.length===1&&e[0]instanceof xr?e[0].value:e;return Ds([new br(i.contextName,is),new br(i.currentViewName,is)],Ds(i.parameters,t))}function bX(n){for(let i of n.units)for(let e of i.update)switch(e.kind){case V.Attribute:case V.Binding:case V.ClassProp:case V.ClassMap:case V.Property:case V.StyleProp:case V.StyleMap:e.expression instanceof Q_&&qe.remove(e);break}}function xX(n){for(let i of n.units)for(let e of i.create)switch(e.kind){case V.I18nContext:qe.remove(e);break;case V.I18nStart:e.context=null;break}}function yX(n){for(let i of n.units)for(let e of i.update){if(e.kind!==V.Variable||e.variable.kind!==Wr.Identifier||!(e.initializer instanceof U_))continue;let t=e.variable.identifier,o=e;for(;o&&o.kind!==V.ListEnd;)Xo(o,r=>r instanceof Ur&&r.name===t?Te(void 0):r,Wn.None),o=o.prev}}function SX(n){for(let i of n.units){let e=new Set;for(let t of i.update)t.kind===V.I18nExpression&&e.add(t.i18nOwner);for(let t of i.create)switch(t.kind){case V.I18nAttributes:if(e.has(t.xref))continue;qe.remove(t)}}}function wX(n){for(let i of n.units){for(let e of i.functions)o_(i,e.ops);o_(i,i.create),o_(i,i.update)}}function o_(n,i){let e=new Map;e.set(n.xref,Yn(Ps));for(let t of i)switch(t.kind){case V.Variable:t.variable.kind===Wr.Context&&e.set(t.variable.view,new bd(t.xref));break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:o_(n,t.handlerOps);break;case V.RepeaterCreate:t.trackByOps!==null&&o_(n,t.trackByOps);break}n===n.job.root&&e.set(n.xref,Yn(Ps));for(let t of i)Xo(t,o=>{if(o instanceof pm){if(!e.has(o.view))throw new Error(`No context found for reference to view ${o.view} from view ${n.xref}`);return e.get(o.view)}else return o},Wn.None)}function MX(n){for(let i of n.units)for(let e of i.create)if(e.kind===V.Defer){if(e.resolverFn!==null)continue;if(e.ownResolverFn!==null){if(e.handle.slot===null)throw new Error("AssertionError: slot must be assigned before extracting defer deps functions");let t=i.fnName?.replace("_Template","");e.resolverFn=n.pool.getSharedFunctionReference(e.ownResolverFn,`${t}_Defer_${e.handle.slot}_DepsFn`,!1)}}}function kX(n){for(let i of n.units)cN(i.create),cN(i.update)}function cN(n){for(let i of n)(i.kind===V.Listener||i.kind===V.TwoWayListener||i.kind===V.AnimationListener)&&Xo(i,e=>e instanceof Ur&&e.name==="$event"?((i.kind===V.Listener||i.kind===V.AnimationListener)&&(i.consumesDollarEvent=!0),new Nl(e.name)):e,Wn.InChildOperation)}function TX(n){let i=new Map,e=new Map;for(let t of n.units)for(let o of t.create)switch(o.kind){case V.I18nContext:i.set(o.xref,o);break;case V.ElementStart:e.set(o.xref,o);break}hc(n,n.root,i,e)}function hc(n,i,e,t,o){let r=null,a=new Map;for(let c of i.create)switch(c.kind){case V.I18nStart:if(!c.context)throw Error("Could not find i18n context for i18n op");r={i18nBlock:c,i18nContext:e.get(c.context)};break;case V.I18nEnd:r=null;break;case V.ElementStart:if(c.i18nPlaceholder!==void 0){if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");dN(c,r.i18nContext,r.i18nBlock,o),o&&c.i18nPlaceholder.closeName&&a.set(c.xref,o),o=void 0}break;case V.ElementEnd:let p=t.get(c.xref);if(p&&p.i18nPlaceholder!==void 0){if(r===null)throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block");mN(p,r.i18nContext,r.i18nBlock,a.get(c.xref)),a.delete(c.xref)}break;case V.Projection:if(c.i18nPlaceholder!==void 0){if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");dN(c,r.i18nContext,r.i18nBlock,o),mN(c,r.i18nContext,r.i18nBlock,o),o=void 0}if(c.fallbackView!==null){let S=n.views.get(c.fallbackView);if(c.fallbackViewI18nPlaceholder===void 0)hc(n,S,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");RC(n,S,c.handle.slot,c.fallbackViewI18nPlaceholder,r.i18nContext,r.i18nBlock,o),hc(n,S,e,t),LC(n,S,c.handle.slot,c.fallbackViewI18nPlaceholder,r.i18nContext,r.i18nBlock,o),o=void 0}}break;case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:let u=n.views.get(c.xref);if(c.i18nPlaceholder===void 0)hc(n,u,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");c.templateKind===ns.Structural?hc(n,u,e,t,c):(RC(n,u,c.handle.slot,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,o),hc(n,u,e,t),LC(n,u,c.handle.slot,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,o),o=void 0)}break;case V.RepeaterCreate:if(o!==void 0)throw Error("AssertionError: Unexpected structural directive associated with @for block");let h=c.handle.slot+1,_=n.views.get(c.xref);if(c.i18nPlaceholder===void 0)hc(n,_,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");RC(n,_,h,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,o),hc(n,_,e,t),LC(n,_,h,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,o),o=void 0}if(c.emptyView!==null){let S=c.handle.slot+2,x=n.views.get(c.emptyView);if(c.emptyI18nPlaceholder===void 0)hc(n,x,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");RC(n,x,S,c.emptyI18nPlaceholder,r.i18nContext,r.i18nBlock,o),hc(n,x,e,t),LC(n,x,S,c.emptyI18nPlaceholder,r.i18nContext,r.i18nBlock,o),o=void 0}}break}}function dN(n,i,e,t){let{startName:o,closeName:r}=n.i18nPlaceholder,a=ao.ElementTag|ao.OpenTag,c=n.handle.slot;t!==void 0&&(a|=ao.TemplateTag,c={element:c,template:t.handle.slot}),r||(a|=ao.CloseTag),Lh(i.params,o,c,e.subTemplateIndex,a)}function mN(n,i,e,t){let{closeName:o}=n.i18nPlaceholder;if(o){let r=ao.ElementTag|ao.CloseTag,a=n.handle.slot;t!==void 0&&(r|=ao.TemplateTag,a={element:a,template:t.handle.slot}),Lh(i.params,o,a,e.subTemplateIndex,r)}}function RC(n,i,e,t,o,r,a){let{startName:c,closeName:p}=t,u=ao.TemplateTag|ao.OpenTag;p||(u|=ao.CloseTag),a!==void 0&&Lh(o.params,c,a.handle.slot,r.subTemplateIndex,u),Lh(o.params,c,e,WF(n,r,i),u)}function LC(n,i,e,t,o,r,a){let{closeName:c}=t,p=ao.TemplateTag|ao.CloseTag;c&&(Lh(o.params,c,e,WF(n,r,i),p),a!==void 0&&Lh(o.params,c,a.handle.slot,r.subTemplateIndex,p))}function WF(n,i,e){for(let t of e.create)if(t.kind===V.I18nStart)return t.subTemplateIndex;return i.subTemplateIndex}function Lh(n,i,e,t,o){let r=n.get(i)??[];r.push({value:e,subTemplateIndex:t,flags:o}),n.set(i,r)}function EX(n){let i=new Map,e=new Map,t=new Map;for(let a of n.units)for(let c of a.create)switch(c.kind){case V.I18nStart:i.set(c.xref,c.subTemplateIndex);break;case V.I18nContext:e.set(c.xref,c);break;case V.IcuPlaceholder:t.set(c.xref,c);break}let o=new Map,r=a=>a.usage===zh.I18nText?a.i18nOwner:a.context;for(let a of n.units)for(let c of a.update)if(c.kind===V.I18nExpression){let p=o.get(r(c))||0,u=i.get(c.i18nOwner)??null,h={value:p,subTemplateIndex:u,flags:ao.ExpressionIndex};DX(c,h,e,t),o.set(r(c),p+1)}}function DX(n,i,e,t){if(n.i18nPlaceholder!==null){let o=e.get(n.context),r=n.resolutionTime===$_.Creation?o.params:o.postprocessingParams,a=r.get(n.i18nPlaceholder)||[];a.push(i),r.set(n.i18nPlaceholder,a)}n.icuPlaceholder!==null&&t.get(n.icuPlaceholder)?.expressionPlaceholders.push(i)}function PX(n){for(let i of n.units){for(let e of i.functions)r_(i,e.ops,null);r_(i,i.create,null),r_(i,i.update,null)}}function r_(n,i,e){let t=new Map,o=new Map;for(let r of i)switch(r.kind){case V.Variable:switch(r.variable.kind){case Wr.Identifier:if(r.variable.local){if(o.has(r.variable.identifier))continue;o.set(r.variable.identifier,r.xref)}else if(t.has(r.variable.identifier))continue;t.set(r.variable.identifier,r.xref);break;case Wr.Alias:if(t.has(r.variable.identifier))continue;t.set(r.variable.identifier,r.xref);break;case Wr.SavedView:e={view:r.variable.view,variable:r.xref};break}break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:r_(n,r.handlerOps,e);break;case V.RepeaterCreate:r.trackByOps!==null&&r_(n,r.trackByOps,e);break}for(let r of i)r.kind===V.Listener||r.kind===V.TwoWayListener||r.kind===V.Animation||r.kind===V.AnimationListener||Xo(r,a=>{if(a instanceof Ur)return o.has(a.name)?new bd(o.get(a.name)):t.has(a.name)?new bd(t.get(a.name)):new Es(new pm(n.job.root.xref),a.name);if(a instanceof W_&&typeof a.view=="number"){if(e===null||e.view!==a.view)throw new Error(`AssertionError: no saved view ${a.view} from view ${n.xref}`);return a.view=new bd(e.variable),a}else return a},Wn.None);for(let r of i)mr(r,a=>{if(a instanceof Ur)throw new Error(`AssertionError: no lexical reads should remain, but found read of ${a.name}`)})}var IX=new Map([[eo.HTML,fe.sanitizeHtml],[eo.RESOURCE_URL,fe.sanitizeResourceUrl],[eo.SCRIPT,fe.sanitizeScript],[eo.STYLE,fe.sanitizeStyle],[eo.URL,fe.sanitizeUrl],[eo.ATTRIBUTE_NO_BINDING,fe.validateAttribute]]),AX=new Map([[eo.HTML,fe.trustConstantHtml],[eo.RESOURCE_URL,fe.trustConstantResourceUrl]]);function OX(n){for(let i of n.units){if(n.kind!==Et.Host){for(let e of i.create)if(e.kind===V.ExtractedAttribute){let t=AX.get(pN(e.securityContext))??null;e.trustedValueFn=t!==null?Ut(t):null}}for(let e of i.update)switch(e.kind){case V.Property:case V.Attribute:case V.DomProperty:let t=null;Array.isArray(e.securityContext)&&e.securityContext.length===2&&e.securityContext.includes(eo.URL)&&e.securityContext.includes(eo.RESOURCE_URL)?t=fe.sanitizeUrlOrResourceUrl:t=IX.get(pN(e.securityContext))??null,e.sanitizer=t!==null?Ut(t):null;break}}}function pN(n){if(Array.isArray(n)){if(n.length>1)throw Error("AssertionError: Ambiguous security context");return n[0]||eo.NONE}return n}function NX(n){for(let i of n.units){for(let e of i.functions)uN(n,i,e.ops)&&hN(i,e.ops,Yn(e.currentViewName));i.create.prepend([tm(i.job.allocateXrefId(),{kind:Wr.SavedView,name:null,view:i.xref},new vT,Zs.None)]);for(let e of i.create)(e.kind===V.Listener||e.kind===V.TwoWayListener||e.kind===V.Animation||e.kind===V.AnimationListener)&&uN(n,i,e.handlerOps)&&hN(i,e.handlerOps,i.xref)}}function uN(n,i,e){let t=i!==n.root;if(!t)for(let o of e)mr(o,r=>{(r instanceof D1||r instanceof G_)&&(t=!0)});return t}function hN(n,i,e){i.prepend([tm(n.job.allocateXrefId(),{kind:Wr.Context,name:null,view:n.xref},new W_(e),Zs.None)]);for(let t of i)t.kind===V.Statement&&t.statement instanceof xr&&(t.statement.value=new I1(t.statement.value))}function FX(n){let i=new Map;for(let e of n.units){let t=0;for(let o of e.create)jh(o)&&(o.handle.slot=t,i.set(o.xref,o.handle.slot),t+=o.numSlotsUsed);e.decls=t}for(let e of n.units)for(let t of e.ops())if(t.kind===V.Template||t.kind===V.ConditionalCreate||t.kind===V.ConditionalBranchCreate||t.kind===V.RepeaterCreate){let o=n.views.get(t.xref);t.decls=o.decls}}function RX(n){let i=new Set,e=new Map;for(let t of n.units)for(let o of t.ops())o.kind===V.DeclareLet&&e.set(o.xref,o),mr(o,r=>{r instanceof G_&&i.add(r.target)});for(let t of n.units)for(let o of t.update)Xo(o,r=>r instanceof U_&&!i.has(r.target)?(LX(r)||qe.remove(e.get(r.target)),r.value):r,Wn.None)}function LX(n){let i=!1;return Vt(n,e=>((e instanceof Yp||e instanceof q_)&&(i=!0),e),Wn.None),i}function VX(n){let i=new Set;for(let e of n.units)for(let t of e.ops())mr(t,o=>{if(o instanceof gi)switch(o.operator){case st.Exponentiation:BX(o,i);break;case st.NullishCoalesce:zX(o,i);break;case st.And:case st.Or:jX(o,i)}});for(let e of n.units)for(let t of e.ops())Xo(t,o=>o instanceof Fl?i.has(o)?o:o.expr:o,Wn.None)}function BX(n,i){n.lhs instanceof Fl&&n.lhs.expr instanceof jp&&i.add(n.lhs)}function zX(n,i){n.lhs instanceof Fl&&(fN(n.lhs.expr)||n.lhs.expr instanceof Sc)&&i.add(n.lhs),n.rhs instanceof Fl&&(fN(n.rhs.expr)||n.rhs.expr instanceof Sc)&&i.add(n.rhs)}function jX(n,i){n.lhs instanceof Fl&&n.lhs.expr instanceof gi&&n.lhs.expr.operator===st.NullishCoalesce&&i.add(n.lhs)}function fN(n){return n instanceof gi&&(n.operator===st.And||n.operator===st.Or)}function $X(n){for(let i of n.units)for(let e of i.update)if(e.kind===V.Binding)switch(e.bindingKind){case jt.ClassName:if(e.expression instanceof Qo)throw new Error("Unexpected interpolation in ClassName binding");qe.replace(e,pU(e.target,e.name,e.expression,e.sourceSpan));break;case jt.StyleProperty:qe.replace(e,mU(e.target,e.name,e.expression,e.unit,e.sourceSpan));break;case jt.Property:case jt.Template:e.name==="style"?qe.replace(e,uU(e.target,e.expression,e.sourceSpan)):e.name==="class"&&qe.replace(e,hU(e.target,e.expression,e.sourceSpan));break}}function HX(n){for(let i of n.units){i.create.prepend(a_(i.create)),i.update.prepend(a_(i.update));for(let e of i.functions)e.ops.prepend(a_(e.ops))}}function a_(n){let i=0,e=[];for(let t of n){let o=new Map;mr(t,(u,h)=>{h&Wn.InChildOperation||u instanceof hm&&o.set(u.xref,u)});let r=0,a=new Set,c=new Set,p=new Map;mr(t,(u,h)=>{h&Wn.InChildOperation||(u instanceof Dc?(a.has(u.xref)||(a.add(u.xref),p.set(u.xref,`tmp_${i}_${r++}`)),gN(p,u)):u instanceof hm&&(o.get(u.xref)===u&&(c.add(u.xref),r--),gN(p,u)))}),e.push(...Array.from(new Set(p.values())).map(u=>Is(new Rr(u)))),i++,t.kind===V.Listener||t.kind===V.Animation||t.kind===V.AnimationListener||t.kind===V.TwoWayListener?t.handlerOps.prepend(a_(t.handlerOps)):t.kind===V.RepeaterCreate&&t.trackByOps!==null&&t.trackByOps.prepend(a_(t.trackByOps))}return e}function gN(n,i){let e=n.get(i.xref);if(e===void 0)throw new Error(`Found xref with unassigned name: ${i.xref}`);i.name=e}function UX(n){for(let i of n.units)for(let e of i.create)if(e.kind===V.RepeaterCreate)if(e.track instanceof Nl&&e.track.name==="$index")e.trackByFn=Ut(fe.repeaterTrackByIndex);else if(e.track instanceof Nl&&e.track.name==="$item")e.trackByFn=Ut(fe.repeaterTrackByIdentity);else if(GX(n.root.xref,e.track))e.usesComponentInstance=!0,e.track.receiver.receiver.view===i.xref?e.trackByFn=e.track.receiver:(e.trackByFn=Ut(fe.componentInstance).callFn([]).prop(e.track.receiver.name),e.track=e.trackByFn);else{e.track=Vt(e.track,o=>{if(o instanceof Yp||o instanceof q_)throw new Error("Illegal State: Pipes are not allowed in this context");return o instanceof pm?(e.usesComponentInstance=!0,new _T(o.view)):o},Wn.None);let t=new qe;t.push(Is(new xr(e.track,e.track.sourceSpan))),e.trackByOps=t}}function GX(n,i){if(!(i instanceof os)||i.args.length===0||i.args.length>2||!(i.receiver instanceof Es&&i.receiver.receiver instanceof pm)||i.receiver.receiver.view!==n)return!1;let[e,t]=i.args;return!(e instanceof Nl)||e.name!=="$index"?!1:i.args.length===1?!0:!(!(t instanceof Nl)||t.name!=="$item")}function WX(n){for(let i of n.units)for(let e of i.create)e.kind===V.RepeaterCreate&&(e.track=Vt(e.track,t=>{if(t instanceof Ur){if(e.varNames.$index.has(t.name))return Yn("$index");if(t.name===e.varNames.$implicit)return Yn("$item")}return t},Wn.None))}function qX(n){for(let i of n.units)for(let e of i.create)e.kind===V.TwoWayListener&&Xo(e,t=>{if(!(t instanceof A1))return t;let{target:o,value:r}=t;if(o instanceof Es||o instanceof xd)return aN(o,r).or(o.set(r));if(o instanceof bd)return aN(o,r);throw new Error("Unsupported expression in two-way action binding.")},Wn.InChildOperation)}function QX(n){for(let i of n.units){let e=0;for(let r of i.ops())vk(r)&&(e+=XX(r));let t=r=>{Ec(r)&&(r instanceof Kp||(y5(r)&&(r.varOffset=e),vk(r)&&(e+=_N(r))))},o=r=>{!Ec(r)||!(r instanceof Kp)||(y5(r)&&(r.varOffset=e),vk(r)&&(e+=_N(r)))};for(let r of i.create)mr(r,t);for(let r of i.update)mr(r,t);for(let r of i.create)mr(r,o);for(let r of i.update)mr(r,o);i.vars=e}if(n instanceof K_)for(let i of n.units)for(let e of i.create){if(e.kind!==V.Template&&e.kind!==V.RepeaterCreate&&e.kind!==V.ConditionalCreate&&e.kind!==V.ConditionalBranchCreate)continue;let t=n.views.get(e.xref);e.vars=t.vars}}function XX(n){let i;switch(n.kind){case V.Attribute:return i=1,n.expression instanceof Qo&&!KX(n.expression)&&(i+=n.expression.expressions.length),i;case V.Property:case V.DomProperty:return i=1,n.expression instanceof Qo&&(i+=n.expression.expressions.length),i;case V.Control:return 2;case V.TwoWayProperty:return 1;case V.StyleProp:case V.ClassProp:case V.StyleMap:case V.ClassMap:return i=2,n.expression instanceof Qo&&(i+=n.expression.expressions.length),i;case V.InterpolateText:return n.interpolation.expressions.length;case V.I18nExpression:case V.Conditional:case V.DeferWhen:case V.StoreLet:return 1;case V.RepeaterCreate:return n.emptyView?1:0;default:throw new Error(`Unhandled op: ${V[n.kind]}`)}}function _N(n){switch(n.kind){case Qt.PureFunctionExpr:return 1+n.args.length;case Qt.PipeBinding:return 1+n.args.length;case Qt.PipeBindingVariadic:return 1+n.numArgs;case Qt.StoreLet:case Qt.ArrowFunction:return 1;default:throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${n.constructor.name}`)}}function KX(n){return!(n.expressions.length!==1||n.strings.length!==2||n.strings[0]!==""||n.strings[1]!=="")}function YX(n){for(let i of n.units){for(let e of i.functions)Ug(e.ops);Ug(i.create),Ug(i.update);for(let e of i.create)e.kind===V.Listener||e.kind===V.Animation||e.kind===V.AnimationListener||e.kind===V.TwoWayListener?Ug(e.handlerOps):e.kind===V.RepeaterCreate&&e.trackByOps!==null&&Ug(e.trackByOps);for(let e of i.functions)Gg(e.ops,null),vN(e.ops);for(let e of i.create)e.kind===V.Listener||e.kind===V.Animation||e.kind===V.AnimationListener||e.kind===V.TwoWayListener?(Gg(e.handlerOps,VC),vN(e.handlerOps)):e.kind===V.RepeaterCreate&&e.trackByOps!==null&&Gg(e.trackByOps,VC);Gg(i.create,VC),Gg(i.update,VC)}}var Fr=(function(n){return n[n.None=0]="None",n[n.ViewContextRead=1]="ViewContextRead",n[n.ViewContextWrite=2]="ViewContextWrite",n[n.SideEffectful=4]="SideEffectful",n})(Fr||{});function VC(n){return!(n&Wn.InArrowFunctionOperation)}function Ug(n){let i=new Map;for(let e of n)e.kind===V.Variable&&e.flags&Zs.AlwaysInline&&(mr(e,t=>{if(Ec(t)&&DE(t)!==Fr.None)throw new Error("AssertionError: A context-sensitive variable was marked AlwaysInline")}),i.set(e.xref,e)),Xo(e,t=>t instanceof bd&&i.has(t.xref)?i.get(t.xref).initializer.clone():t,Wn.None);for(let e of i.values())qe.remove(e)}function Gg(n,i){let e=new Map,t=new Map,o=new Set,r=new Map;for(let u of n){if(u.kind===V.Variable){if(e.has(u.xref)||t.has(u.xref))throw new Error(`Should not see two declarations of the same variable: ${u.xref}`);e.set(u.xref,u),t.set(u.xref,0)}r.set(u,ZX(u,i)),JX(u,t,o,i)}let a=!1;for(let u of n.reversed()){let h=r.get(u);if(u.kind===V.Variable&&t.get(u.xref)===0){if(a&&h.fences&Fr.ViewContextWrite||h.fences&Fr.SideEffectful){let _=Is(u.initializer.toStmt());r.set(_,h),qe.replace(u,_)}else eK(u,t),qe.remove(u);r.delete(u),e.delete(u.xref),t.delete(u.xref);continue}h.fences&Fr.ViewContextRead&&(a=!0)}let c=[];for(let[u,h]of t){let S=!!(e.get(u).flags&Zs.AlwaysInline);h!==1||S||o.has(u)||c.push(u)}let p;for(;p=c.pop();){let u=e.get(p),h=r.get(u);if(!!(u.flags&Zs.AlwaysInline))throw new Error("AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.");for(let S=u.next;S.kind!==V.ListEnd;S=S.next){let x=r.get(S);if(x.variablesUsed.has(p)){if(!nK(u,S))break;if(tK(p,u.initializer,S,h.fences)){x.variablesUsed.delete(p);for(let b of h.variablesUsed)x.variablesUsed.add(b);x.fences|=h.fences,e.delete(p),t.delete(p),r.delete(u),qe.remove(u)}break}if(!qF(x.fences,h.fences))break}}}function DE(n){switch(n.kind){case Qt.NextContext:return Fr.ViewContextRead|Fr.ViewContextWrite;case Qt.RestoreView:return Fr.ViewContextRead|Fr.ViewContextWrite|Fr.SideEffectful;case Qt.StoreLet:return Fr.SideEffectful;case Qt.Reference:case Qt.ContextLetReference:return Fr.ViewContextRead;default:return Fr.None}}function ZX(n,i){let e=Fr.None,t=new Set;return mr(n,(o,r)=>{!Ec(o)||i!==null&&!i(r)||(o.kind===Qt.ReadVariable?t.add(o.xref):e|=DE(o))}),{fences:e,variablesUsed:t}}function JX(n,i,e,t){mr(n,(o,r)=>{if(!Ec(o)||t!==null&&!t(r)||o.kind!==Qt.ReadVariable)return;let a=i.get(o.xref);a!==void 0&&(i.set(o.xref,a+1),r&Wn.InChildOperation&&e.add(o.xref))})}function eK(n,i){mr(n,e=>{if(!Ec(e)||e.kind!==Qt.ReadVariable)return;let t=i.get(e.xref);if(t!==void 0){if(t===0)throw new Error(`Inaccurate variable count: ${e.xref} - found another read but count is already 0`);i.set(e.xref,t-1)}})}function qF(n,i){if(n&Fr.ViewContextWrite){if(i&Fr.ViewContextRead)return!1}else if(n&Fr.ViewContextRead&&i&Fr.ViewContextWrite)return!1;return!0}function tK(n,i,e,t){let o=!1,r=!0;return Xo(e,(a,c)=>{if(!Ec(a)||o||!r)return a;if(c&Wn.InChildOperation&&t&Fr.ViewContextRead)return a;switch(a.kind){case Qt.ReadVariable:if(a.xref===n)return o=!0,i;break;default:let p=DE(a);r=r&&qF(p,t);break}return a},Wn.None),o}function nK(n,i){switch(n.variable.kind){case Wr.Identifier:return n.initializer instanceof Nl&&n.initializer.name===Ps;case Wr.Context:return i.kind===V.Variable;default:return!0}}function vN(n){let i=n.head.next,e=n.tail.prev;i!==null&&e!==null&&i.next===e&&i.kind===V.Statement&&i.statement instanceof sa&&i.statement.expr instanceof W_&&e.kind===V.Statement&&e.statement instanceof xr&&e.statement.value instanceof I1&&(qe.remove(i),e.statement.value=e.statement.value.expr)}function iK(n){for(let i of n.units){let e=null,t=null;for(let o of i.create)switch(o.kind){case V.I18nStart:e=o;break;case V.I18nEnd:e=null;break;case V.IcuStart:e===null&&(t=n.allocateXrefId(),qe.insertBefore(rb(t,o.message,void 0,null),o));break;case V.IcuEnd:t!==null&&(qe.insertAfter(ab(t,null),o),t=null);break}}}function oK(n){for(let i of n.units){for(let e of i.create)e.kind!==V.Animation&&e.kind!==V.AnimationListener&&e.kind!==V.Listener&&e.kind!==V.TwoWayListener&&CN(i,e);for(let e of i.update)CN(i,e)}}function CN(n,i){Xo(i,(e,t)=>{if(!(e instanceof eu)||t&Wn.InChildOperation)return e;if(Array.isArray(e.body))throw new Error("AssertionError: unexpected multi-line arrow function");let o=new CT(e.params,e.body);return n.functions.add(o),o},Wn.None)}var rK=new Set(["formField"]);function aK(n){for(let i of n.units)sK(i)}function sK(n){for(let i of n.update)i.kind===V.Property&&rK.has(i.name)&&mK(n,i)}var lK=new Set([V.Container,V.ContainerStart,V.ContainerEnd,V.Element,V.ElementStart,V.ElementEnd,V.Template]);function cK(n){return lK.has(n.kind)}function dK(n,i){let e=null;for(let t of n.create)!cK(t)||t.xref!==i||(e=t);return e}function mK(n,i){let e=dK(n,i.target);if(e===null)throw new Error(`No create instruction found for control target ${i.target}`);let t=zU(i.sourceSpan);qe.insertAfter(t,e),qe.insertAfter(bU(i.target,i.sourceSpan),i)}var pK=[{kind:Et.Tmpl,fn:Iq},{kind:Et.Both,fn:Uq},{kind:Et.Host,fn:UG},{kind:Et.Tmpl,fn:hq},{kind:Et.Tmpl,fn:Vq},{kind:Et.Tmpl,fn:iK},{kind:Et.Both,fn:pG},{kind:Et.Both,fn:$X},{kind:Et.Both,fn:YU},{kind:Et.Tmpl,fn:aK},{kind:Et.Both,fn:lG},{kind:Et.Both,fn:QU},{kind:Et.Tmpl,fn:mG},{kind:Et.Both,fn:gq},{kind:Et.Tmpl,fn:bX},{kind:Et.Both,fn:eG},{kind:Et.Both,fn:Pq},{kind:Et.Tmpl,fn:tG},{kind:Et.Tmpl,fn:Nq},{kind:Et.Tmpl,fn:uG},{kind:Et.Tmpl,fn:Lq},{kind:Et.Both,fn:oK},{kind:Et.Both,fn:jq},{kind:Et.Tmpl,fn:zG},{kind:Et.Tmpl,fn:BG},{kind:Et.Tmpl,fn:jG},{kind:Et.Tmpl,fn:NX},{kind:Et.Both,fn:$U},{kind:Et.Both,fn:kX},{kind:Et.Tmpl,fn:WX},{kind:Et.Tmpl,fn:yX},{kind:Et.Both,fn:PX},{kind:Et.Tmpl,fn:hG},{kind:Et.Tmpl,fn:qX},{kind:Et.Tmpl,fn:UX},{kind:Et.Both,fn:wX},{kind:Et.Both,fn:OX},{kind:Et.Tmpl,fn:pq},{kind:Et.Both,fn:CG},{kind:Et.Both,fn:VX},{kind:Et.Both,fn:HX},{kind:Et.Both,fn:YX},{kind:Et.Both,fn:RX},{kind:Et.Tmpl,fn:mq},{kind:Et.Tmpl,fn:dG},{kind:Et.Tmpl,fn:SX},{kind:Et.Tmpl,fn:WU},{kind:Et.Tmpl,fn:UU},{kind:Et.Tmpl,fn:FX},{kind:Et.Tmpl,fn:TX},{kind:Et.Tmpl,fn:EX},{kind:Et.Tmpl,fn:NG},{kind:Et.Tmpl,fn:aq},{kind:Et.Tmpl,fn:$G},{kind:Et.Both,fn:rG},{kind:Et.Tmpl,fn:xX},{kind:Et.Both,fn:QX},{kind:Et.Tmpl,fn:VG},{kind:Et.Both,fn:_q},{kind:Et.Tmpl,fn:MX},{kind:Et.Tmpl,fn:bq},{kind:Et.Tmpl,fn:yq},{kind:Et.Tmpl,fn:vG},{kind:Et.Tmpl,fn:qU},{kind:Et.Tmpl,fn:wq},{kind:Et.Both,fn:zq},{kind:Et.Both,fn:hX},{kind:Et.Both,fn:JU}];function QF(n,i){for(let e of pK)(e.kind===i||e.kind===Et.Both)&&e.fn(n)}function uK(n,i){let e=KF(n.root);return XF(n.root,i),e}function XF(n,i){for(let e of n.job.units){if(e.parent!==n.xref)continue;XF(e,i);let t=KF(e);i.statements.push(t.toDeclStmt(t.name))}}function KF(n){if(n.fnName===null)throw new Error(`AssertionError: view ${n.xref} is unnamed`);let i=[];for(let r of n.create){if(r.kind!==V.Statement)throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${V[r.kind]}`);i.push(r.statement)}let e=[];for(let r of n.update){if(r.kind!==V.Statement)throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${V[r.kind]}`);e.push(r.statement)}let t=Q1(1,i),o=Q1(2,e);return am([new br(Vh,Bp),new br(Ps,is)],[...t,...o],void 0,void 0,n.fnName)}function Q1(n,i){return i.length===0?[]:[tb(new gi(st.BitwiseAnd,Yn(Vh),Te(n)),i)]}function hK(n){if(n.root.fnName===null)throw new Error("AssertionError: host binding function is unnamed");let i=[];for(let r of n.root.create){if(r.kind!==V.Statement)throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${V[r.kind]}`);i.push(r.statement)}let e=[];for(let r of n.root.update){if(r.kind!==V.Statement)throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${V[r.kind]}`);e.push(r.statement)}if(i.length===0&&e.length===0)return null;let t=Q1(1,i),o=Q1(2,e);return am([new br(Vh,Bp),new br(Ps,is)],[...t,...o],void 0,void 0,n.root.fnName)}var Lp=new Rh,Vp="ng-template",fK="animate.";function WC(n){return n instanceof za}function gK(n){return WC(n)&&n.nodes.length===1&&n.nodes[0]instanceof y1}function _K(n,i,e,t,o,r,a,c,p,u){let h=new K_(n,e,t,o,r,a,c,p,u);return Sd(h.root,i),h}function vK(n,i,e){let t=new V1(n.componentName,e,Za.DomOnly);for(let o of n.properties??[]){let r=jt.Property;o.name.startsWith("attr.")&&(o.name=o.name.substring(5),r=jt.Attribute),o.isLegacyAnimation&&(r=jt.LegacyAnimation),o.isAnimation&&(r=jt.Animation);let a=i.calcPossibleSecurityContexts(n.componentSelector,o.name,r===jt.Attribute).filter(c=>c!==eo.NONE);CK(t,o,r,a)}for(let[o,r]of Object.entries(n.attributes)??[]){let a=i.calcPossibleSecurityContexts(n.componentSelector,o,!0).filter(c=>c!==eo.NONE);bK(t,o,r,a)}for(let o of n.events??[])xK(t,o);return t}function CK(n,i,e,t){let o,r=i.expression.ast;r instanceof a0?o=new Qo(r.strings,r.expressions.map(a=>Bn(a,n,i.sourceSpan)),[]):o=Bn(r,n,i.sourceSpan),n.root.update.push(Xp(n.root.xref,e,i.name,o,null,t,!1,!1,null,null,i.sourceSpan))}function bK(n,i,e,t){let o=Xp(n.root.xref,jt.Attribute,i,e,null,t,!0,!1,null,null,e.sourceSpan);n.root.update.push(o)}function xK(n,i){let e;if(i.type===Ba.Animation)e=wF(n.root.xref,new la,i.name,null,t0(n.root,i.handler,i.handlerSpan),i.name.endsWith("enter")?"enter":"leave",i.targetOrPhase,!0,i.sourceSpan);else{let[t,o]=i.type!==Ba.LegacyAnimation?[null,i.targetOrPhase]:[i.targetOrPhase,null];e=kE(n.root.xref,new la,i.name,null,t0(n.root,i.handler,i.handlerSpan),t,o,!0,i.sourceSpan)}n.root.create.push(e)}function Sd(n,i){for(let e of i)if(e instanceof kc)yK(n,e);else if(e instanceof ks)SK(n,e);else if(e instanceof Dh)wK(n,e);else if(e instanceof Dp)YF(n,e,null);else if(e instanceof kh)ZF(n,e,null);else if(e instanceof b1)MK(n,e);else if(e instanceof C1)kK(n,e);else if(e instanceof qp)TK(n,e);else if(e instanceof XN)DK(n,e);else if(e instanceof Eh)PK(n,e);else if(e instanceof gE)AK(n,e);else if(!(e instanceof e_))throw new Error(`Unsupported template node: ${e.constructor.name}`)}function yK(n,i){if(i.i18n!==void 0&&!(i.i18n instanceof za||i.i18n instanceof lm))throw Error(`Unhandled i18n metadata type for element: ${i.i18n.constructor.name}`);let e=n.job.allocateXrefId(),[t,o]=Ll(i.name),r=yU(o,e,PF(t),i.i18n instanceof lm?i.i18n:void 0,i.startSourceSpan,i.sourceSpan);n.create.push(r),NK(n,r,i),t6(r,i);let a=null;i.i18n instanceof za&&(a=n.job.allocateXrefId(),n.create.push(rb(a,i.i18n,void 0,i.startSourceSpan))),Sd(n,i.children);let c=wU(e,i.endSourceSpan??i.startSourceSpan);n.create.push(c),a!==null&&qe.insertBefore(ab(a,i.endSourceSpan??i.startSourceSpan),c)}function SK(n,i){if(i.i18n!==void 0&&!(i.i18n instanceof za||i.i18n instanceof lm))throw Error(`Unhandled i18n metadata type for template: ${i.i18n.constructor.name}`);let e=n.job.allocateView(n.xref),t=i.tagName,o="";i.tagName&&([o,t]=Ll(i.tagName));let r=i.i18n instanceof lm?i.i18n:void 0,a=PF(o),c=t===null?"":oG(t,a),p=OK(i)?ns.NgTemplate:ns.Structural,u=bF(e.xref,p,t,c,a,r,i.startSourceSpan,i.sourceSpan);n.create.push(u),FK(n,u,i,p),t6(u,i),Sd(e,i.children);for(let{name:h,value:_}of i.variables)e.contextVariables.set(h,_!==""?_:"$implicit");if(p===ns.NgTemplate&&i.i18n instanceof za){let h=n.job.allocateXrefId();qe.insertAfter(rb(h,i.i18n,void 0,i.startSourceSpan),e.create.head),qe.insertBefore(ab(h,i.endSourceSpan??i.startSourceSpan),e.create.tail)}}function wK(n,i){if(i.i18n!==void 0&&!(i.i18n instanceof lm))throw Error(`Unhandled i18n metadata type for element: ${i.i18n.constructor.name}`);let e=null;i.children.some(r=>!(r instanceof ib)&&(!(r instanceof Dp)||r.value.trim().length>0))&&(e=n.job.allocateView(n.xref),Sd(e,i.children));let t=n.job.allocateXrefId(),o=AU(t,i.selector,i.i18n,e?.xref??null,i.sourceSpan);for(let r of i.attributes){let a=Lp.securityContext(i.name,r.name,!0);n.update.push(Xp(o.xref,jt.Attribute,r.name,Te(r.value),null,a,!0,!1,null,vd(r.i18n),r.sourceSpan))}n.create.push(o)}function YF(n,i,e){n.create.push(SF(n.job.allocateXrefId(),i.value,e,i.sourceSpan))}function ZF(n,i,e){let t=i.value;if(t instanceof ts&&(t=t.ast),!(t instanceof a0))throw new Error(`AssertionError: expected Interpolation for BoundText node, got ${t.constructor.name}`);if(i.i18n!==void 0&&!(i.i18n instanceof Cd))throw Error(`Unhandled i18n metadata type for text interpolation: ${i.i18n?.constructor.name}`);let o=i.i18n instanceof Cd?i.i18n.children.filter(a=>a instanceof R_).map(a=>a.name):[];if(o.length>0&&o.length!==t.expressions.length)throw Error(`Unexpected number of i18n placeholders (${t.expressions.length}) for BoundText with ${t.expressions.length} expressions`);let r=n.job.allocateXrefId();n.create.push(SF(r,"",e,i.sourceSpan)),n.update.push(lU(r,new Qo(t.strings,t.expressions.map(a=>Bn(a,n.job,null)),o),i.sourceSpan))}function MK(n,i){let e=null,t=[];for(let o=0;o<i.branches.length;o++){let r=i.branches[o],a=n.job.allocateView(n.xref),c=X1(n,a.xref,r);r.expressionAlias!==null&&a.contextVariables.set(r.expressionAlias.name,TF);let p;if(r.i18n!==void 0){if(!(r.i18n instanceof cm))throw Error(`Unhandled i18n metadata type for if block: ${r.i18n?.constructor.name}`);p=r.i18n}let h=(o===0?xF:yF)(a.xref,ns.Block,c,"Conditional",Ca.HTML,p,r.startSourceSpan,r.sourceSpan);n.create.push(h),e===null&&(e=a.xref);let _=r.expression?Bn(r.expression,n.job,null):null,S=new N1(_,h.xref,h.handle,r.expressionAlias);t.push(S),Sd(a,r.children)}n.update.push(_F(e,null,t,i.sourceSpan))}function kK(n,i){if(i.groups.length===0)return;let e=null,t=[];for(let o=0;o<i.groups.length;o++){let r=i.groups[o],a=n.job.allocateView(n.xref),c=X1(n,a.xref,r),p;if(r.i18n!==void 0){if(!(r.i18n instanceof cm))throw Error(`Unhandled i18n metadata type for switch block: ${r.i18n?.constructor.name}`);p=r.i18n}let h=(o===0?xF:yF)(a.xref,ns.Block,c,"Case",Ca.HTML,p,r.startSourceSpan,r.sourceSpan);n.create.push(h),e===null&&(e=a.xref);for(let _ of r.cases){let S=_.expression?Bn(_.expression,n.job,i.startSourceSpan):null,x=new N1(S,h.xref,h.handle);t.push(x)}Sd(a,r.children)}n.update.push(_F(e,Bn(i.expression,n.job,null),t,i.sourceSpan))}function BC(n,i,e,t,o){if(e!==void 0&&!(e instanceof cm))throw Error("Unhandled i18n metadata type for defer block");if(t===void 0)return null;let r=n.job.allocateView(n.xref);Sd(r,t);let a=bF(r.xref,ns.Block,null,`Defer${i}`,Ca.HTML,e,o,o);return n.create.push(a),a}function TK(n,i){let e=null;if(n.job.deferMeta.mode===0){if(!n.job.deferMeta.blocks.has(i))throw new Error("AssertionError: unable to find a dependency function for this deferred block");e=n.job.deferMeta.blocks.get(i)??null}let t=BC(n,"",i.i18n,i.children,i.sourceSpan),o=BC(n,"Loading",i.loading?.i18n,i.loading?.children,i.loading?.sourceSpan),r=BC(n,"Placeholder",i.placeholder?.i18n,i.placeholder?.children,i.placeholder?.sourceSpan),a=BC(n,"Error",i.error?.i18n,i.error?.children,i.error?.sourceSpan),c=n.job.allocateXrefId(),p=OU(c,t.xref,t.handle,e,n.job.allDeferrableDepsFn,i.sourceSpan);p.placeholderView=r?.xref??null,p.placeholderSlot=r?.handle??null,p.loadingSlot=o?.handle??null,p.errorSlot=a?.handle??null,p.placeholderMinimumTime=i.placeholder?.minimumTime??null,p.loadingMinimumTime=i.loading?.minimumTime??null,p.loadingAfterTime=i.loading?.afterTime??null,p.flags=EK(i),n.create.push(p);let u=[],h=[];wk("hydrate",i.hydrateTriggers,u,h,n,c),wk("none",i.triggers,u,h,n,c),wk("prefetch",i.prefetchTriggers,u,h,n,c),u.some(S=>S.modifier==="none")||h.some(S=>S.modifier==="none")||u.push(Zd(c,{kind:Ji.Idle},"none",null)),n.create.push(u),n.update.push(h)}function EK(n){return Object.keys(n.hydrateTriggers).length>0?1:null}function wk(n,i,e,t,o,r){if(i.idle!==void 0){let a=Zd(r,{kind:Ji.Idle},n,i.idle.sourceSpan);e.push(a)}if(i.immediate!==void 0){let a=Zd(r,{kind:Ji.Immediate},n,i.immediate.sourceSpan);e.push(a)}if(i.timer!==void 0){let a=Zd(r,{kind:Ji.Timer,delay:i.timer.delay},n,i.timer.sourceSpan);e.push(a)}if(i.hover!==void 0){let a=Zd(r,{kind:Ji.Hover,targetName:i.hover.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null},n,i.hover.sourceSpan);e.push(a)}if(i.interaction!==void 0){let a=Zd(r,{kind:Ji.Interaction,targetName:i.interaction.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null},n,i.interaction.sourceSpan);e.push(a)}if(i.viewport!==void 0){let a=Zd(r,{kind:Ji.Viewport,targetName:i.viewport.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null,options:i.viewport.options?Bn(i.viewport.options,o.job,i.viewport.sourceSpan):null},n,i.viewport.sourceSpan);e.push(a)}if(i.never!==void 0){let a=Zd(r,{kind:Ji.Never},n,i.never.sourceSpan);e.push(a)}if(i.when!==void 0){if(i.when.value instanceof a0)throw new Error("Unexpected interpolation in defer block when trigger");let a=_U(r,Bn(i.when.value,o.job,i.when.sourceSpan),n,i.when.sourceSpan);t.push(a)}}function DK(n,i){if(i.i18n instanceof za&&gK(i.i18n)){let e=n.job.allocateXrefId();n.create.push(RU(e,i.i18n,ZN(i.i18n).name,null));for(let[t,o]of Object.entries(K(K({},i.vars),i.placeholders)))o instanceof kh?ZF(n,o,t):YF(n,o,t);n.create.push(LU(e))}else throw Error(`Unhandled i18n metadata type for ICU: ${i.i18n?.constructor.name}`)}function PK(n,i){let e=n.job.allocateView(n.xref),t=`\u0275$index_${e.xref}`,o=`\u0275$count_${e.xref}`,r=new Set;e.contextVariables.set(i.item.name,i.item.value);for(let y of i.contextVariables)y.value==="$index"&&r.add(y.name),y.name==="$index"?e.contextVariables.set("$index",y.value).set(t,y.value):y.name==="$count"?e.contextVariables.set("$count",y.value).set(o,y.value):e.aliases.add({kind:Wr.Alias,name:null,identifier:y.name,expression:IK(y,t,o)});let a=Or(i.trackBy.span,i.sourceSpan),c=Bn(i.trackBy,n.job,a);Sd(e,i.children);let p=null,u=null;i.empty!==null&&(p=n.job.allocateView(n.xref),Sd(p,i.empty.children),u=X1(n,p.xref,i.empty));let h={$index:r,$implicit:i.item.name};if(i.i18n!==void 0&&!(i.i18n instanceof cm))throw Error("AssertionError: Unhandled i18n metadata type or @for");if(i.empty?.i18n!==void 0&&!(i.empty.i18n instanceof cm))throw Error("AssertionError: Unhandled i18n metadata type or @empty");let _=i.i18n,S=i.empty?.i18n,x=X1(n,e.xref,i),b=SU(e.xref,p?.xref??null,x,c,h,u,_,S,i.startSourceSpan,i.sourceSpan);n.create.push(b);let M=Bn(i.expression,n.job,Or(i.expression.span,i.sourceSpan)),w=gU(b.xref,b.handle,M,i.sourceSpan);n.update.push(w)}function IK(n,i,e){switch(n.value){case"$index":return new Ur(i);case"$count":return new Ur(e);case"$first":return new Ur(i).identical(Te(0));case"$last":return new Ur(i).identical(new Ur(e).minus(Te(1)));case"$even":return new Ur(i).modulo(Te(2)).identical(Te(0));case"$odd":return new Ur(i).modulo(Te(2)).notIdentical(Te(0));default:throw new Error(`AssertionError: unknown @for loop variable ${n.value}`)}}function AK(n,i){let e=n.job.allocateXrefId();n.create.push(NU(e,i.name,i.sourceSpan)),n.update.push(CU(e,i.name,Bn(i.value,n.job,i.valueSpan),i.sourceSpan))}function Bn(n,i,e){if(n instanceof ts)return Bn(n.ast,i,e);if(n instanceof Cc)return n.receiver instanceof Mc?new Ur(n.name):new Es(Bn(n.receiver,i,e),n.name,null,Or(n.span,e));if(n instanceof wh){if(n.receiver instanceof Mc)throw new Error("Unexpected ImplicitReceiver");return new os(Bn(n.receiver,i,e),n.args.map(t=>Bn(t,i,e)),void 0,Or(n.span,e))}else{if(n instanceof Ja)return Te(n.value,void 0,Or(n.span,e));if(n instanceof gh)switch(n.operator){case"+":return new jp(l_.Plus,Bn(n.expr,i,e),void 0,Or(n.span,e));case"-":return new jp(l_.Minus,Bn(n.expr,i,e),void 0,Or(n.span,e));default:throw new Error(`AssertionError: unknown unary operator ${n.operator}`)}else if(n instanceof Na){let t=nG.get(n.operation);if(t===void 0)throw new Error(`AssertionError: unknown binary operator ${n.operation}`);return new gi(t,Bn(n.left,i,e),Bn(n.right,i,e),void 0,Or(n.span,e))}else{if(n instanceof g_)return new pm(i.root.xref);if(n instanceof Gp)return new xd(Bn(n.receiver,i,e),Bn(n.key,i,e),void 0,Or(n.span,e));if(n instanceof Sh)throw new Error("AssertionError: Chain in unknown context");if(n instanceof Wp){let t=n.keys.map((o,r)=>{let a=Bn(n.values[r],i,e);return o.kind==="spread"?new rm(a):new xh(o.key,a,o.quoted)});return new Rl(t,void 0,Or(n.span,e))}else{if(n instanceof C_)return new wc(n.expressions.map(t=>Bn(t,i,e)));if(n instanceof s1)return new Sc(Bn(n.condition,i,e),Bn(n.trueExp,i,e),Bn(n.falseExp,i,e),void 0,Or(n.span,e));if(n instanceof S_)return Bn(n.expression,i,e);if(n instanceof l1)return new Yp(i.allocateXrefId(),new la,n.name,[Bn(n.exp,i,e),...n.args.map(t=>Bn(t,i,e))]);if(n instanceof v_)return new Oh(Bn(n.receiver,i,e),Bn(n.key,i,e),Or(n.span,e));if(n instanceof __)return new Ah(Bn(n.receiver,i,e),n.name);if(n instanceof d1)return new Zp(Bn(n.receiver,i,e),n.args.map(t=>Bn(t,i,e)));if(n instanceof _a)return new Q_(Or(n.span,e));if(n instanceof b_)return x$(Bn(n.expression,i,e),Or(n.span,e));if(n instanceof x_)return r0(Bn(n.expression,i,e));if(n instanceof y_)return new ZC(Bn(n.expression,i,e),void 0,Or(n.span,e));if(n instanceof M_)return bN(n,i,e);if(n instanceof w_)return new c_(Bn(n.tag,i,e),bN(n.template,i,e),void 0,Or(n.span,e));if(n instanceof k_)return new Fl(Bn(n.expression,i,e),void 0,Or(n.span,e));if(n instanceof u1)return new bh(n.body,n.flags,e);if(n instanceof c1)return new $p(Bn(n.expression,i,e));if(n instanceof p1)return LK(Ds(n.parameters.map(t=>new br(t.name,is)),Bn(n.body,i,e)));throw new Error(`Unhandled expression type "${n.constructor.name}" in file "${e?.start.file.url}"`)}}}}function bN(n,i,e){return new m_(n.elements.map(t=>new JC(t.text,Or(t.span,e))),n.expressions.map(t=>Bn(t,i,e)),Or(n.span,e))}function GT(n,i,e,t){let o;return i instanceof a0?o=new Qo(i.strings,i.expressions.map(r=>Bn(r,n,null)),Object.keys(vd(e)?.placeholders??{})):i instanceof to?o=Bn(i,n,null):o=Te(i),o}var JF=new Map([[Ti.Property,jt.Property],[Ti.TwoWay,jt.TwoWayProperty],[Ti.Attribute,jt.Attribute],[Ti.Class,jt.ClassName],[Ti.Style,jt.StyleProperty],[Ti.LegacyAnimation,jt.LegacyAnimation],[Ti.Animation,jt.Animation]]);function OK(n){return Ll(n.tagName??"")[1]===Vp}function vd(n){if(n==null)return null;if(!(n instanceof za))throw Error(`Expected i18n meta to be a Message, but got: ${n.constructor.name}`);return n}function NK(n,i,e){let t=new Array,o=new Set;for(let r of e.attributes){let a=Lp.securityContext(e.name,r.name,!0);t.push(Xp(i.xref,jt.Attribute,r.name,GT(n.job,r.value,r.i18n),null,a,!0,!1,null,vd(r.i18n),r.sourceSpan)),r.i18n&&o.add(r.name)}for(let r of e.inputs)o.has(r.name)&&console.error(`On component ${n.job.componentName}, the binding ${r.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`),t.push(Xp(i.xref,JF.get(r.type),r.name,GT(n.job,n0(r.value),r.i18n),r.unit,r.securityContext,!1,!1,null,vd(r.i18n)??null,r.sourceSpan));n.create.push(t.filter(r=>r?.kind===V.ExtractedAttribute)),n.update.push(t.filter(r=>r?.kind===V.Binding));for(let r of e.outputs){if(r.type===Ba.LegacyAnimation&&r.phase===null)throw Error("Animation listener should have a phase");r.type===Ba.TwoWay?n.create.push(MF(i.xref,i.handle,r.name,i.tag,e6(n,r.handler,r.handlerSpan),r.sourceSpan)):r.type===Ba.Animation?n.create.push(wF(i.xref,i.handle,r.name,i.tag,t0(n,r.handler,r.handlerSpan),r.name.endsWith("enter")?"enter":"leave",r.target,!1,r.sourceSpan)):n.create.push(kE(i.xref,i.handle,r.name,i.tag,t0(n,r.handler,r.handlerSpan),r.phase,r.target,!1,r.sourceSpan))}t.some(r=>r?.i18nMessage)!==null&&n.create.push(kF(n.job.allocateXrefId(),new la,i.xref))}function FK(n,i,e,t){let o=new Array;for(let r of e.templateAttrs)if(r instanceof Th){let a=Lp.securityContext(Vp,r.name,!0);o.push(zC(n,i.xref,Ti.Attribute,r.name,r.value,null,a,!0,t,vd(r.i18n),r.sourceSpan))}else o.push(zC(n,i.xref,r.type,r.name,n0(r.value),r.unit,r.securityContext,!0,t,vd(r.i18n),r.sourceSpan));for(let r of e.attributes){let a=Lp.securityContext(Vp,r.name,!0);o.push(zC(n,i.xref,Ti.Attribute,r.name,r.value,null,a,!1,t,vd(r.i18n),r.sourceSpan))}for(let r of e.inputs)o.push(zC(n,i.xref,r.type,r.name,n0(r.value),r.unit,r.securityContext,!1,t,vd(r.i18n),r.sourceSpan));n.create.push(o.filter(r=>r?.kind===V.ExtractedAttribute)),n.update.push(o.filter(r=>r?.kind===V.Binding));for(let r of e.outputs){if(r.type===Ba.LegacyAnimation&&r.phase===null)throw Error("Animation listener should have a phase");if(t===ns.NgTemplate&&(r.type===Ba.TwoWay?n.create.push(MF(i.xref,i.handle,r.name,i.tag,e6(n,r.handler,r.handlerSpan),r.sourceSpan)):n.create.push(kE(i.xref,i.handle,r.name,i.tag,t0(n,r.handler,r.handlerSpan),r.phase,r.target,!1,r.sourceSpan))),t===ns.Structural&&r.type!==Ba.LegacyAnimation){let a=Lp.securityContext(Vp,r.name,!1);n.create.push(Js(i.xref,jt.Property,null,r.name,null,null,null,a))}}o.some(r=>r?.i18nMessage)!==null&&n.create.push(kF(n.job.allocateXrefId(),new la,i.xref))}function zC(n,i,e,t,o,r,a,c,p,u,h){let _=typeof o=="string";if(p===ns.Structural){if(!c)switch(e){case Ti.Property:case Ti.Class:case Ti.Style:return Js(i,jt.Property,null,t,null,null,u,a);case Ti.TwoWay:return Js(i,jt.TwoWayProperty,null,t,null,null,u,a)}if(!_&&(e===Ti.Attribute||e===Ti.LegacyAnimation||e===Ti.Animation))return null}let S=JF.get(e);return p===ns.NgTemplate&&(e===Ti.Class||e===Ti.Style||e===Ti.Attribute&&!_)&&(S=jt.Property),Xp(i,S,t,GT(n.job,o,u),r,a,_,c,p,u,h)}function t0(n,i,e){i=n0(i);let t=new Array,o=i instanceof Sh?i.expressions:[i];if(o.length===0)throw new Error("Expected listener to have non-empty expression list.");let r=o.map(c=>Bn(c,n.job,e)),a=r.pop();return t.push(...r.map(c=>Is(new sa(c,c.sourceSpan)))),t.push(Is(new xr(a,a.sourceSpan))),t}function e6(n,i,e){i=n0(i);let t=new Array;if(i instanceof Sh)if(i.expressions.length===1)i=i.expressions[0];else throw new Error("Expected two-way listener to have a single expression.");let o=Bn(i,n.job,e),r=new Ur("$event"),a=new A1(o,r);return t.push(Is(new sa(a))),t.push(Is(new xr(r))),t}function n0(n){return n instanceof ts?n.ast:n}function t6(n,i){RK(n.localRefs);for(let{name:e,value:t}of i.references)n.localRefs.push({name:e,target:t})}function RK(n){if(!Array.isArray(n))throw new Error("AssertionError: expected an array")}function Or(n,i){if(i===null)return null;let e=i.start.moveBy(n.start),t=i.start.moveBy(n.end),o=i.fullStart.moveBy(n.start);return new gn(e,t,o)}function X1(n,i,e){let t=null;for(let o of e.children)if(!(o instanceof ib||o instanceof gE)){if(t!==null)return null;if(o instanceof kc||o instanceof ks&&o.tagName!==null)t=o;else return null}if(t!==null){for(let r of t.attributes)if(!r.name.startsWith(fK)){let a=Lp.securityContext(Vp,r.name,!0);n.update.push(Xp(i,jt.Attribute,r.name,Te(r.value),null,a,!0,!1,null,vd(r.i18n),r.sourceSpan))}for(let r of t.inputs)if(r.type!==Ti.LegacyAnimation&&r.type!==Ti.Animation&&r.type!==Ti.Attribute){let a=Lp.securityContext(Vp,r.name,!0);n.create.push(Js(i,jt.Property,null,r.name,null,null,null,a))}let o=t instanceof kc?t.name:t.tagName;return o===Vp?null:o}return null}function LK(n){let i=new Set(n.params.map(e=>e.name));return Vt(n,e=>{if(e instanceof eu)for(let t of e.params)i.add(t.name);else if(e instanceof Ur&&i.has(e.name))return Yn(e.name);return e},Wn.None)}var VK=!1;function BK(){return VK}function K1(n,i){return tb(Yn(Vh).bitwiseAnd(Te(n),null),i)}function zK(n){return(n.descendants?1:0)|(n.static?2:0)|(n.emitDistinctChangesOnly?4:0)}function jK(n,i){if(Array.isArray(n.predicate)){let e=[];return n.predicate.forEach(t=>{let o=t.split(",").map(r=>Te(r.trim()));e.push(...o)}),i.getConstLiteral(Gi(e),!0)}else switch(n.predicate.forwardRef){case 0:case 2:return n.predicate.expression;case 1:return Ut(fe.resolveForwardRef).callFn([n.predicate.expression])}}function n6(n,i,e){let t=[];return e!==void 0&&t.push(...e),n.isSignal&&t.push(new Es(Yn(Ps),n.propertyName)),t.push(jK(n,i),Te(zK(n))),n.read&&t.push(n.read),t}var PE=Symbol("queryAdvancePlaceholder");function i6(n){let i=[],e=0,t=()=>{e>0&&(i.unshift(Ut(fe.queryAdvance).callFn(e===1?[]:[Te(e)]).toStmt()),e=0)};for(let o=n.length-1;o>=0;o--){let r=n[o];r===PE?e++:(t(),i.unshift(r))}return t(),i}function $K(n,i,e){let t=[],o=[],r=JN(u=>o.push(u),vE),a=null,c=null;n.forEach(u=>{let h=n6(u,i);if(u.isSignal?(a??=Ut(fe.viewQuerySignal),a=a.callFn(h)):(c??=Ut(fe.viewQuery),c=c.callFn(h)),u.isSignal){o.push(PE);return}let _=r(),S=Ut(fe.loadQuery).callFn([]),x=Ut(fe.queryRefresh).callFn([_.set(S)]),b=Yn(Ps).prop(u.propertyName).set(u.first?_.prop("first"):_);o.push(x.and(b).toStmt())}),a!==null&&t.push(new sa(a)),c!==null&&t.push(new sa(c));let p=e?`${e}_Query`:null;return am([new br(Vh,Bp),new br(Ps,is)],[K1(1,t),K1(2,i6(o))],Ol,null,p)}function HK(n,i,e){let t=[],o=[],r=JN(u=>o.push(u),vE),a=null,c=null;for(let u of n){let h=n6(u,i,[Yn("dirIndex")]);if(u.isSignal?(a??=Ut(fe.contentQuerySignal),a=a.callFn(h)):(c??=Ut(fe.contentQuery),c=c.callFn(h)),u.isSignal){o.push(PE);continue}let _=r(),S=Ut(fe.loadQuery).callFn([]),x=Ut(fe.queryRefresh).callFn([_.set(S)]),b=Yn(Ps).prop(u.propertyName).set(u.first?_.prop("first"):_);o.push(x.and(b).toStmt())}a!==null&&t.push(new sa(a)),c!==null&&t.push(new sa(c));let p=e?`${e}_ContentQueries`:null;return am([new br(Vh,Bp),new br(Ps,is),new br("dirIndex",Bp)],[K1(1,t),K1(2,i6(o))],Ol,null,p)}var WT=class extends rW{constructor(){super(VT)}parse(i,e,t){return super.parse(i,e,t)}},jC=".",UK="attr",Mk="animate",GK="class",WK="style",qK="*",kk="animate-",qT=class{_exprParser;_schemaRegistry;errors;constructor(i,e,t){this._exprParser=i,this._schemaRegistry=e,this.errors=t}createBoundHostProperties(i,e){let t=[];for(let o of Object.keys(i)){let r=i[o];typeof r=="string"?this.parsePropertyBinding(o,r,!0,!1,e,e.start.offset,void 0,[],t,e):this._reportError(`Value of the host property binding "${o}" needs to be a string representing an expression but got "${r}" (${typeof r})`,e)}return t}createDirectiveHostEventAsts(i,e){let t=[];for(let o of Object.keys(i)){let r=i[o];typeof r=="string"?this.parseEvent(o,r,!1,e,e,[],t,e):this._reportError(`Value of the host listener "${o}" needs to be a string representing an expression but got "${r}" (${typeof r})`,e)}return t}parseInterpolation(i,e,t){let o=e.fullStart.offset;try{let r=this._exprParser.parseInterpolation(i,e,o,t);return r&&this.errors.push(...r.errors),r}catch(r){return this._reportError(`${r}`,e),this._exprParser.wrapLiteralPrimitive("ERROR",e,o)}}parseInterpolationExpression(i,e){let t=e.start.offset;try{let o=this._exprParser.parseInterpolationExpression(i,e,t);return o&&this.errors.push(...o.errors),o}catch(o){return this._reportError(`${o}`,e),this._exprParser.wrapLiteralPrimitive("ERROR",e,t)}}parseInlineTemplateBinding(i,e,t,o,r,a,c,p){let u=t.start.offset+qK.length,h=this._parseTemplateBindings(i,e,t,u,o);for(let _ of h){let S=Kd(t,_.sourceSpan),x=_.key.source,b=Kd(t,_.key.span);if(_ instanceof T_){let M=_.value?_.value.source:"$implicit",w=_.value?Kd(t,_.value.span):void 0;c.push(new Qk(x,M,S,b,w))}else if(_.value){let M=p?S:t,w=Kd(t,_.value.ast.sourceSpan);this._parsePropertyAst(x,_.value,!1,M,b,w,r,a)}else r.push([x,""]),this.parseLiteralAttr(x,null,b,o,void 0,r,a,b)}}_parseTemplateBindings(i,e,t,o,r){try{let a=this._exprParser.parseTemplateBindings(i,e,t,o,r);return a.errors.forEach(c=>this.errors.push(c)),a.warnings.forEach(c=>{this._reportError(c,t,nm.WARNING)}),a.templateBindings}catch(a){return this._reportError(`${a}`,t),[]}}parseLiteralAttr(i,e,t,o,r,a,c,p){Tk(i)?(i=i.substring(1),p!==void 0&&(p=Kd(p,new Ms(p.start.offset+1,p.end.offset))),e&&this._reportError('Assigning animation triggers via @prop="exp" attributes with an expression is invalid. Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.',t,nm.ERROR),this._parseLegacyAnimation(i,e,t,o,p,r,a,c)):c.push(new dh(i,this._exprParser.wrapLiteralPrimitive(e,"",o),fc.LITERAL_ATTR,t,p,r))}parsePropertyBinding(i,e,t,o,r,a,c,p,u,h){i.length===0&&this._reportError("Property name is missing in binding",r);let _=!1;i.startsWith(kk)?(_=!0,i=i.substring(kk.length),h!==void 0&&(h=Kd(h,new Ms(h.start.offset+kk.length,h.end.offset)))):Tk(i)&&(_=!0,i=i.substring(1),h!==void 0&&(h=Kd(h,new Ms(h.start.offset+1,h.end.offset)))),_?this._parseLegacyAnimation(i,e,r,a,h,c,p,u):i.startsWith(`${Mk}${jC}`)?this._parseAnimation(i,this.parseBinding(e,t,c||r,a),r,h,c,p,u):this._parsePropertyAst(i,this.parseBinding(e,t,c||r,a),o,r,h,c,p,u)}parsePropertyInterpolation(i,e,t,o,r,a,c,p){let u=this.parseInterpolation(e,o||t,p);return u?(this._parsePropertyAst(i,u,!1,t,c,o,r,a),!0):!1}_parsePropertyAst(i,e,t,o,r,a,c,p){c.push([i,e.source]),p.push(new dh(i,e,t?fc.TWO_WAY:fc.DEFAULT,o,r,a))}_parseAnimation(i,e,t,o,r,a,c){a.push([i,e.source]),c.push(new dh(i,e,fc.ANIMATION,t,o,r))}_parseLegacyAnimation(i,e,t,o,r,a,c,p){i.length===0&&this._reportError("Animation trigger is missing",t);let u=this.parseBinding(e||"undefined",!1,a||t,o);c.push([i,u.source]),p.push(new dh(i,u,fc.LEGACY_ANIMATION,t,r,a))}parseBinding(i,e,t,o){try{let r=e?this._exprParser.parseSimpleBinding(i,t,o):this._exprParser.parseBinding(i,t,o);return r&&this.errors.push(...r.errors),r}catch(r){return this._reportError(`${r}`,t),this._exprParser.wrapLiteralPrimitive("ERROR",t,o)}}createBoundElementProperty(i,e,t=!1,o=!0){if(e.isLegacyAnimation)return new f1(e.name,Ti.LegacyAnimation,eo.NONE,e.expression,null,e.sourceSpan,e.keySpan,e.valueSpan);let r=null,a,c=null,p=e.name.split(jC),u;if(p.length>1)if(p[0]==UK){c=p.slice(1).join(jC),t||this._validatePropertyOrAttributeName(c,e.sourceSpan,!0),u=Ek(this._schemaRegistry,i,c,!0);let h=c.indexOf(":");if(h>-1){let _=c.substring(0,h),S=c.substring(h+1);c=UC(_,S)}a=Ti.Attribute}else p[0]==GK?(c=p[1],a=Ti.Class,u=[eo.NONE]):p[0]==WK?(r=p.length>2?p[2]:null,c=p[1],a=Ti.Style,u=[eo.STYLE]):p[0]==Mk&&(c=e.name,a=Ti.Animation,u=[eo.NONE]);if(c===null){let h=this._schemaRegistry.getMappedPropName(e.name);c=o?h:e.name,u=Ek(this._schemaRegistry,i,h,!1),a=e.type===fc.TWO_WAY?Ti.TwoWay:Ti.Property,t||this._validatePropertyOrAttributeName(h,e.sourceSpan,!1)}return new f1(c,a,u[0],e.expression,r,e.sourceSpan,e.keySpan,e.valueSpan)}parseEvent(i,e,t,o,r,a,c,p){i.length===0&&this._reportError("Event name is missing in binding",o),Tk(i)?(i=i.slice(1),p!==void 0&&(p=Kd(p,new Ms(p.start.offset+1,p.end.offset))),this._parseLegacyAnimationEvent(i,e,o,r,c,p)):this._parseRegularEvent(i,e,t,o,r,a,c,p)}calcPossibleSecurityContexts(i,e,t){let o=this._schemaRegistry.getMappedPropName(e);return Ek(this._schemaRegistry,i,o,t)}parseEventListenerName(i){let[e,t]=P$(i,[null,i]);return{eventName:t,target:e}}parseLegacyAnimationEventName(i){let e=I$(i,[i,null]);return{eventName:e[0],phase:e[1]===null?null:e[1].toLowerCase()}}_parseLegacyAnimationEvent(i,e,t,o,r,a){let{eventName:c,phase:p}=this.parseLegacyAnimationEventName(i),u=this._parseAction(e,o);r.push(new h1(c,p,Ba.LegacyAnimation,u,t,o,a)),c.length===0&&this._reportError("Animation event name is missing in binding",t),p?p!=="start"&&p!=="done"&&this._reportError(`The provided animation output phase value "${p}" for "@${c}" is not supported (use start or done)`,t):this._reportError(`The animation trigger output event (@${c}) is missing its phase value name (start or done are currently supported)`,t)}_parseRegularEvent(i,e,t,o,r,a,c,p){let{eventName:u,target:h}=this.parseEventListenerName(i),_=this.errors.length,S=this._parseAction(e,r),x=this.errors.length===_;a.push([i,S.source]),t&&x&&!this._isAllowedAssignmentEvent(S)&&this._reportError("Unsupported expression in a two-way binding",o);let b=Ba.Regular;t&&(b=Ba.TwoWay),i.startsWith(`${Mk}${jC}`)&&(b=Ba.Animation),c.push(new h1(u,h,b,S,o,r,p))}_parseAction(i,e){let t=e&&e.start?e.start.offset:0;try{let o=this._exprParser.parseAction(i,e,t);return o&&this.errors.push(...o.errors),!o||o.ast instanceof _a?(this._reportError("Empty expressions are not allowed",e),this._exprParser.wrapLiteralPrimitive("ERROR",e,t)):o}catch(o){return this._reportError(`${o}`,e),this._exprParser.wrapLiteralPrimitive("ERROR",e,t)}}_reportError(i,e,t=nm.ERROR){this.errors.push(new sn(e,i,t))}_validatePropertyOrAttributeName(i,e,t){let o=t?this._schemaRegistry.validateAttribute(i):this._schemaRegistry.validateProperty(i);o.error&&this._reportError(o.msg,e,nm.ERROR)}_isAllowedAssignmentEvent(i){return i instanceof ts?this._isAllowedAssignmentEvent(i.ast):i instanceof S_?this._isAllowedAssignmentEvent(i.expression):i instanceof wh&&i.args.length===1&&i.receiver instanceof Cc&&i.receiver.name==="$any"&&i.receiver.receiver instanceof Mc?this._isAllowedAssignmentEvent(i.args[0]):(i instanceof Cc||i instanceof Gp)&&!QT(i)}};function QT(n){return n instanceof __||n instanceof v_?!0:n instanceof k_?QT(n.expression):n instanceof Cc||n instanceof Gp||n instanceof wh?QT(n.receiver):!1}function Tk(n){return n[0]=="@"}function Ek(n,i,e,t){let o,r=a=>n.securityContext(a,e,t);return i===null?o=n.allKnownElementNames().map(r):(o=[],vh.parse(i).forEach(a=>{let c=a.element?[a.element]:n.allKnownElementNames(),p=new Set(a.notSelectors.filter(h=>h.isElementSelector()).map(h=>h.element)),u=c.filter(h=>!p.has(h));o.push(...u.map(r))})),o.length===0?[eo.NONE]:Array.from(new Set(o)).sort()}function Kd(n,i){let e=i.start-n.start.offset,t=i.end-n.end.offset;return new gn(n.start.moveBy(e),n.end.moveBy(t),n.fullStart.moveBy(e),n.details)}function QK(n){if(n==null||n.length===0||n[0]=="/")return!1;let i=n.match(XK);return i===null||i[1]=="package"||i[1]=="asset"}var XK=/^([^:/?#]+):/,KK="select",YK="link",ZK="rel",JK="href",eY="stylesheet",tY="style",nY="script",iY="ngNonBindable",oY="ngProjectAs";function o6(n){let i=null,e=null,t=null,o=!1,r="";n.attrs.forEach(p=>{let u=p.name.toLowerCase();u==KK?i=p.value:u==JK?e=p.value:u==ZK?t=p.value:p.name==iY?o=!0:p.name==oY&&p.value.length>0&&(r=p.value)}),i=rY(i);let a=n.name.toLowerCase(),c=ws.OTHER;return Xk(a)?c=ws.NG_CONTENT:a==tY?c=ws.STYLE:a==nY?c=ws.SCRIPT:a==YK&&t==eY&&(c=ws.STYLESHEET),new XT(c,i,e,o,r)}var ws=(function(n){return n[n.NG_CONTENT=0]="NG_CONTENT",n[n.STYLE=1]="STYLE",n[n.STYLESHEET=2]="STYLESHEET",n[n.SCRIPT=3]="SCRIPT",n[n.OTHER=4]="OTHER",n})(ws||{}),XT=class{type;selectAttr;hrefAttr;nonBindable;projectAs;constructor(i,e,t,o,r){this.type=i,this.selectAttr=e,this.hrefAttr=t,this.nonBindable=o,this.projectAs=r}};function rY(n){return n===null||n.length===0?"*":n}var aY=/^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/,sY=/^track\s+([\S\s]*)/,lY=/^(as\s+)(.*)/,lb=/^else[^\S\r\n]+if/,cY=/^let\s+([\S\s]*)/,dY=/^[$A-Z_][0-9A-Z_$]*$/i,xN=/(\s*)(\S+)(\s*)/,s_=new Set(["$index","$first","$last","$even","$odd","$count"]);function yN(n){return n==="empty"}function SN(n){return n==="else"||lb.test(n)}function mY(n,i,e,t){let o=_Y(i),r=[],a=wN(n,o,t);a!==null&&r.push(new Ap(a.expression,Co(e,n.children,n.children),a.expressionAlias,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.nameSpan,n.i18n));for(let _ of i)if(lb.test(_.name)){let S=wN(_,o,t);if(S!==null){let x=Co(e,_.children,_.children);r.push(new Ap(S.expression,x,S.expressionAlias,_.sourceSpan,_.startSourceSpan,_.endSourceSpan,_.nameSpan,_.i18n))}}else if(_.name==="else"){let S=Co(e,_.children,_.children);r.push(new Ap(null,S,null,_.sourceSpan,_.startSourceSpan,_.endSourceSpan,_.nameSpan,_.i18n))}let c=r.length>0?r[0].startSourceSpan:n.startSourceSpan,p=r.length>0?r[r.length-1].endSourceSpan:n.endSourceSpan,u=n.sourceSpan,h=r[r.length-1];return h!==void 0&&(u=new gn(c.start,h.sourceSpan.end)),{node:new b1(r,u,n.startSourceSpan,p,n.nameSpan),errors:o}}function pY(n,i,e,t){let o=[],r=hY(n,o,t),a=null,c=null;for(let p of i)p.name==="empty"?c!==null?o.push(new sn(p.sourceSpan,"@for loop can only have one @empty block")):p.parameters.length>0?o.push(new sn(p.sourceSpan,"@empty block cannot have parameters")):c=new O_(Co(e,p.children,p.children),p.sourceSpan,p.startSourceSpan,p.endSourceSpan,p.nameSpan,p.i18n):o.push(new sn(p.sourceSpan,`Unrecognized @for loop block "${p.name}"`));if(r!==null)if(r.trackBy===null)o.push(new sn(n.startSourceSpan,'@for loop must have a "track" expression'));else{let p=c?.endSourceSpan??n.endSourceSpan,u=new gn(n.sourceSpan.start,p?.end??n.sourceSpan.end);fY(r.trackBy.expression,r.trackBy.keywordSpan,o),a=new Eh(r.itemName,r.expression,r.trackBy.expression,r.trackBy.keywordSpan,r.context,Co(e,n.children,n.children),c,u,n.sourceSpan,n.startSourceSpan,p,n.nameSpan,n.i18n)}return{node:a,errors:o}}function uY(n,i,e){let t=vY(n),o=n.parameters.length>0?i0(n.parameters[0],e):e.parseBinding("",!1,n.sourceSpan,0),r=[],a=[],c=[],p=null,u=null;for(let _ of n.children){if(!(_ instanceof Ks))continue;if((_.name!=="case"||_.parameters.length===0)&&_.name!=="default"&&_.name!=="default never"){a.push(new x1(_.name,_.sourceSpan,_.nameSpan));continue}u!==null&&t.push(new sn(_.sourceSpan,'@default block with "never" parameter must be the last case in a switch'));let S=_.name==="case",x=null;if(S)x=i0(_.parameters[0],e);else if(_.name==="default never"){(_.children.length>0||_.endSourceSpan!==null&&_.endSourceSpan.start.offset!==_.endSourceSpan.end.offset)&&t.push(new sn(_.sourceSpan,'@default block with "never" parameter cannot have a body')),c.length>0&&t.push(new sn(_.sourceSpan,'A @case block with no body cannot be followed by a @default block with "never" parameter')),u=new oT(_.sourceSpan,_.startSourceSpan,_.endSourceSpan,_.nameSpan);continue}let b=new iT(x,_.sourceSpan,_.startSourceSpan,_.endSourceSpan,_.nameSpan);if(c.push(b),_.children.length===0&&_.endSourceSpan!==null&&_.endSourceSpan.start.offset===_.endSourceSpan.end.offset){p===null&&(p=_.sourceSpan);continue}let w=_.sourceSpan,y=_.startSourceSpan;p!==null&&(w=new gn(p.start,_.sourceSpan.end),y=new gn(p.start,_.startSourceSpan.end),p=null);let E=new A_(c,Co(i,_.children,_.children),w,y,_.endSourceSpan,_.nameSpan,_.i18n);r.push(E),c=[]}return{node:new C1(o,r,a,u,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.nameSpan),errors:t}}function hY(n,i,e){if(n.parameters.length===0)return i.push(new sn(n.startSourceSpan,"@for loop does not have an expression")),null;let[t,...o]=n.parameters,r=CY(t,i)?.match(aY);if(!r||r[2].trim().length===0)return i.push(new sn(t.sourceSpan,'Cannot parse expression. @for loop expression must match the pattern "<identifier> of <expression>"')),null;let[,a,c]=r;s_.has(a)&&i.push(new sn(t.sourceSpan,`@for loop item name cannot be one of ${Array.from(s_).join(", ")}.`));let p=t.expression.split(" ")[0],u=new gn(t.sourceSpan.start,t.sourceSpan.start.moveBy(p.length)),h={itemName:new sm(a,"$implicit",u,u),trackBy:null,expression:i0(t,e,c),context:Array.from(s_,_=>{let S=new gn(n.startSourceSpan.end,n.startSourceSpan.end);return new sm(_,_,S,S)})};for(let _ of o){let S=_.expression.match(cY);if(S!==null){let b=new gn(_.sourceSpan.start.moveBy(S[0].length-S[1].length),_.sourceSpan.end);gY(_.sourceSpan,S[1],b,a,h.context,i);continue}let x=_.expression.match(sY);if(x!==null){if(h.trackBy!==null)i.push(new sn(_.sourceSpan,'@for loop can only have one "track" expression'));else{let b=i0(_,e,x[1]);b.ast instanceof _a&&i.push(new sn(n.startSourceSpan,'@for loop must have a "track" expression'));let M=new gn(_.sourceSpan.start,_.sourceSpan.start.moveBy(5));h.trackBy={expression:b,keywordSpan:M}}continue}i.push(new sn(_.sourceSpan,`Unrecognized @for loop parameter "${_.expression}"`))}return h}function fY(n,i,e){let t=new KT;n.ast.visit(t),t.hasPipe&&e.push(new sn(i,"Cannot use pipes in track expressions"))}function gY(n,i,e,t,o,r){let a=i.split(","),c=e.start;for(let p of a){let u=p.split("="),h=u.length===2?u[0].trim():"",_=u.length===2?u[1].trim():"";if(h.length===0||_.length===0)r.push(new sn(n,'Invalid @for loop "let" parameter. Parameter should match the pattern "<name> = <variable name>"'));else if(!s_.has(_))r.push(new sn(n,`Unknown "let" parameter variable "${_}". The allowed variables are: ${Array.from(s_).join(", ")}`));else if(h===t)r.push(new sn(n,`Invalid @for loop "let" parameter. Variable cannot be called "${t}"`));else if(o.some(S=>S.name===h))r.push(new sn(n,`Duplicate "let" parameter variable "${_}"`));else{let[,S,x]=u[0].match(xN)??[],b=S!==void 0&&u.length===2?new gn(c.moveBy(S.length),c.moveBy(S.length+x.length)):e,M;if(u.length===2){let[,y,E]=u[1].match(xN)??[];M=y!==void 0?new gn(c.moveBy(u[0].length+1+y.length),c.moveBy(u[0].length+1+y.length+E.length)):void 0}let w=new gn(b.start,M?.end??b.end);o.push(new sm(h,_,w,b,M))}c=c.moveBy(p.length+1)}}function _Y(n){let i=[],e=!1;for(let t=0;t<n.length;t++){let o=n[t];o.name==="else"?(e?i.push(new sn(o.startSourceSpan,"Conditional can only have one @else block")):n.length>1&&t<n.length-1?i.push(new sn(o.startSourceSpan,"@else block must be last inside the conditional")):o.parameters.length>0&&i.push(new sn(o.startSourceSpan,"@else block cannot have parameters")),e=!0):lb.test(o.name)||i.push(new sn(o.startSourceSpan,`Unrecognized conditional block @${o.name}`))}return i}function vY(n){let i=[],e=!1;if(n.parameters.length!==1)return i.push(new sn(n.startSourceSpan,"@switch block must have exactly one parameter")),i;for(let t of n.children)if(!(t instanceof Y_||t instanceof Jp&&t.value.trim().length===0)){if(!(t instanceof Ks)||t.name!=="case"&&t.name!=="default"&&t.name!=="default never"){i.push(new sn(t.sourceSpan,"@switch block can only contain @case and @default blocks"));continue}t.name==="default never"?(e&&i.push(new sn(t.startSourceSpan,"@switch block can only have one @default block")),e=!0):t.name==="default"?(e?i.push(new sn(t.startSourceSpan,"@switch block can only have one @default block")):t.parameters.length>0&&i.push(new sn(t.startSourceSpan,"@default block cannot have parameters")),e=!0):t.name==="case"&&t.parameters.length!==1&&i.push(new sn(t.startSourceSpan,"@case block must have exactly one parameter"))}return i}function i0(n,i,e){let t,o;return typeof e=="string"?(t=Math.max(0,n.expression.lastIndexOf(e)),o=t+e.length):(t=0,o=n.expression.length),i.parseBinding(n.expression.slice(t,o),!1,n.sourceSpan,n.sourceSpan.start.offset+t)}function wN(n,i,e){if(n.parameters.length===0)return i.push(new sn(n.startSourceSpan,"Conditional block does not have an expression")),null;let t=i0(n.parameters[0],e),o=null;for(let r=1;r<n.parameters.length;r++){let a=n.parameters[r],c=a.expression.match(lY);if(c===null)i.push(new sn(a.sourceSpan,`Unrecognized conditional parameter "${a.expression}"`));else if(n.name!=="if"&&!lb.test(n.name))i.push(new sn(a.sourceSpan,'"as" expression is only allowed on `@if` and `@else if` blocks'));else if(o!==null)i.push(new sn(a.sourceSpan,'Conditional can only have one "as" expression'));else{let p=c[2].trim();if(dY.test(p)){let u=a.sourceSpan.start.moveBy(c[1].length),h=new gn(u,u.moveBy(p.length));o=new sm(p,p,h,h)}else i.push(new sn(a.sourceSpan,'"as" expression must be a valid JavaScript identifier'))}}return{expression:t,expressionAlias:o}}function CY(n,i){let e=n.expression,t=/^\s$/,o=0,r=0,a=e.length-1;for(let c=0;c<e.length;c++){let p=e[c];if(p==="(")r=c+1,o++;else{if(t.test(p))continue;break}}if(o===0)return e;for(let c=e.length-1;c>-1;c--){let p=e[c];if(p===")"){if(a=c,o--,o===0)break}else{if(t.test(p))continue;break}}return o!==0?(i.push(new sn(n.sourceSpan,"Unclosed parentheses in expression")),null):e.slice(r,a)}var KT=class extends Mh{hasPipe=!1;visitPipe(){this.hasPipe=!0}},bY=/^\d+\.?\d*(ms|s)?$/,xY=/^\s$/,MN=new Map([[Ys,Ra],[bc,_d],[Va,Cr]]),La=(function(n){return n.IDLE="idle",n.TIMER="timer",n.INTERACTION="interaction",n.IMMEDIATE="immediate",n.HOVER="hover",n.VIEWPORT="viewport",n.NEVER="never",n})(La||{});function yY({expression:n,sourceSpan:i},e,t){let o=n.indexOf("never"),r=new gn(i.start.moveBy(o),i.start.moveBy(o+5)),a=IE(n,i),c=AE(n,i);o===-1?t.push(new sn(i,'Could not find "never" keyword in expression')):OE("never",e,t,new Jk(r,i,a,null,c))}function Dk({expression:n,sourceSpan:i},e,t,o){let r=n.indexOf("when"),a=new gn(i.start.moveBy(r),i.start.moveBy(r+4)),c=IE(n,i),p=AE(n,i);if(r===-1)o.push(new sn(i,'Could not find "when" keyword in expression'));else{let u=o0(n,r+1),h=e.parseBinding(n.slice(u),!1,i,i.start.offset+u);OE("when",t,o,new g1(h,i,c,a,p))}}function Pk({expression:n,sourceSpan:i},e,t,o,r){let a=n.indexOf("on"),c=new gn(i.start.moveBy(a),i.start.moveBy(a+2)),p=IE(n,i),u=AE(n,i);if(a===-1)o.push(new sn(i,'Could not find "on" keyword in expression'));else{let h=o0(n,a+1),_=n.startsWith("hydrate");new YT(n,e,h,i,t,o,_?PY:DY,_,p,c,u).parse()}}function IE(n,i){return n.startsWith("prefetch")?new gn(i.start,i.start.moveBy(8)):null}function AE(n,i){return n.startsWith("hydrate")?new gn(i.start,i.start.moveBy(7)):null}var YT=class{expression;bindingParser;start;span;triggers;errors;validator;isHydrationTrigger;prefetchSpan;onSourceSpan;hydrateSpan;index=0;tokens;constructor(i,e,t,o,r,a,c,p,u,h,_){this.expression=i,this.bindingParser=e,this.start=t,this.span=o,this.triggers=r,this.errors=a,this.validator=c,this.isHydrationTrigger=p,this.prefetchSpan=u,this.onSourceSpan=h,this.hydrateSpan=_,this.tokens=new e0().tokenize(i.slice(t))}parse(){for(;this.tokens.length>0&&this.index<this.tokens.length;){let i=this.token();if(!i.isIdentifier()){this.unexpectedToken(i);break}if(this.isFollowedByOrLast(va))this.consumeTrigger(i,[]),this.advance();else if(this.isFollowedByOrLast(Va)){this.advance();let e=this.errors.length,t=this.consumeParameters();if(this.errors.length!==e)break;this.consumeTrigger(i,t),this.advance()}else this.index<this.tokens.length-1&&this.unexpectedToken(this.tokens[this.index+1]);this.advance()}}advance(){this.index++}isFollowedByOrLast(i){return this.index===this.tokens.length-1?!0:this.tokens[this.index+1].isCharacter(i)}token(){return this.tokens[Math.min(this.index,this.tokens.length-1)]}consumeTrigger(i,e){let t=this.span.start.moveBy(this.start+i.index-this.tokens[0].index),o=new gn(t,t.moveBy(i.strValue.length)),r=t.moveBy(this.token().end-i.index),a=i.index===0,c=a?this.onSourceSpan:null,p=a?this.prefetchSpan:null,u=a?this.hydrateSpan:null,h=new gn(a?this.span.start:t,r);try{switch(i.toString()){case La.IDLE:this.trackTrigger("idle",SY(e,o,h,p,c,u));break;case La.TIMER:this.trackTrigger("timer",wY(e,o,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan));break;case La.INTERACTION:this.trackTrigger("interaction",TY(e,o,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan,this.validator));break;case La.IMMEDIATE:this.trackTrigger("immediate",MY(e,o,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan));break;case La.HOVER:this.trackTrigger("hover",kY(e,o,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan,this.validator));break;case La.VIEWPORT:this.trackTrigger("viewport",EY(this.start,this.isHydrationTrigger,this.bindingParser,e,o,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan,this.validator));break;default:throw new Error(`Unrecognized trigger type "${i}"`)}}catch(_){this.error(i,_.message)}}consumeParameters(){let i=[];if(!this.token().isCharacter(Va))return this.unexpectedToken(this.token()),i;this.advance();let e=[],t=[];for(;this.index<this.tokens.length;){let o=this.token();if(o.isCharacter(Cr)&&e.length===0){t.length&&i.push({expression:this.tokenRangeText(t),start:t[0].index});break}if(o.type===un.Character&&MN.has(o.numValue)&&e.push(MN.get(o.numValue)),e.length>0&&o.isCharacter(e[e.length-1])&&e.pop(),e.length===0&&o.isCharacter(va)&&t.length>0){i.push({expression:this.tokenRangeText(t),start:t[0].index}),this.advance(),t=[];continue}t.push(o),this.advance()}return(!this.token().isCharacter(Cr)||e.length>0)&&this.error(this.token(),"Unexpected end of expression"),this.index<this.tokens.length-1&&!this.tokens[this.index+1].isCharacter(va)&&this.unexpectedToken(this.tokens[this.index+1]),i}tokenRangeText(i){return i.length===0?"":this.expression.slice(this.start+i[0].index,this.start+i[i.length-1].end)}trackTrigger(i,e){OE(i,this.triggers,this.errors,e)}error(i,e){let t=this.span.start.moveBy(this.start+i.index),o=t.moveBy(i.end-i.index);this.errors.push(new sn(new gn(t,o),e))}unexpectedToken(i){this.error(i,`Unexpected token "${i}"`)}};function OE(n,i,e,t){i[n]?e.push(new sn(t.sourceSpan,`Duplicate "${n}" trigger is not allowed`)):i[n]=t}function SY(n,i,e,t,o,r){if(n.length>0)throw new Error(`"${La.IDLE}" trigger cannot have parameters`);return new eT(i,e,t,o,r)}function wY(n,i,e,t,o,r){if(n.length!==1)throw new Error(`"${La.TIMER}" trigger must have exactly one parameter`);let a=Y1(n[0].expression);if(a===null)throw new Error(`Could not parse time value of trigger "${La.TIMER}"`);return new nT(a,i,e,t,o,r)}function MY(n,i,e,t,o,r){if(n.length>0)throw new Error(`"${La.IMMEDIATE}" trigger cannot have parameters`);return new tT(i,e,t,o,r)}function kY(n,i,e,t,o,r,a){return a(La.HOVER,n),new _1(n[0]?.expression??null,i,e,t,o,r)}function TY(n,i,e,t,o,r,a){return a(La.INTERACTION,n),new v1(n[0]?.expression??null,i,e,t,o,r)}function EY(n,i,e,t,o,r,a,c,p,u){u(La.VIEWPORT,t);let h,_;if(t.length===0)h=_=null;else if(!t[0].expression.startsWith("{"))h=t[0].expression,_=null;else{let S=e.parseBinding(t[0].expression,!1,r,r.start.offset+n+t[0].start);if(S.ast instanceof Wp){if(S.ast.keys.some(b=>b.kind==="spread"))throw new Error("Spread operator are not allowed in this context");if(S.ast.keys.some(b=>b.kind==="property"&&b.key==="root"))throw new Error('The "root" option is not supported in the options parameter of the "viewport" trigger')}else throw new Error('Options parameter of the "viewport" trigger must be an object literal');let x=S.ast.keys.findIndex(b=>b.kind==="property"&&b.key==="trigger");if(x===-1)h=null,_=S.ast;else{let b=S.ast.values[x],M=(w,y)=>y!==x;if(!(b instanceof Cc)||!(b.receiver instanceof Mc))throw new Error('"trigger" option of the "viewport" trigger must be an identifier');h=b.name,_=new Wp(S.ast.span,S.ast.sourceSpan,S.ast.keys.filter(M),S.ast.values.filter(M))}}if(i&&h!==null)throw new Error('"viewport" hydration trigger cannot have a "trigger"');if(_){let S=ZT.findDynamicNode(_);if(S!==null)throw new Error(`Options of the "viewport" trigger must be an object literal containing only literal values, but "${S.constructor.name}" was found`)}return new E_(h,_,o,r,a,c,p)}function DY(n,i){if(i.length>1)throw new Error(`"${n}" trigger can only have zero or one parameters`)}function PY(n,i){if(n===La.VIEWPORT){if(i.length>1)throw new Error(`Hydration trigger "${n}" cannot have more than one parameter`);return}if(i.length>0)throw new Error(`Hydration trigger "${n}" cannot have parameters`)}function o0(n,i=0){let e=!1;for(let t=i;t<n.length;t++)if(xY.test(n[t]))e=!0;else if(e)return t;return-1}function Y1(n){let i=n.match(bY);if(!i)return null;let[e,t]=i;return parseFloat(e)*(t==="s"?1e3:1)}var ZT=class n extends Mh{dynamicNode=null;static findDynamicNode(i){let e=new n;return e.visit(i),e.dynamicNode}visit(i){!(i instanceof ts)&&!(i instanceof Ja)&&!(i instanceof C_)&&!(i instanceof Wp)?this.dynamicNode=i:super.visit(i)}},IY=/^prefetch\s+when\s/,AY=/^prefetch\s+on\s/,OY=/^hydrate\s+when\s/,NY=/^hydrate\s+on\s/,FY=/^hydrate\s+never(\s*)$/,r6=/^minimum\s/,RY=/^after\s/,LY=/^when\s/,VY=/^on\s/;function JT(n){return n==="placeholder"||n==="loading"||n==="error"}function BY(n,i,e,t){let o=[],{placeholder:r,loading:a,error:c}=zY(i,o,e),{triggers:p,prefetchTriggers:u,hydrateTriggers:h}=UY(n,t,o),_=n.endSourceSpan,S=n.sourceSpan.end;if(i.length>0){let M=i[i.length-1];_=M.endSourceSpan,S=M.sourceSpan.end}let x=new gn(n.sourceSpan.start,S);return{node:new qp(Co(e,n.children,n.children),p,u,h,r,a,c,n.nameSpan,x,n.sourceSpan,n.startSourceSpan,_,n.i18n),errors:o}}function zY(n,i,e){let t=null,o=null,r=null;for(let a of n)try{if(!JT(a.name)){i.push(new sn(a.startSourceSpan,`Unrecognized block "@${a.name}"`));break}switch(a.name){case"placeholder":t!==null?i.push(new sn(a.startSourceSpan,"@defer block can only have one @placeholder block")):t=jY(a,e);break;case"loading":o!==null?i.push(new sn(a.startSourceSpan,"@defer block can only have one @loading block")):o=$Y(a,e);break;case"error":r!==null?i.push(new sn(a.startSourceSpan,"@defer block can only have one @error block")):r=HY(a,e);break}}catch(c){i.push(new sn(a.startSourceSpan,c.message))}return{placeholder:t,loading:o,error:r}}function jY(n,i){let e=null;for(let t of n.parameters)if(r6.test(t.expression)){if(e!=null)throw new Error('@placeholder block can only have one "minimum" parameter');let o=Y1(t.expression.slice(o0(t.expression)));if(o===null)throw new Error('Could not parse time value of parameter "minimum"');e=o}else throw new Error(`Unrecognized parameter in @placeholder block: "${t.expression}"`);return new D_(Co(i,n.children,n.children),e,n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function $Y(n,i){let e=null,t=null;for(let o of n.parameters)if(RY.test(o.expression)){if(e!=null)throw new Error('@loading block can only have one "after" parameter');let r=Y1(o.expression.slice(o0(o.expression)));if(r===null)throw new Error('Could not parse time value of parameter "after"');e=r}else if(r6.test(o.expression)){if(t!=null)throw new Error('@loading block can only have one "minimum" parameter');let r=Y1(o.expression.slice(o0(o.expression)));if(r===null)throw new Error('Could not parse time value of parameter "minimum"');t=r}else throw new Error(`Unrecognized parameter in @loading block: "${o.expression}"`);return new P_(Co(i,n.children,n.children),e,t,n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function HY(n,i){if(n.parameters.length>0)throw new Error("@error block cannot have parameters");return new I_(Co(i,n.children,n.children),n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function UY(n,i,e,t){let o={},r={},a={};for(let c of n.parameters)LY.test(c.expression)?Dk(c,i,o,e):VY.test(c.expression)?Pk(c,i,o,e):IY.test(c.expression)?Dk(c,i,r,e):AY.test(c.expression)?Pk(c,i,r,e):OY.test(c.expression)?Dk(c,i,a,e):NY.test(c.expression)?Pk(c,i,a,e):FY.test(c.expression)?yY(c,a,e):e.push(new sn(c.sourceSpan,"Unrecognized trigger"));return a.never&&Object.keys(a).length>1&&e.push(new sn(n.startSourceSpan,"Cannot specify additional `hydrate` triggers if `hydrate never` is present")),{triggers:o,prefetchTriggers:r,hydrateTriggers:a}}var GY=/^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/,kN=1,TN=2,EN=3,DN=4,PN=5,WY=6,Wg=7,Yd={BANANA_BOX:{start:"[(",end:")]"},PROPERTY:{start:"[",end:"]"},EVENT:{start:"(",end:")"}},Ik="*",qY=new Set(["link","style","script","ng-template","ng-container","ng-content"]),QY=new Set(["ngProjectAs","ngNonBindable"]);function XY(n,i,e){let t=new eE(i,e),o=Co(t,n,n),r=i.errors.concat(t.errors),a={nodes:o,errors:r,styleUrls:t.styleUrls,styles:t.styles,ngContentSelectors:t.ngContentSelectors};return e.collectCommentNodes&&(a.commentNodes=t.commentNodes),a}var eE=class{bindingParser;options;errors=[];styles=[];styleUrls=[];ngContentSelectors=[];commentNodes=[];inI18nBlock=!1;processedNodes=new Set;constructor(i,e){this.bindingParser=i,this.options=e}visitElement(i){let e=WC(i.i18n);e&&(this.inI18nBlock&&this.reportError("Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.",i.sourceSpan),this.inI18nBlock=!0);let t=o6(i);if(t.type===ws.SCRIPT)return null;if(t.type===ws.STYLE){let y=KY(i);return y!==null&&this.styles.push(y),null}else if(t.type===ws.STYLESHEET&&QK(t.hrefAttr))return this.styleUrls.push(t.hrefAttr),null;let o=Z$(i.name),{attributes:r,boundEvents:a,references:c,variables:p,templateVariables:u,elementHasInlineTemplate:h,parsedProperties:_,templateParsedProperties:S,i18nAttrsMeta:x}=this.prepareAttributes(i.attrs,o),b=this.extractDirectives(i),M;t.nonBindable?M=Co(IN,i.children).flat(1/0):M=Co(this,i.children,i.children);let w;if(t.type===ws.NG_CONTENT){let y=t.selectAttr,E=i.attrs.map(I=>this.visitAttribute(I));w=new Dh(y,E,M,i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.i18n),this.ngContentSelectors.push(y)}else if(o){let y=this.categorizePropertyAttributes(i.name,_,x);w=new ks(i.name,r,y.bound,a,b,[],M,c,p,i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.i18n)}else{let y=this.categorizePropertyAttributes(i.name,_,x);if(i.name==="ng-container")for(let E of y.bound)E.type===Ti.Attribute&&this.reportError("Attribute bindings are not supported on ng-container. Use property bindings instead.",E.sourceSpan);w=new kc(i.name,r,y.bound,a,b,M,c,i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.isVoid,i.i18n)}return h&&(w=this.wrapInTemplate(w,S,u,x,o,e)),e&&(this.inI18nBlock=!1),w}visitAttribute(i){return new Th(i.name,i.value,i.sourceSpan,i.keySpan,i.valueSpan,i.i18n)}visitText(i){return this.processedNodes.has(i)?null:this._visitTextWithInterpolation(i.value,i.sourceSpan,i.tokens,i.i18n)}visitExpansion(i){if(!i.i18n)return null;if(!WC(i.i18n))throw new Error(`Invalid type "${i.i18n.constructor}" for "i18n" property of ${i.sourceSpan.toString()}. Expected a "Message"`);let e=i.i18n,t={},o={};return Object.keys(e.placeholders).forEach(r=>{let a=e.placeholders[r];if(r.startsWith(nH)){let c=r.trim(),p=this.bindingParser.parseInterpolationExpression(a.text,a.sourceSpan);t[c]=new kh(p,a.sourceSpan)}else o[r]=this._visitTextWithInterpolation(a.text,a.sourceSpan,null)}),new XN(t,o,i.sourceSpan,e)}visitExpansionCase(i){return null}visitComment(i){return this.options.collectCommentNodes&&this.commentNodes.push(new ib(i.value||"",i.sourceSpan)),null}visitLetDeclaration(i,e){let t=this.bindingParser.parseBinding(i.value,!1,i.valueSpan,i.valueSpan.start.offset);return t.errors.length===0&&t.ast instanceof _a&&this.reportError("@let declaration value cannot be empty",i.valueSpan),new gE(i.name,t,i.sourceSpan,i.nameSpan,i.valueSpan)}visitComponent(i){let e=WC(i.i18n);if(e&&(this.inI18nBlock&&this.reportError("Cannot mark a component as translatable inside of a translatable section. Please remove the nested i18n marker.",i.sourceSpan),this.inI18nBlock=!0),i.tagName!==null&&qY.has(i.tagName))return this.reportError(`Tag name "${i.tagName}" cannot be used as a component tag`,i.startSourceSpan),null;let{attributes:t,boundEvents:o,references:r,templateVariables:a,elementHasInlineTemplate:c,parsedProperties:p,templateParsedProperties:u,i18nAttrsMeta:h}=this.prepareAttributes(i.attrs,!1);this.validateSelectorlessReferences(r);let _=this.extractDirectives(i),S;i.attrs.find(M=>M.name==="ngNonBindable")?S=Co(IN,i.children).flat(1/0):S=Co(this,i.children,i.children);let x=this.categorizePropertyAttributes(i.tagName,p,h),b=new e_(i.componentName,i.tagName,i.fullName,t,x.bound,o,_,S,r,i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.i18n);return c&&(b=this.wrapInTemplate(b,u,a,h,!1,e)),e&&(this.inI18nBlock=!1),b}visitDirective(){return null}visitBlockParameter(){return null}visitBlock(i,e){let t=Array.isArray(e)?e.indexOf(i):-1;if(t===-1)throw new Error("Visitor invoked incorrectly. Expecting visitBlock to be invoked siblings array as its context");if(this.processedNodes.has(i))return null;let o=null;switch(i.name){case"defer":o=BY(i,this.findConnectedBlocks(t,e,JT),this,this.bindingParser);break;case"switch":o=uY(i,this,this.bindingParser);break;case"for":o=pY(i,this.findConnectedBlocks(t,e,yN),this,this.bindingParser);break;case"if":o=mY(i,this.findConnectedBlocks(t,e,SN),this,this.bindingParser);break;default:let r;JT(i.name)?(r=`@${i.name} block can only be used after an @defer block.`,this.processedNodes.add(i)):yN(i.name)?(r=`@${i.name} block can only be used after an @for block.`,this.processedNodes.add(i)):SN(i.name)?(r=`@${i.name} block can only be used after an @if or @else if block.`,this.processedNodes.add(i)):r=`Unrecognized block @${i.name}.`,o={node:new x1(i.name,i.sourceSpan,i.nameSpan),errors:[new sn(i.sourceSpan,r)]};break}return this.errors.push(...o.errors),o.node}findConnectedBlocks(i,e,t){let o=[];for(let r=i+1;r<e.length;r++){let a=e[r];if(!(a instanceof Y_)){if(a instanceof Jp&&a.value.trim().length===0){this.processedNodes.add(a);continue}if(!(a instanceof Ks)||!t(a.name))break;o.push(a),this.processedNodes.add(a)}}return o}categorizePropertyAttributes(i,e,t){let o=[],r=[];return e.forEach(a=>{let c=t[a.name];if(a.isLiteral)r.push(new Th(a.name,a.expression.source||"",a.sourceSpan,a.keySpan,a.valueSpan,c));else{let p=this.bindingParser.createBoundElementProperty(i,a,!0,!1);o.push(Yk.fromBoundElementProperty(p,c))}}),{bound:o,literal:r}}prepareAttributes(i,e){let t=[],o=[],r=[],a=[],c=[],p={},u=[],h=[],_=!1;for(let S of i){let x=!1,b=AN(S.name),M=!1;if(S.i18n&&(p[S.name]=S.i18n),b.startsWith(Ik)){_&&this.reportError("Can't have multiple template bindings on one element. Use only one attribute prefixed with *",S.sourceSpan),M=!0,_=!0;let w=S.value,y=b.substring(Ik.length),E=[],I=S.valueSpan?S.valueSpan.fullStart.offset:S.sourceSpan.fullStart.offset+S.name.length;this.bindingParser.parseInlineTemplateBinding(y,w,S.sourceSpan,I,[],u,E,!0),h.push(...E.map(D=>new sm(D.name,D.value,D.sourceSpan,D.keySpan,D.valueSpan)))}else x=this.parseAttribute(e,S,[],t,o,r,a);!x&&!M&&c.push(this.visitAttribute(S))}return{attributes:c,boundEvents:o,references:a,variables:r,templateVariables:h,elementHasInlineTemplate:_,parsedProperties:t,templateParsedProperties:u,i18nAttrsMeta:p}}parseAttribute(i,e,t,o,r,a,c){let p=AN(e.name),u=e.value,h=e.sourceSpan,_=e.valueSpan?e.valueSpan.fullStart.offset:h.fullStart.offset;function S(y,E,I){let D=e.name.length-p.length,N=y.start.moveBy(E.length+D),P=N.moveBy(I.length);return new gn(N,P,N,I)}let x=p.match(GY);if(x){if(x[kN]!=null){let y=x[Wg],E=S(h,x[kN],y);this.bindingParser.parsePropertyBinding(y,u,!1,!1,h,_,e.valueSpan,t,o,E)}else if(x[TN])if(i){let y=x[Wg],E=S(h,x[TN],y);this.parseVariable(y,u,h,E,e.valueSpan,a)}else this.reportError('"let-" is only supported on ng-template elements.',h);else if(x[EN]){let y=x[Wg],E=S(h,x[EN],y);this.parseReference(y,u,h,E,e.valueSpan,c)}else if(x[DN]){let y=[],E=x[Wg],I=S(h,x[DN],E);this.bindingParser.parseEvent(E,u,!1,h,e.valueSpan||h,t,y,I),Ak(y,r)}else if(x[PN]){let y=x[Wg],E=S(h,x[PN],y);this.bindingParser.parsePropertyBinding(y,u,!1,!0,h,_,e.valueSpan,t,o,E),this.parseAssignmentEvent(y,u,h,e.valueSpan,t,r,E,_)}else if(x[WY]){let y=S(h,"",p);this.bindingParser.parseLiteralAttr(p,u,h,_,e.valueSpan,t,o,y)}return!0}let b=null;if(p.startsWith(Yd.BANANA_BOX.start)?b=Yd.BANANA_BOX:p.startsWith(Yd.PROPERTY.start)?b=Yd.PROPERTY:p.startsWith(Yd.EVENT.start)&&(b=Yd.EVENT),b!==null&&p.endsWith(b.end)&&p.length>b.start.length+b.end.length){let y=p.substring(b.start.length,p.length-b.end.length),E=S(h,b.start,y);if(b.start===Yd.BANANA_BOX.start)this.bindingParser.parsePropertyBinding(y,u,!1,!0,h,_,e.valueSpan,t,o,E),this.parseAssignmentEvent(y,u,h,e.valueSpan,t,r,E,_);else if(b.start===Yd.PROPERTY.start)this.bindingParser.parsePropertyBinding(y,u,!1,!1,h,_,e.valueSpan,t,o,E);else{let I=[];this.bindingParser.parseEvent(y,u,!1,h,e.valueSpan||h,t,I,E),Ak(I,r)}return!0}let M=S(h,"",p);return this.bindingParser.parsePropertyInterpolation(p,u,h,e.valueSpan,t,o,M,e.valueTokens??null)}extractDirectives(i){let e=i instanceof Fa?i.tagName:i.name,t=[],o=new Set;for(let r of i.directives){let a=!1;for(let x of r.attrs)x.name.startsWith(Ik)?(a=!0,this.reportError(`Shorthand template syntax "${x.name}" is not supported inside a directive context`,x.sourceSpan)):QY.has(x.name)&&(a=!0,this.reportError(`Attribute "${x.name}" is not supported in a directive context`,x.sourceSpan));if(!a&&o.has(r.name)&&(a=!0,this.reportError(`Cannot apply directive "${r.name}" multiple times on the same element`,r.sourceSpan)),a)continue;let{attributes:c,parsedProperties:p,boundEvents:u,references:h,i18nAttrsMeta:_}=this.prepareAttributes(r.attrs,!1);this.validateSelectorlessReferences(h);let{bound:S}=this.categorizePropertyAttributes(e,p,_);for(let x of S)x.type!==Ti.Property&&x.type!==Ti.TwoWay&&(a=!0,this.reportError("Binding is not supported in a directive context",x.sourceSpan));a||(o.add(r.name),t.push(new QN(r.name,c,S,u,h,r.sourceSpan,r.startSourceSpan,r.endSourceSpan,void 0)))}return t}filterAnimationAttributes(i){return i.filter(e=>!e.name.startsWith("animate."))}filterAnimationInputs(i){return i.filter(e=>e.type!==Ti.Animation)}wrapInTemplate(i,e,t,o,r,a){let c=this.categorizePropertyAttributes("ng-template",e,o),p=[];c.literal.forEach(S=>p.push(S)),c.bound.forEach(S=>p.push(S));let u={attributes:[],inputs:[],outputs:[]};(i instanceof kc||i instanceof e_)&&(u.attributes.push(...this.filterAnimationAttributes(i.attributes)),u.inputs.push(...this.filterAnimationInputs(i.inputs)),u.outputs.push(...i.outputs));let h=r&&a?void 0:i.i18n,_;return i instanceof e_?_=i.tagName:i instanceof ks?_=null:_=i.name,new ks(_,u.attributes,u.inputs,u.outputs,[],p,[i],[],t,!1,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,h)}_visitTextWithInterpolation(i,e,t,o){let r=RF(i),a=this.bindingParser.parseInterpolation(r,e,t);return a?new kh(a,e,o):new Dp(r,e)}parseVariable(i,e,t,o,r,a){i.indexOf("-")>-1?this.reportError('"-" is not allowed in variable names',t):i.length===0&&this.reportError("Variable does not have a name",t),a.push(new sm(i,e,t,o,r))}parseReference(i,e,t,o,r,a){i.indexOf("-")>-1?this.reportError('"-" is not allowed in reference names',t):i.length===0?this.reportError("Reference does not have a name",t):a.some(c=>c.name===i)&&this.reportError(`Reference "#${i}" is defined more than once`,t),a.push(new N_(i,e,t,o,r))}parseAssignmentEvent(i,e,t,o,r,a,c,p){let u=[];this.bindingParser.parseEvent(`${i}Change`,e,!0,t,o||t,r,u,c),Ak(u,a)}validateSelectorlessReferences(i){if(i.length===0)return;let e=new Set;for(let t of i)t.value.length>0?this.reportError("Cannot specify a value for a local reference in this context",t.valueSpan||t.sourceSpan):e.has(t.name)?this.reportError("Duplicate reference names are not allowed",t.sourceSpan):e.add(t.name)}reportError(i,e,t=nm.ERROR){this.errors.push(new sn(e,i,t))}},tE=class{visitElement(i){let e=o6(i);if(e.type===ws.SCRIPT||e.type===ws.STYLE||e.type===ws.STYLESHEET)return null;let t=Co(this,i.children,null);return new kc(i.name,Co(this,i.attrs),[],[],[],t,[],i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,i.isVoid)}visitComment(i){return null}visitAttribute(i){return new Th(i.name,i.value,i.sourceSpan,i.keySpan,i.valueSpan,i.i18n)}visitText(i){return new Dp(i.value,i.sourceSpan)}visitExpansion(i){return null}visitExpansionCase(i){return null}visitBlock(i,e){let t=[new Dp(i.startSourceSpan.toString(),i.startSourceSpan),...Co(this,i.children)];return i.endSourceSpan!==null&&t.push(new Dp(i.endSourceSpan.toString(),i.endSourceSpan)),t}visitBlockParameter(i,e){return null}visitLetDeclaration(i,e){return new Dp(`@let ${i.name} = ${i.value};`,i.sourceSpan)}visitComponent(i,e){let t=Co(this,i.children,null);return new kc(i.fullName,Co(this,i.attrs),[],[],[],t,[],i.isSelfClosing,i.sourceSpan,i.startSourceSpan,i.endSourceSpan,!1)}visitDirective(i,e){return null}},IN=new tE;function AN(n){return/^data-/i.test(n)?n.substring(5):n}function Ak(n,i){i.push(...n.map(e=>Zk.fromParsedEvent(e)))}function KY(n){return n.children.length!==1||!(n.children[0]instanceof Jp)?null:n.children[0].value}var YY=[" ",`
`,"\r"," "];function ZY(n,i,e={}){let{preserveWhitespaces:t,enableI18nLegacyMessageIdFormat:o}=e,r=e.enableSelectorless??!1,a=Z1(r),p=new WT().parse(n,i,it(K({leadingTriviaChars:YY},e),{tokenizeExpansionForms:!0,tokenizeBlocks:e.enableBlockSyntax??!0,tokenizeLet:e.enableLetSyntax??!0,selectorlessEnabled:r}));if(!e.alwaysAttemptHtmlToR3AstConversion&&p.errors&&p.errors.length>0){let D={preserveWhitespaces:t,errors:p.errors,nodes:[],styleUrls:[],styles:[],ngContentSelectors:[]};return e.collectCommentNodes&&(D.commentNodes=[]),D}let u=p.rootNodes,h=!(e.preserveSignificantWhitespace??!0),_=new W1(!t,o,e.preserveSignificantWhitespace,h),S=_.visitAllWithErrors(u);if(!e.alwaysAttemptHtmlToR3AstConversion&&S.errors&&S.errors.length>0){let D={preserveWhitespaces:t,errors:S.errors,nodes:[],styleUrls:[],styles:[],ngContentSelectors:[]};return e.collectCommentNodes&&(D.commentNodes=[]),D}u=S.rootNodes,t||(u=Co(new U1(!0,void 0,!1),u),_.hasI18nMeta&&(u=Co(new W1(!1,void 0,!0,h),u)));let{nodes:x,errors:b,styleUrls:M,styles:w,ngContentSelectors:y,commentNodes:E}=XY(u,a,{collectCommentNodes:!!e.collectCommentNodes});b.push(...p.errors,...S.errors);let I={preserveWhitespaces:t,errors:b.length>0?b:null,nodes:x,styleUrls:M,styles:w,ngContentSelectors:y};return e.collectCommentNodes&&(I.commentNodes=E),I}var JY=new Rh;function Z1(n=!1){return new qT(new G1(new e0,n),JY,[])}var a6="%COMP%",eZ=`_nghost-${a6}`,tZ=`_ngcontent-${a6}`;function s6(n,i,e){let t=new dm,o=pE(n.selector);return t.set("type",n.type.value),o.length>0&&t.set("selectors",mh(o)),n.queries.length>0&&t.set("contentQueries",HK(n.queries,i,n.name)),n.viewQueries.length&&t.set("viewQuery",$K(n.viewQueries,i,n.name)),t.set("hostBindings",cZ(n.host,n.typeSourceSpan,e,i,n.selector||"",n.name,t)),t.set("inputs",s5(n.inputs,!0)),t.set("outputs",s5(n.outputs)),n.exportAs!==null&&t.set("exportAs",Gi(n.exportAs.map(r=>Te(r)))),n.isStandalone===!1&&t.set("standalone",Te(!1)),n.isSignal&&t.set("signals",Te(!0)),t}function l6(n,i){let e=[],t=i.providers,o=i.viewProviders;if(t||o){let r=[t||new wc([])];o&&r.push(o),e.push(Ut(fe.ProvidersFeature).callFn(r))}if(i.hostDirectives?.length&&e.push(Ut(fe.HostDirectivesFeature).callFn([hZ(i.hostDirectives)])),i.usesInheritance&&e.push(Ut(fe.InheritDefinitionFeature)),i.lifecycle.usesOnChanges&&e.push(Ut(fe.NgOnChangesFeature)),i.controlCreate!==null&&e.push(Ut(fe.ControlFeature).callFn([Te(i.controlCreate.passThroughInput)])),"externalStyles"in i&&i.externalStyles?.length){let r=i.externalStyles.map(a=>Te(a));e.push(Ut(fe.ExternalStylesFeature).callFn([Gi(r)]))}e.length&&n.set("features",Gi(e))}function nZ(n,i,e){let t=s6(n,i,e);l6(t,n);let o=Ut(fe.defineDirective).callFn([t.toLiteralMap()],void 0,!0),r=lZ(n);return{expression:o,type:r,statements:[]}}function iZ(n,i,e){let t=s6(n,i,e);l6(t,n);let o=n.selector&&vh.parse(n.selector),r=o&&o[0];if(r){let b=r.getAttrs();b.length&&t.set("attrs",i.getConstLiteral(Gi(b.map(M=>M!=null?Te(M):Te(void 0))),!0))}let a=n.name,c=null;if(n.defer.mode===1&&n.defer.dependenciesFn!==null){let b=`${a}_DeferFn`;i.statements.push(new Rr(b,n.defer.dependenciesFn,void 0,oa.Final)),c=Yn(b)}let p=n.isStandalone&&!n.hasDirectiveDependencies?Za.DomOnly:Za.Full,u=_K(n.name,n.template.nodes,i,p,n.relativeContextFilePath,n.i18nUseExternalIds,n.defer,c,n.relativeTemplatePath,BK());QF(u,Et.Tmpl);let h=uK(u,i);if(u.contentSelectors!==null&&t.set("ngContentSelectors",u.contentSelectors),t.set("decls",Te(u.root.decls)),t.set("vars",Te(u.root.vars)),u.consts.length>0&&(u.constsInitializers.length>0?t.set("consts",Ds([],[...u.constsInitializers,new xr(Gi(u.consts))])):t.set("consts",Gi(u.consts))),t.set("template",h),n.declarationListEmitMode!==3&&n.declarations.length>0)t.set("dependencies",rZ(Gi(n.declarations.map(b=>b.type)),n.declarationListEmitMode));else if(n.declarationListEmitMode===3){let b=[n.type.value];n.rawImports&&b.push(n.rawImports),t.set("dependencies",Ut(fe.getComponentDepsFactory).callFn(b))}n.encapsulation===null&&(n.encapsulation=Sp.Emulated);let _=!!n.externalStyles?.length;if(n.styles&&n.styles.length){let M=(n.encapsulation==Sp.Emulated?uZ(n.styles,tZ,eZ):n.styles).reduce((w,y)=>(y.trim().length>0&&w.push(i.getConstLiteral(Te(y))),w),[]);M.length>0&&(_=!0,t.set("styles",Gi(M)))}!_&&n.encapsulation===Sp.Emulated&&(n.encapsulation=Sp.None),n.encapsulation!==Sp.Emulated&&t.set("encapsulation",Te(n.encapsulation)),n.animations!==null&&t.set("data",nl([{key:"animation",value:n.animations,quoted:!1}])),n.changeDetection!==null&&(typeof n.changeDetection=="number"&&n.changeDetection!==mE.Default?t.set("changeDetection",Te(n.changeDetection)):typeof n.changeDetection=="object"&&t.set("changeDetection",n.changeDetection));let S=Ut(fe.defineComponent).callFn([t.toLiteralMap()],void 0,!0),x=oZ(n);return{expression:S,type:x,statements:[]}}function oZ(n){let i=c6(n);return i.push(iE(n.template.ngContentSelectors)),i.push(ra(Te(n.isStandalone))),i.push(d6(n)),n.isSignal&&i.push(ra(Te(n.isSignal))),ra(Ut(fe.ComponentDeclaration,i))}function rZ(n,i){switch(i){case 0:return n;case 1:return Ds([],n);case 2:let e=n.prop("map").callFn([Ut(fe.resolveForwardRef)]);return Ds([],e);case 3:throw new Error("Unsupported with an array of pre-resolved dependencies")}}function aZ(n){return ra(Te(n))}function nE(n){let i=Object.keys(n).map(e=>{let t=Array.isArray(n[e])?n[e][0]:n[e];return{key:e,value:Te(t),quoted:!0}});return nl(i)}function iE(n){return n.length>0?ra(Gi(n.map(i=>Te(i)))):yc}function c6(n){let i=n.selector!==null?n.selector.replace(/\n/g,""):null;return[nb(n.type.type,n.typeArgumentCount),i!==null?aZ(i):yc,n.exportAs!==null?iE(n.exportAs):yc,ra(sZ(n)),ra(nE(n.outputs)),iE(n.queries.map(e=>e.propertyName))]}function sZ(n){return nl(Object.keys(n.inputs).map(i=>{let e=n.inputs[i],t=[{key:"alias",value:Te(e.bindingPropertyName),quoted:!0},{key:"required",value:Te(e.required),quoted:!0}];return e.isSignal&&t.push({key:"isSignal",value:Te(e.isSignal),quoted:!0}),{key:i,value:nl(t),quoted:!0}}))}function lZ(n){let i=c6(n);return i.push(yc),i.push(ra(Te(n.isStandalone))),i.push(d6(n)),n.isSignal&&i.push(ra(Te(n.isSignal))),ra(Ut(fe.DirectiveDeclaration,i))}function cZ(n,i,e,t,o,r,a){let c=e.createBoundHostProperties(n.properties,i),p=e.createDirectiveHostEventAsts(n.listeners,i);n.specialAttributes.styleAttr&&(n.attributes.style=Te(n.specialAttributes.styleAttr)),n.specialAttributes.classAttr&&(n.attributes.class=Te(n.specialAttributes.classAttr));let u=vK({componentName:r,componentSelector:o,properties:c,events:p,attributes:n.attributes},e,t);QF(u,Et.Host),a.set("hostAttrs",u.root.attributes);let h=u.root.vars;return h!==null&&h>0&&a.set("hostVars",Te(h)),hK(u)}var dZ=/^(?:\[([^\]]+)\])|(?:\(([^\)]+)\))$/;function mZ(n){let i={},e={},t={},o={};for(let r of Object.keys(n)){let a=n[r],c=r.match(dZ);if(c===null)switch(r){case"class":if(typeof a!="string")throw new Error("Class binding must be string");o.classAttr=a;break;case"style":if(typeof a!="string")throw new Error("Style binding must be string");o.styleAttr=a;break;default:typeof a=="string"?i[r]=Te(a):i[r]=a}else if(c[1]!=null){if(typeof a!="string")throw new Error("Property binding must be string");t[c[1]]=a}else if(c[2]!=null){if(typeof a!="string")throw new Error("Event binding must be string");e[c[2]]=a}}return{attributes:i,listeners:e,properties:t,specialAttributes:o}}function pZ(n,i){let e=Z1();return e.createDirectiveHostEventAsts(n.listeners,i),e.createBoundHostProperties(n.properties,i),e.errors}function uZ(n,i,e){let t=new uT;return n.map(o=>t.shimCssText(o,i,e))}function d6(n){return n.hostDirectives?.length?ra(Gi(n.hostDirectives.map(i=>nl([{key:"directive",value:r0(i.directive.type),quoted:!1},{key:"inputs",value:nE(i.inputs||{}),quoted:!1},{key:"outputs",value:nE(i.outputs||{}),quoted:!1}])))):yc}function hZ(n){let i=[],e=!1;for(let t of n){if(!t.inputs&&!t.outputs)i.push(t.directive.type);else{let o=[{key:"directive",value:t.directive.type,quoted:!1}];if(t.inputs){let r=ON(t.inputs);r&&o.push({key:"inputs",value:r,quoted:!1})}if(t.outputs){let r=ON(t.outputs);r&&o.push({key:"outputs",value:r,quoted:!1})}i.push(nl(o))}t.isForwardReference&&(e=!0)}return e?new om([],[new xr(Gi(i))]):Gi(i)}function ON(n){let i=[];for(let e in n)n.hasOwnProperty(e)&&i.push(Te(e),Te(n[e]));return i.length>0?Gi(i):null}var oE=class extends Mh{visit(i){i instanceof ts?this.visit(i.ast):i.visit(this)}visitElement(i){this.visitAllTemplateNodes(i.attributes),this.visitAllTemplateNodes(i.inputs),this.visitAllTemplateNodes(i.outputs),this.visitAllTemplateNodes(i.directives),this.visitAllTemplateNodes(i.references),this.visitAllTemplateNodes(i.children)}visitTemplate(i){this.visitAllTemplateNodes(i.attributes),this.visitAllTemplateNodes(i.inputs),this.visitAllTemplateNodes(i.outputs),this.visitAllTemplateNodes(i.directives),this.visitAllTemplateNodes(i.templateAttrs),this.visitAllTemplateNodes(i.variables),this.visitAllTemplateNodes(i.references),this.visitAllTemplateNodes(i.children)}visitContent(i){this.visitAllTemplateNodes(i.children)}visitBoundAttribute(i){this.visit(i.value)}visitBoundEvent(i){this.visit(i.handler)}visitBoundText(i){this.visit(i.value)}visitIcu(i){Object.keys(i.vars).forEach(e=>this.visit(i.vars[e])),Object.keys(i.placeholders).forEach(e=>this.visit(i.placeholders[e]))}visitDeferredBlock(i){i.visitAll(this)}visitDeferredTrigger(i){i instanceof g1?this.visit(i.value):i instanceof E_&&i.options!==null&&this.visit(i.options)}visitDeferredBlockPlaceholder(i){this.visitAllTemplateNodes(i.children)}visitDeferredBlockError(i){this.visitAllTemplateNodes(i.children)}visitDeferredBlockLoading(i){this.visitAllTemplateNodes(i.children)}visitSwitchBlock(i){this.visit(i.expression),this.visitAllTemplateNodes(i.groups)}visitSwitchBlockCase(i){i.expression&&this.visit(i.expression)}visitSwitchBlockCaseGroup(i){this.visitAllTemplateNodes(i.cases),this.visitAllTemplateNodes(i.children)}visitSwitchExhaustiveCheck(i){}visitForLoopBlock(i){i.item.visit(this),this.visitAllTemplateNodes(i.contextVariables),this.visit(i.expression),this.visitAllTemplateNodes(i.children),i.empty?.visit(this)}visitForLoopBlockEmpty(i){this.visitAllTemplateNodes(i.children)}visitIfBlock(i){this.visitAllTemplateNodes(i.branches)}visitIfBlockBranch(i){i.expression&&this.visit(i.expression),i.expressionAlias?.visit(this),this.visitAllTemplateNodes(i.children)}visitLetDeclaration(i){this.visit(i.value)}visitComponent(i){this.visitAllTemplateNodes(i.attributes),this.visitAllTemplateNodes(i.inputs),this.visitAllTemplateNodes(i.outputs),this.visitAllTemplateNodes(i.directives),this.visitAllTemplateNodes(i.references),this.visitAllTemplateNodes(i.children)}visitDirective(i){this.visitAllTemplateNodes(i.attributes),this.visitAllTemplateNodes(i.inputs),this.visitAllTemplateNodes(i.outputs),this.visitAllTemplateNodes(i.references)}visitVariable(i){}visitReference(i){}visitTextAttribute(i){}visitText(i){}visitUnknownBlock(i){}visitAllTemplateNodes(i){for(let e of i)this.visit(e)}};var rE=class{directiveMatcher;constructor(i){this.directiveMatcher=i}bind(i){if(!i.template&&!i.host)throw new Error("Empty bound targets are not supported");let e=new Map,t=[],o=new Set,r=new Map,a=new Map,c=new Map,p=new Map,u=new Map,h=new Map,_=new Set,S=new Set,x=[];if(i.template){let b=J1.apply(i.template);fZ(b,c),aE.apply(i.template,this.directiveMatcher,e,t,o,r,a),eb.applyWithScope(i.template,b,p,u,h,_,S,x)}return i.host&&(e.set(i.host.node,i.host.directives),eb.applyWithScope(i.host.node,J1.apply(i.host.node),p,u,h,_,S,x)),new sE(i,e,t,o,r,a,p,u,h,c,_,S,x)}},J1=class n{parentScope;rootNode;namedEntities=new Map;elementLikeInScope=new Set;childScopes=new Map;isDeferred;constructor(i,e){this.parentScope=i,this.rootNode=e,this.isDeferred=i!==null&&i.isDeferred?!0:e instanceof qp}static newRootScope(){return new n(null,null)}static apply(i){let e=n.newRootScope();return e.ingest(i),e}ingest(i){i instanceof ks?(i.variables.forEach(e=>this.visitVariable(e)),i.children.forEach(e=>e.visit(this))):i instanceof Ap?(i.expressionAlias!==null&&this.visitVariable(i.expressionAlias),i.children.forEach(e=>e.visit(this))):i instanceof Eh?(this.visitVariable(i.item),i.contextVariables.forEach(e=>this.visitVariable(e)),i.children.forEach(e=>e.visit(this))):i instanceof A_||i instanceof O_||i instanceof qp||i instanceof I_||i instanceof D_||i instanceof P_||i instanceof Dh?i.children.forEach(e=>e.visit(this)):i instanceof F_||i.forEach(e=>e.visit(this))}visitElement(i){this.visitElementLike(i)}visitTemplate(i){i.directives.forEach(e=>e.visit(this)),i.references.forEach(e=>this.visitReference(e)),this.ingestScopedNode(i)}visitVariable(i){this.maybeDeclare(i)}visitReference(i){this.maybeDeclare(i)}visitDeferredBlock(i){this.ingestScopedNode(i),i.placeholder?.visit(this),i.loading?.visit(this),i.error?.visit(this)}visitDeferredBlockPlaceholder(i){this.ingestScopedNode(i)}visitDeferredBlockError(i){this.ingestScopedNode(i)}visitDeferredBlockLoading(i){this.ingestScopedNode(i)}visitSwitchBlock(i){i.groups.forEach(e=>e.visit(this))}visitSwitchBlockCase(i){}visitSwitchBlockCaseGroup(i){this.ingestScopedNode(i)}visitSwitchExhaustiveCheck(i){}visitForLoopBlock(i){this.ingestScopedNode(i),i.empty?.visit(this)}visitForLoopBlockEmpty(i){this.ingestScopedNode(i)}visitIfBlock(i){i.branches.forEach(e=>e.visit(this))}visitIfBlockBranch(i){this.ingestScopedNode(i)}visitContent(i){this.ingestScopedNode(i)}visitLetDeclaration(i){this.maybeDeclare(i)}visitComponent(i){this.visitElementLike(i)}visitDirective(i){i.references.forEach(e=>this.visitReference(e))}visitBoundAttribute(i){}visitBoundEvent(i){}visitBoundText(i){}visitText(i){}visitTextAttribute(i){}visitIcu(i){}visitDeferredTrigger(i){}visitUnknownBlock(i){}visitElementLike(i){i.directives.forEach(e=>e.visit(this)),i.references.forEach(e=>this.visitReference(e)),i.children.forEach(e=>e.visit(this)),this.elementLikeInScope.add(i)}maybeDeclare(i){this.namedEntities.has(i.name)||this.namedEntities.set(i.name,i)}lookup(i){return this.namedEntities.has(i)?this.namedEntities.get(i):this.parentScope!==null?this.parentScope.lookup(i):null}getChildScope(i){let e=this.childScopes.get(i);if(e===void 0)throw new Error(`Assertion error: child scope for ${i} not found`);return e}ingestScopedNode(i){let e=new n(this,i);e.ingest(i),this.childScopes.set(i,e)}},aE=class n{directiveMatcher;directives;eagerDirectives;missingDirectives;bindings;references;isInDeferBlock=!1;constructor(i,e,t,o,r,a){this.directiveMatcher=i,this.directives=e,this.eagerDirectives=t,this.missingDirectives=o,this.bindings=r,this.references=a}static apply(i,e,t,o,r,a,c){new n(e,t,o,r,a,c).ingest(i)}ingest(i){i.forEach(e=>e.visit(this))}visitElement(i){this.visitElementOrTemplate(i)}visitTemplate(i){this.visitElementOrTemplate(i)}visitDeferredBlock(i){let e=this.isInDeferBlock;this.isInDeferBlock=!0,i.children.forEach(t=>t.visit(this)),this.isInDeferBlock=e,i.placeholder?.visit(this),i.loading?.visit(this),i.error?.visit(this)}visitDeferredBlockPlaceholder(i){i.children.forEach(e=>e.visit(this))}visitDeferredBlockError(i){i.children.forEach(e=>e.visit(this))}visitDeferredBlockLoading(i){i.children.forEach(e=>e.visit(this))}visitSwitchBlock(i){i.groups.forEach(e=>e.visit(this))}visitSwitchBlockCase(i){}visitSwitchBlockCaseGroup(i){i.children.forEach(e=>e.visit(this))}visitSwitchExhaustiveCheck(i){}visitForLoopBlock(i){i.item.visit(this),i.contextVariables.forEach(e=>e.visit(this)),i.children.forEach(e=>e.visit(this)),i.empty?.visit(this)}visitForLoopBlockEmpty(i){i.children.forEach(e=>e.visit(this))}visitIfBlock(i){i.branches.forEach(e=>e.visit(this))}visitIfBlockBranch(i){i.expressionAlias?.visit(this),i.children.forEach(e=>e.visit(this))}visitContent(i){i.children.forEach(e=>e.visit(this))}visitComponent(i){if(this.directiveMatcher instanceof QC){let e=this.directiveMatcher.match(i.componentName);e.length>0?this.trackSelectorlessMatchesAndDirectives(i,e):this.missingDirectives.add(i.componentName)}i.directives.forEach(e=>e.visit(this)),i.children.forEach(e=>e.visit(this))}visitDirective(i){if(this.directiveMatcher instanceof QC){let e=this.directiveMatcher.match(i.name);e.length>0?this.trackSelectorlessMatchesAndDirectives(i,e):this.missingDirectives.add(i.name)}}visitElementOrTemplate(i){if(this.directiveMatcher instanceof qC){let e=[],t=rH(i);this.directiveMatcher.match(t,(o,r)=>e.push(...r)),this.trackSelectorBasedBindingsAndDirectives(i,e)}else i.references.forEach(e=>{e.value.trim()===""&&this.references.set(e,i)});i.directives.forEach(e=>e.visit(this)),i.children.forEach(e=>e.visit(this))}trackMatchedDirectives(i,e){e.length>0&&(this.directives.set(i,e),this.isInDeferBlock||this.eagerDirectives.push(...e))}trackSelectorlessMatchesAndDirectives(i,e){if(e.length===0)return;this.trackMatchedDirectives(i,e);let t=(o,r,a)=>{o[a].hasBindingPropertyName(r.name)&&this.bindings.set(r,o)};for(let o of e)i.inputs.forEach(r=>t(o,r,"inputs")),i.attributes.forEach(r=>t(o,r,"inputs")),i.outputs.forEach(r=>t(o,r,"outputs"));i.references.forEach(o=>this.references.set(o,{directive:e[0],node:i}))}trackSelectorBasedBindingsAndDirectives(i,e){this.trackMatchedDirectives(i,e),i.references.forEach(o=>{let r=null;if(o.value.trim()==="")r=e.find(a=>a.isComponent)||null;else if(r=e.find(a=>a.exportAs!==null&&a.exportAs.some(c=>c===o.value))||null,r===null)return;r!==null?this.references.set(o,{directive:r,node:i}):this.references.set(o,i)});let t=(o,r)=>{let a=e.find(p=>p[r].hasBindingPropertyName(o.name)),c=a!==void 0?a:i;this.bindings.set(o,c)};i.inputs.forEach(o=>t(o,"inputs")),i.attributes.forEach(o=>t(o,"inputs")),i instanceof ks&&i.templateAttrs.forEach(o=>t(o,"inputs")),i.outputs.forEach(o=>t(o,"outputs"))}visitVariable(i){}visitReference(i){}visitTextAttribute(i){}visitBoundAttribute(i){}visitBoundEvent(i){}visitBoundAttributeOrEvent(i){}visitText(i){}visitBoundText(i){}visitIcu(i){}visitDeferredTrigger(i){}visitUnknownBlock(i){}visitLetDeclaration(i){}},eb=class n extends oE{bindings;symbols;usedPipes;eagerPipes;deferBlocks;nestingLevel;scope;rootNode;level;visitNode=i=>i.visit(this);constructor(i,e,t,o,r,a,c,p,u){super(),this.bindings=i,this.symbols=e,this.usedPipes=t,this.eagerPipes=o,this.deferBlocks=r,this.nestingLevel=a,this.scope=c,this.rootNode=p,this.level=u}static applyWithScope(i,e,t,o,r,a,c,p){let u=i instanceof ks?i:null;new n(t,o,a,c,p,r,e,u,0).ingest(i)}ingest(i){if(i instanceof ks)i.variables.forEach(this.visitNode),i.children.forEach(this.visitNode),this.nestingLevel.set(i,this.level);else if(i instanceof Ap)i.expressionAlias!==null&&this.visitNode(i.expressionAlias),i.children.forEach(this.visitNode),this.nestingLevel.set(i,this.level);else if(i instanceof Eh)this.visitNode(i.item),i.contextVariables.forEach(e=>this.visitNode(e)),i.trackBy.visit(this),i.children.forEach(this.visitNode),this.nestingLevel.set(i,this.level);else if(i instanceof qp){if(this.scope.rootNode!==i)throw new Error(`Assertion error: resolved incorrect scope for deferred block ${i}`);this.deferBlocks.push([i,this.scope]),i.children.forEach(e=>e.visit(this)),this.nestingLevel.set(i,this.level)}else i instanceof A_||i instanceof O_||i instanceof I_||i instanceof D_||i instanceof P_||i instanceof Dh?(i.children.forEach(e=>e.visit(this)),this.nestingLevel.set(i,this.level)):i instanceof F_?this.nestingLevel.set(i,0):i.forEach(this.visitNode)}visitTemplate(i){i.inputs.forEach(this.visitNode),i.outputs.forEach(this.visitNode),i.directives.forEach(this.visitNode),i.templateAttrs.forEach(this.visitNode),i.references.forEach(this.visitNode),this.ingestScopedNode(i)}visitVariable(i){this.rootNode!==null&&this.symbols.set(i,this.rootNode)}visitReference(i){this.rootNode!==null&&this.symbols.set(i,this.rootNode)}visitDeferredBlock(i){this.ingestScopedNode(i),i.triggers.when?.value.visit(this),i.prefetchTriggers.when?.value.visit(this),i.hydrateTriggers.when?.value.visit(this),i.hydrateTriggers.never?.visit(this),i.placeholder&&this.visitNode(i.placeholder),i.loading&&this.visitNode(i.loading),i.error&&this.visitNode(i.error)}visitDeferredBlockPlaceholder(i){this.ingestScopedNode(i)}visitDeferredBlockError(i){this.ingestScopedNode(i)}visitDeferredBlockLoading(i){this.ingestScopedNode(i)}visitSwitchBlockCase(i){i.expression?.visit(this)}visitSwitchBlockCaseGroup(i){i.cases.forEach(e=>e.visit(this)),this.ingestScopedNode(i)}visitSwitchExhaustiveCheck(i){}visitForLoopBlock(i){i.expression.visit(this),this.ingestScopedNode(i),i.empty?.visit(this)}visitForLoopBlockEmpty(i){this.ingestScopedNode(i)}visitIfBlockBranch(i){i.expression?.visit(this),this.ingestScopedNode(i)}visitContent(i){this.ingestScopedNode(i)}visitLetDeclaration(i){super.visitLetDeclaration(i),this.rootNode!==null&&this.symbols.set(i,this.rootNode)}visitPipe(i,e){return this.usedPipes.add(i.name),this.scope.isDeferred||this.eagerPipes.add(i.name),super.visitPipe(i,e)}visitPropertyRead(i,e){return this.maybeMap(i,i.name),super.visitPropertyRead(i,e)}visitSafePropertyRead(i,e){return this.maybeMap(i,i.name),super.visitSafePropertyRead(i,e)}ingestScopedNode(i){let e=this.scope.getChildScope(i);new n(this.bindings,this.symbols,this.usedPipes,this.eagerPipes,this.deferBlocks,this.nestingLevel,e,i,this.level+1).ingest(i)}maybeMap(i,e){if(!(i.receiver instanceof Mc))return;let t=this.scope.lookup(e);t!==null&&this.bindings.set(i,t)}},sE=class{target;directives;eagerDirectives;missingDirectives;bindings;references;exprTargets;symbols;nestingLevel;scopedNodeEntities;usedPipes;eagerPipes;deferredBlocks;deferredScopes;constructor(i,e,t,o,r,a,c,p,u,h,_,S,x){this.target=i,this.directives=e,this.eagerDirectives=t,this.missingDirectives=o,this.bindings=r,this.references=a,this.exprTargets=c,this.symbols=p,this.nestingLevel=u,this.scopedNodeEntities=h,this.usedPipes=_,this.eagerPipes=S,this.deferredBlocks=x.map(b=>b[0]),this.deferredScopes=new Map(x)}getEntitiesInScope(i){return this.scopedNodeEntities.get(i)??new Set}getDirectivesOfNode(i){return this.directives.get(i)||null}getReferenceTarget(i){return this.references.get(i)||null}getConsumerOfBinding(i){return this.bindings.get(i)||null}getExpressionTarget(i){return this.exprTargets.get(i)||null}getDefinitionNodeOfSymbol(i){return this.symbols.get(i)||null}getNestingLevel(i){return this.nestingLevel.get(i)||0}getUsedDirectives(){let i=new Set;return this.directives.forEach(e=>e.forEach(t=>i.add(t))),Array.from(i.values())}getEagerlyUsedDirectives(){let i=new Set(this.eagerDirectives);return Array.from(i.values())}getUsedPipes(){return Array.from(this.usedPipes)}getEagerlyUsedPipes(){return Array.from(this.eagerPipes)}getDeferBlocks(){return this.deferredBlocks}getDeferredTriggerTarget(i,e){if(!(e instanceof v1)&&!(e instanceof E_)&&!(e instanceof _1))return null;let t=e.reference;if(t===null){let r=null;if(i.placeholder!==null){for(let a of i.placeholder.children)if(!(a instanceof ib)){if(r!==null)return null;a instanceof kc&&(r=a)}}return r}let o=this.findEntityInScope(i,t);if(o instanceof N_&&this.getDefinitionNodeOfSymbol(o)!==i){let r=this.getReferenceTarget(o);if(r!==null)return this.referenceTargetToElement(r)}if(i.placeholder!==null){let r=this.findEntityInScope(i.placeholder,t),a=r instanceof N_?this.getReferenceTarget(r):null;if(a!==null)return this.referenceTargetToElement(a)}return null}isDeferred(i){for(let e of this.deferredBlocks){if(!this.deferredScopes.has(e))continue;let t=[this.deferredScopes.get(e)];for(;t.length>0;){let o=t.pop();if(o.elementLikeInScope.has(i))return!0;t.push(...o.childScopes.values())}}return!1}referencedDirectiveExists(i){return!this.missingDirectives.has(i)}findEntityInScope(i,e){let t=this.getEntitiesInScope(i);for(let o of t)if(o.name===e)return o;return null}referenceTargetToElement(i){return i instanceof kc?i:i instanceof ks||i.node instanceof e_||i.node instanceof QN||i.node instanceof F_?null:this.referenceTargetToElement(i.node)}};function fZ(n,i){let e=new Map;function t(r){if(e.has(r.rootNode))return e.get(r.rootNode);let a=r.namedEntities,c;return r.parentScope!==null?c=new Map([...t(r.parentScope),...a]):c=new Map(a),e.set(r.rootNode,c),c}let o=[n];for(;o.length>0;){let r=o.pop();for(let a of r.childScopes.values())o.push(a);t(r)}for(let[r,a]of e)i.set(r,new Set(a.values()))}var lE=class{},cE=class{jitEvaluator;FactoryTarget=gd;ResourceLoader=lE;elementSchemaRegistry=new Rh;constructor(i=new dT){this.jitEvaluator=i}compilePipe(i,e,t){let o={name:t.name,type:Nr(t.type),typeArgumentCount:0,pipeName:t.pipeName,pure:t.pure,isStandalone:t.isStandalone},r=v5(o);return this.jitExpression(r.expression,i,e,[])}compilePipeDeclaration(i,e,t){let o=AZ(t),r=v5(o);return this.jitExpression(r.expression,i,e,[])}compileInjectable(i,e,t){let{expression:o,statements:r}=l5({name:t.name,type:Nr(t.type),typeArgumentCount:t.typeArgumentCount,providedIn:BN(t.providedIn),useClass:sh(t,"useClass"),useFactory:VN(t,"useFactory"),useValue:sh(t,"useValue"),useExisting:sh(t,"useExisting"),deps:t.deps?.map(h6)},!0);return this.jitExpression(o,i,e,r)}compileInjectableDeclaration(i,e,t){let{expression:o,statements:r}=l5({name:t.type.name,type:Nr(t.type),typeArgumentCount:0,providedIn:BN(t.providedIn),useClass:sh(t,"useClass"),useFactory:VN(t,"useFactory"),useValue:sh(t,"useValue"),useExisting:sh(t,"useExisting"),deps:t.deps?.map(zN)},!0);return this.jitExpression(o,i,e,r)}compileInjector(i,e,t){let o={type:Nr(t.type),providers:t.providers&&t.providers.length>0?new oi(t.providers):null,imports:t.imports.map(a=>new oi(a))},r=_5(o);return this.jitExpression(r.expression,i,e,[])}compileInjectorDeclaration(i,e,t){let o=OZ(t),r=_5(o);return this.jitExpression(r.expression,i,e,[])}compileNgModule(i,e,t){let o={kind:im.Global,type:Nr(t.type),bootstrap:t.bootstrap.map(Nr),declarations:t.declarations.map(Nr),publicDeclarationTypes:null,imports:t.imports.map(Nr),includeImportTypes:!0,exports:t.exports.map(Nr),selectorScopeMode:T1.Inline,containsForwardDecls:!1,schemas:t.schemas?t.schemas.map(Nr):null,id:t.id?new oi(t.id):null},r=MH(o);return this.jitExpression(r.expression,i,e,[])}compileNgModuleDeclaration(i,e,t){let o=kH(t);return this.jitExpression(o,i,e,[])}compileDirective(i,e,t){let o=RN(t);return this.compileDirectiveFromMeta(i,e,o)}compileDirectiveDeclaration(i,e,t){let o=this.createParseSourceSpan("Directive",t.type.name,e),r=p6(t,o);return this.compileDirectiveFromMeta(i,e,r)}compileDirectiveFromMeta(i,e,t){let o=new o1,r=Z1(),a=nZ(t,o,r);return this.jitExpression(a.expression,i,e,o.statements)}compileComponent(i,e,t){let{template:o,defer:r}=u6(t.template,t.name,e,t.preserveWhitespaces,void 0),a=it(K(K({},t),RN(t)),{selector:t.selector||this.elementSchemaRegistry.getDefaultComponentElementName(),template:o,declarations:t.declarations.map(CZ),declarationListEmitMode:0,defer:r,styles:[...t.styles,...o.styles],encapsulation:t.encapsulation,changeDetection:t.changeDetection??null,animations:t.animations!=null?new oi(t.animations):null,viewProviders:t.viewProviders!=null?new oi(t.viewProviders):null,relativeContextFilePath:"",i18nUseExternalIds:!0,relativeTemplatePath:null}),c=`ng:///${t.name}.js`;return this.compileComponentFromMeta(i,c,a)}compileComponentDeclaration(i,e,t){let o=this.createParseSourceSpan("Component",t.type.name,e),r=vZ(t,o,e);return this.compileComponentFromMeta(i,e,r)}compileComponentFromMeta(i,e,t){let o=new o1,r=Z1(),a=iZ(t,o,r);return this.jitExpression(a.expression,i,e,o.statements)}compileFactory(i,e,t){let o=wp({name:t.name,type:Nr(t.type),typeArgumentCount:t.typeArgumentCount,deps:yZ(t.deps),target:t.target});return this.jitExpression(o.expression,i,e,o.statements)}compileFactoryDeclaration(i,e,t){let o=wp({name:t.type.name,type:Nr(t.type),typeArgumentCount:0,deps:Array.isArray(t.deps)?t.deps.map(zN):t.deps,target:t.target});return this.jitExpression(o.expression,i,e,o.statements)}createParseSourceSpan(i,e,t){return vH(i,e,t)}jitExpression(i,e,t,o){let r=[...o,new Rr("$def",i,void 0,oa.Exported)];return this.jitEvaluator.evaluateStatements(t,r,new pT(e),!0).$def}};function NN(n){return it(K({},n),{isSignal:n.isSignal,predicate:m6(n.predicate),read:n.read?new oi(n.read):null,static:n.static,emitDistinctChangesOnly:n.emitDistinctChangesOnly})}function FN(n){return{propertyName:n.propertyName,first:n.first??!1,predicate:m6(n.predicate),descendants:n.descendants??!1,read:n.read?new oi(n.read):null,static:n.static??!1,emitDistinctChangesOnly:n.emitDistinctChangesOnly??!0,isSignal:!!n.isSignal}}function m6(n){return Array.isArray(n)?n:fE(new oi(n),1)}function RN(n){let i=IZ(n.inputs||[]),e=Nk(n.outputs||[]),t=n.propMetadata,o={},r={};for(let c in t)t.hasOwnProperty(c)&&t[c].forEach(p=>{TZ(p)?o[c]={bindingPropertyName:p.alias||c,classPropertyName:c,required:p.required||!1,isSignal:!!p.isSignal,transformFunction:p.transform!=null?new oi(p.transform):null}:EZ(p)&&(r[c]=p.alias||c)});let a=n.hostDirectives?.length?n.hostDirectives.map(c=>typeof c=="function"?{directive:Nr(c),inputs:null,outputs:null,isForwardReference:!1}:{directive:Nr(c.directive),isForwardReference:!1,inputs:c.inputs?Nk(c.inputs):null,outputs:c.outputs?Nk(c.outputs):null}):null;return it(K({},n),{typeArgumentCount:0,typeSourceSpan:n.typeSourceSpan,type:Nr(n.type),deps:null,host:K({},wZ(n.propMetadata,n.typeSourceSpan,n.host)),inputs:K(K({},i),o),outputs:K(K({},e),r),queries:n.queries.map(NN),providers:n.providers!=null?new oi(n.providers):null,viewQueries:n.viewQueries.map(NN),hostDirectives:a})}function p6(n,i){let e=n.hostDirectives?.length?n.hostDirectives.map(t=>({directive:Nr(t.directive),isForwardReference:!1,inputs:t.inputs?LN(t.inputs):null,outputs:t.outputs?LN(t.outputs):null})):null;return{name:n.type.name,type:Nr(n.type),typeSourceSpan:i,selector:n.selector??null,inputs:n.inputs?DZ(n.inputs):{},outputs:n.outputs??{},host:gZ(n.host),queries:(n.queries??[]).map(FN),viewQueries:(n.viewQueries??[]).map(FN),providers:n.providers!==void 0?new oi(n.providers):null,exportAs:n.exportAs??null,usesInheritance:n.usesInheritance??!1,controlCreate:n.controlCreate??null,lifecycle:{usesOnChanges:n.usesOnChanges??!1},deps:null,typeArgumentCount:0,isStandalone:n.isStandalone??qN(n.version),isSignal:n.isSignal??!1,hostDirectives:e}}function gZ(n={}){return{attributes:_Z(n.attributes??{}),listeners:n.listeners??{},properties:n.properties??{},specialAttributes:{classAttr:n.classAttribute,styleAttr:n.styleAttribute}}}function LN(n){let i=null;for(let e=1;e<n.length;e+=2)i=i||{},i[n[e-1]]=n[e];return i}function _Z(n){let i={};for(let e of Object.keys(n))i[e]=new oi(n[e]);return i}function vZ(n,i,e){let{template:t,defer:o}=u6(n.template,n.type.name,e,n.preserveWhitespaces??!1,n.deferBlockDependencies),r=[];if(n.dependencies)for(let c of n.dependencies)switch(c.kind){case"directive":case"component":r.push(Ok(c));break;case"pipe":r.push(xZ(c));break}else(n.components||n.directives||n.pipes)&&(n.components&&r.push(...n.components.map(c=>Ok(c,!0))),n.directives&&r.push(...n.directives.map(c=>Ok(c))),n.pipes&&r.push(...bZ(n.pipes)));let a=r.some(({kind:c})=>c===Ih.Directive||c===Ih.NgModule);return it(K({},p6(n,i)),{template:t,styles:n.styles??[],declarations:r,viewProviders:n.viewProviders!==void 0?new oi(n.viewProviders):null,animations:n.animations!==void 0?new oi(n.animations):null,defer:o,changeDetection:n.changeDetection??mE.Default,encapsulation:n.encapsulation??Sp.Emulated,declarationListEmitMode:2,relativeContextFilePath:"",i18nUseExternalIds:!0,relativeTemplatePath:null,hasDirectiveDependencies:a})}function CZ(n){return it(K({},n),{type:new oi(n.type)})}function Ok(n,i=null){return{kind:Ih.Directive,isComponent:i||n.kind==="component",selector:n.selector,type:new oi(n.type),inputs:n.inputs??[],outputs:n.outputs??[],exportAs:n.exportAs??null}}function bZ(n){return n?Object.keys(n).map(i=>({kind:Ih.Pipe,name:i,type:new oi(n[i])})):[]}function xZ(n){return{kind:Ih.Pipe,name:n.name,type:new oi(n.type)}}function u6(n,i,e,t,o){let r=ZY(n,e,{preserveWhitespaces:t});if(r.errors!==null){let p=r.errors.map(u=>u.toString()).join(", ");throw new Error(`Errors during JIT compilation of template for ${i}: ${p}`)}let c=new rE(null).bind({template:r.nodes});return{template:r,defer:SZ(c,o)}}function sh(n,i){if(n.hasOwnProperty(i))return fE(new oi(n[i]),0)}function VN(n,i){if(n.hasOwnProperty(i))return new oi(n[i])}function BN(n){let i=typeof n=="function"?new oi(n):new aa(n??null);return fE(i,0)}function yZ(n){return n==null?null:n.map(h6)}function h6(n){let i=n.attribute!=null,e=n.token===null?null:new oi(n.token),t=i?new oi(n.attribute):e;return f6(t,i,n.host,n.optional,n.self,n.skipSelf)}function zN(n){let i=n.attribute??!1,e=n.token===null?null:new oi(n.token);return f6(e,i,n.host??!1,n.optional??!1,n.self??!1,n.skipSelf??!1)}function f6(n,i,e,t,o,r){let a=i?Te("unknown"):null;return{token:n,attributeNameType:a,host:e,optional:t,self:o,skipSelf:r}}function SZ(n,i){let e=n.getDeferBlocks(),t=new Map;for(let o=0;o<e.length;o++){let r=i?.[o];t.set(e[o],r?new oi(r):null)}return{mode:0,blocks:t}}function wZ(n,i,e){let t=mZ(e||{}),o=pZ(t,i);if(o.length)throw new Error(o.map(r=>r.msg).join(`
`));for(let r in n)n.hasOwnProperty(r)&&n[r].forEach(a=>{MZ(a)?t.properties[a.hostPropertyName||r]=j$("this",r):kZ(a)&&(t.listeners[a.eventName||r]=`${r}(${(a.args||[]).join(",")})`)});return t}function MZ(n){return n.ngMetadataName==="HostBinding"}function kZ(n){return n.ngMetadataName==="HostListener"}function TZ(n){return n.ngMetadataName==="Input"}function EZ(n){return n.ngMetadataName==="Output"}function DZ(n){return Object.keys(n).reduce((i,e)=>{let t=n[e];return typeof t=="string"||Array.isArray(t)?i[e]=PZ(t):i[e]={bindingPropertyName:t.publicName,classPropertyName:e,transformFunction:t.transformFunction!==null?new oi(t.transformFunction):null,required:t.isRequired,isSignal:t.isSignal},i},{})}function PZ(n){return typeof n=="string"?{bindingPropertyName:n,classPropertyName:n,transformFunction:null,required:!1,isSignal:!1}:{bindingPropertyName:n[0],classPropertyName:n[1],transformFunction:n[2]?new oi(n[2]):null,required:!1,isSignal:!1}}function IZ(n){return n.reduce((i,e)=>{if(typeof e=="string"){let[t,o]=g6(e);i[o]={bindingPropertyName:t,classPropertyName:o,required:!1,isSignal:!1,transformFunction:null}}else i[e.name]={bindingPropertyName:e.alias||e.name,classPropertyName:e.name,required:e.required||!1,isSignal:!1,transformFunction:e.transform!=null?new oi(e.transform):null};return i},{})}function Nk(n){return n.reduce((i,e)=>{let[t,o]=g6(e);return i[o]=t,i},{})}function g6(n){let[i,e]=n.split(":",2).map(t=>t.trim());return[e??i,i]}function AZ(n){return{name:n.type.name,type:Nr(n.type),typeArgumentCount:0,pipeName:n.name,deps:null,pure:n.pure??!0,isStandalone:n.isStandalone??qN(n.version)}}function OZ(n){return{name:n.type.name,type:Nr(n.type),providers:n.providers!==void 0&&n.providers.length>0?new oi(n.providers):null,imports:n.imports!==void 0?n.imports.map(i=>new oi(i)):[]}}function NZ(n){let i=n.ng||(n.ng={});i.\u0275compilerFacade=new cE}var dE=class{closedByParent=!1;implicitNamespacePrefix=null;isVoid=!1;ignoreFirstLf=!1;canSelfClose=!0;preventNamespaceInheritance=!1;requireExtraParent(i){return!1}isClosedByChild(i){return!1}getContentType(){return gc.PARSABLE_DATA}},_5e=new dE;var v5e=new jk("21.2.6");NZ(Jg);function RE(n){let i=n.cloneNode(!0),e=i.querySelectorAll("[id]"),t=n.nodeName.toLowerCase();i.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return t==="canvas"?C6(n,i):(t==="input"||t==="select"||t==="textarea")&&v6(n,i),_6("canvas",n,i,C6),_6("input, textarea, select",n,i,v6),i}function _6(n,i,e,t){let o=i.querySelectorAll(n);if(o.length){let r=e.querySelectorAll(n);for(let a=0;a<o.length;a++)t(o[a],r[a])}}var RZ=0;function v6(n,i){i.type!=="file"&&(i.value=n.value),i.type==="radio"&&i.name&&(i.name=`mat-clone-${i.name}-${RZ++}`)}function C6(n,i){let e=i.getContext("2d");if(e)try{e.drawImage(n,0,0)}catch{}}function $E(n){let i=n.getBoundingClientRect();return{top:i.top,right:i.right,bottom:i.bottom,left:i.left,width:i.width,height:i.height,x:i.x,y:i.y}}function LE(n,i,e){let{top:t,bottom:o,left:r,right:a}=n;return e>=t&&e<=o&&i>=r&&i<=a}function LZ(n,i){let e=i.left<n.left,t=i.left+i.width>n.right,o=i.top<n.top,r=i.top+i.height>n.bottom;return e||t||o||r}function p0(n,i,e){n.top+=i,n.bottom=n.top+n.height,n.left+=e,n.right=n.left+n.width}function b6(n,i,e,t){let{top:o,right:r,bottom:a,left:c,width:p,height:u}=n,h=p*i,_=u*i;return t>o-_&&t<a+_&&e>c-h&&e<r+h}var cb=class{_document;positions=new Map;constructor(i){this._document=i}clear(){this.positions.clear()}cache(i){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),i.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:$E(e)})})}handleScroll(i){let e=Cp(i),t=this.positions.get(e);if(!t)return null;let o=t.scrollPosition,r,a;if(e===this._document){let u=this.getViewportScrollPosition();r=u.top,a=u.left}else r=e.scrollTop,a=e.scrollLeft;let c=o.top-r,p=o.left-a;return this.positions.forEach((u,h)=>{u.clientRect&&e!==h&&e.contains(h)&&p0(u.clientRect,c,p)}),o.top=r,o.left=a,{top:c,left:p}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function A6(n,i){let e=n.rootNodes;if(e.length===1&&e[0].nodeType===i.ELEMENT_NODE)return e[0];let t=i.createElement("div");return e.forEach(o=>t.appendChild(o)),t}function HE(n,i,e){for(let t in i)if(i.hasOwnProperty(t)){let o=i[t];o?n.setProperty(t,o,e?.has(t)?"important":""):n.removeProperty(t)}return n}function Hh(n,i){let e=i?"":"none";HE(n.style,{"touch-action":i?"":"none","-webkit-user-drag":i?"":"none","-webkit-tap-highlight-color":i?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function x6(n,i,e){HE(n.style,{position:i?"":"fixed",top:i?"":"0",opacity:i?"":"0",left:i?"":"-999em"},e)}function db(n,i){return i&&i!="none"?n+" "+i:n}function y6(n,i){n.style.width=`${i.width}px`,n.style.height=`${i.height}px`,n.style.transform=u0(i.left,i.top)}function u0(n,i){return`translate3d(${Math.round(n)}px, ${Math.round(i)}px, 0)`}var d0={capture:!0},NE={passive:!1,capture:!0},VZ=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(t,o){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
`],encapsulation:2,changeDetection:0})}return n})(),O6=(()=>{class n{_ngZone=f(Vi);_document=f(Xi);_styleLoader=f(cr);_renderer=f(sd).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new He;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=ae([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new He;pointerUp=new He;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,NE)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,t){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(VZ),this._activeDragInstances.update(o=>[...o,e]),this._activeDragInstances().length===1)){let o=t.type.startsWith("touch"),r=c=>this.pointerUp.next(c),a=[["scroll",c=>this._scroll.next(c),d0],["selectstart",this._preventDefaultWhileDragging,NE]];o?a.push(["touchend",r,d0],["touchcancel",r,d0]):a.push(["mouseup",r,d0]),o||a.push(["mousemove",c=>this.pointerMove.next(c),NE]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=a.map(([c,p,u])=>this._renderer.listen(this._document,c,p,u))})}}stopDragging(e){this._activeDragInstances.update(t=>{let o=t.indexOf(e);return o>-1?(t.splice(o,1),[...t]):t}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let t=[this._scroll];return e&&e!==this._document&&t.push(new Dr(o=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",a=>{this._activeDragInstances().length&&o.next(a)},d0);return()=>{r()}}))),Hn(...t)}registerDirectiveNode(e,t){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,t)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function S6(n){let i=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*i}function BZ(n){let i=getComputedStyle(n),e=FE(i,"transition-property"),t=e.find(c=>c==="transform"||c==="all");if(!t)return 0;let o=e.indexOf(t),r=FE(i,"transition-duration"),a=FE(i,"transition-delay");return S6(r[o])+S6(a[o])}function FE(n,i){return n.getPropertyValue(i).split(",").map(t=>t.trim())}var zZ=new Set(["position"]),VE=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(i,e,t,o,r,a,c,p,u,h){this._document=i,this._rootElement=e,this._direction=t,this._initialDomRect=o,this._previewTemplate=r,this._previewClass=a,this._pickupPositionOnPage=c,this._initialTransform=p,this._zIndex=u,this._renderer=h}attach(i){this._preview=this._createPreview(),i.appendChild(this._preview),w6(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(i){this._preview.style.transform=i}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(i){this._preview.classList.add(i)}getTransitionDuration(){return BZ(this._preview)}addEventListener(i,e){return this._renderer.listen(this._preview,i,e)}_createPreview(){let i=this._previewTemplate,e=this._previewClass,t=i?i.template:null,o;if(t&&i){let r=i.matchSize?this._initialDomRect:null,a=i.viewContainer.createEmbeddedView(t,i.context);a.detectChanges(),o=A6(a,this._document),this._previewEmbeddedView=a,i.matchSize?y6(o,r):o.style.transform=u0(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else o=RE(this._rootElement),y6(o,this._initialDomRect),this._initialTransform&&(o.style.transform=this._initialTransform);return HE(o.style,{"pointer-events":"none",margin:w6(o)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},zZ),Hh(o,!1),o.classList.add("cdk-drag-preview"),o.setAttribute("popover","manual"),o.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>o.classList.add(r)):o.classList.add(e)),o}};function w6(n){return"showPopover"in n}var jZ={passive:!0},M6={passive:!1},$Z={passive:!1,capture:!0},HZ=800,k6="cdk-drag-placeholder",T6=new Set(["position"]);function UZ(n,i,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let t=n.get(Si,null,{optional:!0})||n.get(sd).createRenderer(null,null);return new BE(i,e,n.get(Xi),n.get(Vi),n.get(dd),n.get(O6),t)}var BE=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=ae(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new He;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=So.EMPTY;_pointerUpSubscription=So.EMPTY;_scrollSubscription=So.EMPTY;_resizeSubscription=So.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(i){i!==this._disabled&&(this._disabled=i,this._toggleNativeDragInteractions(),this._handles.forEach(e=>Hh(e,i)))}_disabled=!1;beforeStarted=new He;started=new He;released=new He;ended=new He;entered=new He;exited=new He;dropped=new He;moved=this._moveEvents;data;constrainPosition;constructor(i,e,t,o,r,a,c){this._config=e,this._document=t,this._ngZone=o,this._viewportRuler=r,this._dragDropRegistry=a,this._renderer=c,this.withRootElement(i).withParent(e.parentDragRef||null),this._parentPositions=new cb(t),a.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(i){this._handles=i.map(t=>Al(t)),this._handles.forEach(t=>Hh(t,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(t=>{this._handles.indexOf(t)>-1&&e.add(t)}),this._disabledHandles=e,this}withPreviewTemplate(i){return this._previewTemplate=i,this}withPlaceholderTemplate(i){return this._placeholderTemplate=i,this}withRootElement(i){let e=Al(i);if(e!==this._rootElement){this._removeRootElementListeners();let t=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[t.listen(e,"mousedown",this._pointerDown,M6),t.listen(e,"touchstart",this._pointerDown,jZ),t.listen(e,"dragstart",this._nativeDragStart,M6)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(i){return this._boundaryElement=i?Al(i):null,this._resizeSubscription.unsubscribe(),i&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(i){return this._parentDragRef=i,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&LZ(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let i=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),t=0,o=0;e.left<i.left?t=i.left-e.left:e.right>i.right&&(t=i.right-e.right),e.top<i.top?o=i.top-e.top:e.bottom>i.bottom&&(o=i.bottom-e.bottom);let r=this._activeTransform.x,a=this._activeTransform.y,c=r+t,p=a+o;this._rootElement.style.transform=u0(c,p),this._activeTransform={x:c,y:p},this._passiveTransform={x:c,y:p}}}disableHandle(i){!this._disabledHandles.has(i)&&this._handles.indexOf(i)>-1&&(this._disabledHandles.add(i),Hh(i,!0))}enableHandle(i){this._disabledHandles.has(i)&&(this._disabledHandles.delete(i),Hh(i,this.disabled))}withDirection(i){return this._direction=i,this}_withDropContainer(i){this._dropContainer=i}getFreeDragPosition(){let i=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:i.x,y:i.y}}setFreeDragPosition(i){return this._activeTransform={x:0,y:0},this._passiveTransform.x=i.x,this._passiveTransform.y=i.y,this._dropContainer||this._applyRootElementTransform(i.x,i.y),this}withPreviewContainer(i){return this._previewContainer=i,this}_sortFromLastPointerPosition(){let i=this._lastKnownPointerPosition;i&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(i),i)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=i=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(i);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,i)}else this.disabled||this._initializeDragSequence(this._rootElement,i)};_pointerMove=i=>{let e=this._getPointerPositionOnPage(i);if(!this._hasStartedDragging()){let o=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(o+r>=this._config.dragStartThreshold){let c=Date.now()>=this._dragStartTime+this._getDragStartDelay(i),p=this._dropContainer;if(!c){this._endDragSequence(i);return}(!p||!p.isDragging()&&!p.isReceiving())&&(i.cancelable&&i.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(i)))}return}i.cancelable&&i.preventDefault();let t=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(t),this._dropContainer)this._updateActiveDropContainer(t,e);else{let o=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=t.x-o.x+this._passiveTransform.x,r.y=t.y-o.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:t,event:i,distance:this._getDragDistance(t),delta:this._pointerDirectionDelta})})};_pointerUp=i=>{this._endDragSequence(i)};_endDragSequence(i){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:i}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(i),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(i);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:i})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(i){m0(i)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),t=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",GZ,$Z)}),t){let o=this._rootElement,r=o.parentNode,a=this._placeholder=this._createPlaceholderElement(),c=this._marker=this._marker||this._document.createComment("");r.insertBefore(c,o),this._initialTransform=o.style.transform||"",this._preview=new VE(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(r,e)),x6(o,!1,T6),this._document.body.appendChild(r.replaceChild(a,o)),this.started.next({source:this,event:i}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this,event:i}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(i,e){this._parentDragRef&&e.stopPropagation();let t=this.isDragging(),o=m0(e),r=!o&&e.button!==0,a=this._rootElement,c=Cp(e),p=!o&&this._lastTouchEventTime&&this._lastTouchEventTime+HZ>Date.now(),u=o?dC(e):cC(e);if(c&&c.draggable&&e.type==="mousedown"&&e.preventDefault(),t||r||p||u)return;if(this._handles.length){let S=a.style;this._rootElementTapHighlight=S.webkitTapHighlightColor||"",S.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(S=>this._updateOnScroll(S)),this._boundaryElement&&(this._boundaryRect=$E(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,i,e);let _=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:_.x,y:_.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(i){x6(this._rootElement,!0,T6),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,t=e.getItemIndex(this),o=this._getPointerPositionOnPage(i),r=this._getDragDistance(o),a=e._isOverContainer(o.x,o.y);this.ended.next({source:this,distance:r,dropPoint:o,event:i}),this.dropped.next({item:this,currentIndex:t,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:r,dropPoint:o,event:i}),e.drop(this,t,this._initialIndex,this._initialContainer,a,r,o,i),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:i,y:e},{x:t,y:o}){let r=this._initialContainer._getSiblingContainerFromPosition(this,i,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(i,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let a=this._dropContainer.getItemIndex(this),c=this._dropContainer.getItemAtIndex(a+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,c),this._dropContainer=r,this._dropContainer.enter(this,i,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(t,o),this._dropContainer._sortItem(this,i,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(i,e):this._applyPreviewTransform(i-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let i=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(i.left,i.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{let o=c=>{(!c||this._preview&&Cp(c)===this._preview.element&&c.propertyName==="transform")&&(a(),t(),clearTimeout(r))},r=setTimeout(o,e*1.5),a=this._preview.addEventListener("transitionend",o)}))}_createPlaceholderElement(){let i=this._placeholderTemplate,e=i?i.template:null,t;return e?(this._placeholderRef=i.viewContainer.createEmbeddedView(e,i.context),this._placeholderRef.detectChanges(),t=A6(this._placeholderRef,this._document)):t=RE(this._rootElement),t.style.pointerEvents="none",t.classList.add(k6),t}_getPointerPositionInElement(i,e,t){let o=e===this._rootElement?null:e,r=o?o.getBoundingClientRect():i,a=m0(t)?t.targetTouches[0]:t,c=this._getViewportScrollPosition(),p=a.pageX-r.left-c.left,u=a.pageY-r.top-c.top;return{x:r.left-i.left+p,y:r.top-i.top+u}}_getPointerPositionOnPage(i){let e=this._getViewportScrollPosition(),t=m0(i)?i.touches[0]||i.changedTouches[0]||{pageX:0,pageY:0}:i,o=t.pageX-e.left,r=t.pageY-e.top;if(this._ownerSVGElement){let a=this._ownerSVGElement.getScreenCTM();if(a){let c=this._ownerSVGElement.createSVGPoint();return c.x=o,c.y=r,c.matrixTransform(a.inverse())}}return{x:o,y:r}}_getConstrainedPointerPosition(i){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:t,y:o}=this.constrainPosition?this.constrainPosition(i,this,this._initialDomRect,this._pickupPositionInElement):i;if(this.lockAxis==="x"||e==="x"?o=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(t=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:a}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,c=this._boundaryRect,{width:p,height:u}=this._getPreviewRect(),h=c.top+a,_=c.bottom-(u-a),S=c.left+r,x=c.right-(p-r);t=E6(t,S,x),o=E6(o,h,_)}return{x:t,y:o}}_updatePointerDirectionDelta(i){let{x:e,y:t}=i,o=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,a=Math.abs(e-r.x),c=Math.abs(t-r.y);return a>this._config.pointerDirectionChangeThreshold&&(o.x=e>r.x?1:-1,r.x=e),c>this._config.pointerDirectionChangeThreshold&&(o.y=t>r.y?1:-1,r.y=t),o}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let i=this._handles.length>0||!this.isDragging();i!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=i,Hh(this._rootElement,i))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(i=>i()),this._rootElementCleanups=void 0}_applyRootElementTransform(i,e){let t=1/this.scale,o=u0(i*t,e*t),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=db(o,this._initialTransform)}_applyPreviewTransform(i,e){let t=this._previewTemplate?.template?void 0:this._initialTransform,o=u0(i,e);this._preview.setTransform(db(o,t))}_getDragDistance(i){let e=this._pickupPositionOnPage;return e?{x:i.x-e.x,y:i.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:i,y:e}=this._passiveTransform;if(i===0&&e===0||this.isDragging()||!this._boundaryElement)return;let t=this._rootElement.getBoundingClientRect(),o=this._boundaryElement.getBoundingClientRect();if(o.width===0&&o.height===0||t.width===0&&t.height===0)return;let r=o.left-t.left,a=t.right-o.right,c=o.top-t.top,p=t.bottom-o.bottom;o.width>t.width?(r>0&&(i+=r),a>0&&(i-=a)):i=0,o.height>t.height?(c>0&&(e+=c),p>0&&(e-=p)):e=0,(i!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:i})}_getDragStartDelay(i){let e=this.dragStartDelay;return typeof e=="number"?e:m0(i)?e.touch:e?e.mouse:0}_updateOnScroll(i){let e=this._parentPositions.handleScroll(i);if(e){let t=Cp(i);this._boundaryRect&&t!==this._boundaryElement&&t.contains(this._boundaryElement)&&p0(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=sC(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(i,e){let t=this._previewContainer||"global";if(t==="parent")return i;if(t==="global"){let o=this._document;return e||o.fullscreenElement||o.webkitFullscreenElement||o.mozFullScreenElement||o.msFullscreenElement||o.body}return Al(t)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=i=>{if(this._handles.length){let e=this._getTargetHandle(i);e&&!this._disabledHandles.has(e)&&!this.disabled&&i.preventDefault()}else this.disabled||i.preventDefault()};_getTargetHandle(i){return this._handles.find(e=>i.target&&(i.target===e||e.contains(i.target)))}_conditionallyInsertAnchor(i,e,t){if(i===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let o=this._anchor??=RE(this._placeholder);o.classList.remove(k6),o.classList.add("cdk-drag-anchor"),o.style.transform="",t?t.before(o):Al(e.element).appendChild(o)}}};function E6(n,i,e){return Math.max(i,Math.min(e,n))}function m0(n){return n.type[0]==="t"}function GZ(n){n.preventDefault()}function N6(n,i,e){let t=D6(i,n.length-1),o=D6(e,n.length-1);if(t===o)return;let r=n[t],a=o<t?-1:1;for(let c=t;c!==o;c+=a)n[c]=n[c+a];n[o]=r}function D6(n,i){return Math.max(0,Math.min(i,n))}var mb=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(i){this._dragDropRegistry=i}_previousSwap={drag:null,delta:0,overlaps:!1};start(i){this.withItems(i)}sort(i,e,t,o){let r=this._itemPositions,a=this._getItemIndexFromPointerPosition(i,e,t,o);if(a===-1&&r.length>0)return null;let c=this.orientation==="horizontal",p=r.findIndex(w=>w.drag===i),u=r[a],h=r[p].clientRect,_=u.clientRect,S=p>a?1:-1,x=this._getItemOffsetPx(h,_,S),b=this._getSiblingOffsetPx(p,r,S),M=r.slice();return N6(r,p,a),r.forEach((w,y)=>{if(M[y]===w)return;let E=w.drag===i,I=E?x:b,D=E?i.getPlaceholderElement():w.drag.getRootElement();w.offset+=I;let N=Math.round(w.offset*(1/w.drag.scale));c?(D.style.transform=db(`translate3d(${N}px, 0, 0)`,w.initialTransform),p0(w.clientRect,0,I)):(D.style.transform=db(`translate3d(0, ${N}px, 0)`,w.initialTransform),p0(w.clientRect,I,0))}),this._previousSwap.overlaps=LE(_,e,t),this._previousSwap.drag=u.drag,this._previousSwap.delta=c?o.x:o.y,{previousIndex:p,currentIndex:a}}enter(i,e,t,o){let r=this._activeDraggables,a=r.indexOf(i),c=i.getPlaceholderElement();a>-1&&r.splice(a,1);let p=o==null||o<0?this._getItemIndexFromPointerPosition(i,e,t):o,u=r[p];if(u===i&&(u=r[p+1]),!u&&(p==null||p===-1||p<r.length-1)&&this._shouldEnterAsFirstChild(e,t)&&(u=r[0]),u&&!this._dragDropRegistry.isDragging(u)){let h=u.getRootElement();h.parentElement.insertBefore(c,h),r.splice(p,0,i)}else this._element.appendChild(c),r.push(i);c.style.transform="",this._cacheItemPositions()}withItems(i){this._activeDraggables=i.slice(),this._cacheItemPositions()}withSortPredicate(i){this._sortPredicate=i}reset(){this._activeDraggables?.forEach(i=>{let e=i.getRootElement();if(e){let t=this._itemPositions.find(o=>o.drag===i)?.initialTransform;e.style.transform=t||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(i){return this._getVisualItemPositions().findIndex(e=>e.drag===i)}getItemAtIndex(i){return this._getVisualItemPositions()[i]?.drag||null}updateOnScroll(i,e){this._itemPositions.forEach(({clientRect:t})=>{p0(t,i,e)}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(i){this._element=i}_cacheItemPositions(){let i=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let t=e.getVisibleElement();return{drag:e,offset:0,initialTransform:t.style.transform||"",clientRect:$E(t)}}).sort((e,t)=>i?e.clientRect.left-t.clientRect.left:e.clientRect.top-t.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(i,e,t){let o=this.orientation==="horizontal",r=o?e.left-i.left:e.top-i.top;return t===-1&&(r+=o?e.width-i.width:e.height-i.height),r}_getSiblingOffsetPx(i,e,t){let o=this.orientation==="horizontal",r=e[i].clientRect,a=e[i+t*-1],c=r[o?"width":"height"]*t;if(a){let p=o?"left":"top",u=o?"right":"bottom";t===-1?c-=a.clientRect[p]-r[u]:c+=r[p]-a.clientRect[u]}return c}_shouldEnterAsFirstChild(i,e){if(!this._activeDraggables.length)return!1;let t=this._itemPositions,o=this.orientation==="horizontal";if(t[0].drag!==this._activeDraggables[0]){let a=t[t.length-1].clientRect;return o?i>=a.right:e>=a.bottom}else{let a=t[0].clientRect;return o?i<=a.left:e<=a.top}}_getItemIndexFromPointerPosition(i,e,t,o){let r=this.orientation==="horizontal",a=this._itemPositions.findIndex(({drag:c,clientRect:p})=>{if(c===i)return!1;if(o){let u=r?o.x:o.y;if(c===this._previousSwap.drag&&this._previousSwap.overlaps&&u===this._previousSwap.delta)return!1}return r?e>=Math.floor(p.left)&&e<Math.floor(p.right):t>=Math.floor(p.top)&&t<Math.floor(p.bottom)});return a===-1||!this._sortPredicate(a,i)?-1:a}},zE=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(i,e){this._document=i,this._dragDropRegistry=e}start(i){let e=this._element.childNodes;this._relatedNodes=[];for(let t=0;t<e.length;t++){let o=e[t];this._relatedNodes.push([o,o.nextSibling])}this.withItems(i)}sort(i,e,t,o){let r=this._getItemIndexFromPointerPosition(i,e,t),a=this._previousSwap;if(r===-1||this._activeItems[r]===i)return null;let c=this._activeItems[r];if(a.drag===c&&a.overlaps&&a.deltaX===o.x&&a.deltaY===o.y)return null;let p=this.getItemIndex(i),u=i.getPlaceholderElement(),h=c.getRootElement();r>p?h.after(u):h.before(u),N6(this._activeItems,p,r);let _=this._getRootNode().elementFromPoint(e,t);return a.deltaX=o.x,a.deltaY=o.y,a.drag=c,a.overlaps=h===_||h.contains(_),{previousIndex:p,currentIndex:r}}enter(i,e,t,o){let r=this._activeItems.indexOf(i);r>-1&&this._activeItems.splice(r,1);let a=o==null||o<0?this._getItemIndexFromPointerPosition(i,e,t):o;a===-1&&(a=this._getClosestItemIndexToPointer(i,e,t));let c=this._activeItems[a];c&&!this._dragDropRegistry.isDragging(c)?(this._activeItems.splice(a,0,i),c.getRootElement().before(i.getPlaceholderElement())):(this._activeItems.push(i),this._element.appendChild(i.getPlaceholderElement()))}withItems(i){this._activeItems=i.slice()}withSortPredicate(i){this._sortPredicate=i}reset(){let i=this._element,e=this._previousSwap;for(let t=this._relatedNodes.length-1;t>-1;t--){let[o,r]=this._relatedNodes[t];o.parentNode===i&&o.nextSibling!==r&&(r===null?i.appendChild(o):r.parentNode===i&&i.insertBefore(o,r))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(i){return this._activeItems.indexOf(i)}getItemAtIndex(i){return this._activeItems[i]||null}updateOnScroll(){this._activeItems.forEach(i=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(i){i!==this._element&&(this._element=i,this._rootNode=void 0)}_getItemIndexFromPointerPosition(i,e,t){let o=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(t)),r=o?this._activeItems.findIndex(a=>{let c=a.getRootElement();return o===c||c.contains(o)}):-1;return r===-1||!this._sortPredicate(r,i)?-1:r}_getRootNode(){return this._rootNode||(this._rootNode=sC(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(i,e,t){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let o=1/0,r=-1;for(let a=0;a<this._activeItems.length;a++){let c=this._activeItems[a];if(c!==i){let{x:p,y:u}=c.getRootElement().getBoundingClientRect(),h=Math.hypot(e-p,t-u);h<o&&(o=h,r=a)}}return r}},P6=.05,F6=.05,ol=(function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n})(ol||{}),ja=(function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n})(ja||{});function WZ(n,i){return new jE(i,n.get(O6),n.get(Xi),n.get(Vi),n.get(dd))}var jE=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new He;entered=new He;exited=new He;dropped=new He;sorted=new He;receivingStarted=new He;receivingStopped=new He;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=So.EMPTY;_verticalScrollDirection=ol.NONE;_horizontalScrollDirection=ja.NONE;_scrollNode;_stopScrollTimers=new He;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(i,e,t,o,r){this._dragDropRegistry=e,this._ngZone=o,this._viewportRuler=r;let a=this.element=Al(i);this._document=t,this.withOrientation("vertical").withElementContainer(a),e.registerDropContainer(this),this._parentPositions=new cb(t)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(i,e,t,o){this._draggingStarted(),o==null&&this.sortingDisabled&&(o=this._draggables.indexOf(i)),this._sortStrategy.enter(i,e,t,o),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:i,container:this,currentIndex:this.getItemIndex(i)})}exit(i){this._reset(),this.exited.next({item:i,container:this})}drop(i,e,t,o,r,a,c,p={}){this._reset(),this.dropped.next({item:i,currentIndex:e,previousIndex:t,container:this,previousContainer:o,isPointerOverContainer:r,distance:a,dropPoint:c,event:p})}withItems(i){let e=this._draggables;return this._draggables=i,i.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(e.filter(o=>o.isDragging()).every(o=>i.indexOf(o)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(i){return this._direction=i,this._sortStrategy instanceof mb&&(this._sortStrategy.direction=i),this}connectedTo(i){return this._siblings=i.slice(),this}withOrientation(i){if(i==="mixed")this._sortStrategy=new zE(this._document,this._dragDropRegistry);else{let e=new mb(this._dragDropRegistry);e.direction=this._direction,e.orientation=i,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,t)=>this.sortPredicate(e,t,this)),this}withScrollableParents(i){let e=this._container;return this._scrollableElements=i.indexOf(e)===-1?[e,...i]:i.slice(),this}withElementContainer(i){if(i===this._container)return this;let e=Al(this.element),t=this._scrollableElements.indexOf(this._container),o=this._scrollableElements.indexOf(i);return t>-1&&this._scrollableElements.splice(t,1),o>-1&&this._scrollableElements.splice(o,1),this._sortStrategy&&this._sortStrategy.withElementContainer(i),this._cachedShadowRoot=null,this._scrollableElements.unshift(i),this._container=i,this}getScrollableParents(){return this._scrollableElements}getItemIndex(i){return this._isDragging?this._sortStrategy.getItemIndex(i):this._draggables.indexOf(i)}getItemAtIndex(i){return this._isDragging?this._sortStrategy.getItemAtIndex(i):this._draggables[i]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(i,e,t,o){if(this.sortingDisabled||!this._domRect||!b6(this._domRect,P6,e,t))return;let r=this._sortStrategy.sort(i,e,t,o);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:i})}_startScrollingIfNecessary(i,e){if(this.autoScrollDisabled)return;let t,o=ol.NONE,r=ja.NONE;if(this._parentPositions.positions.forEach((a,c)=>{c===this._document||!a.clientRect||t||b6(a.clientRect,P6,i,e)&&([o,r]=qZ(c,a.clientRect,this._direction,i,e),(o||r)&&(t=c))}),!o&&!r){let{width:a,height:c}=this._viewportRuler.getViewportSize(),p={width:a,height:c,top:0,right:a,bottom:c,left:0};o=R6(p,e),r=L6(p,i),t=window}t&&(o!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||t!==this._scrollNode)&&(this._verticalScrollDirection=o,this._horizontalScrollDirection=r,this._scrollNode=t,(o||r)&&t?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let i=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=i.msScrollSnapType||i.scrollSnapType||"",i.scrollSnapType=i.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let i=this._container.style;i.scrollSnapType=i.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Kv(0,nc).pipe(tt(this._stopScrollTimers)).subscribe(()=>{let i=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===ol.UP?i.scrollBy(0,-e):this._verticalScrollDirection===ol.DOWN&&i.scrollBy(0,e),this._horizontalScrollDirection===ja.LEFT?i.scrollBy(-e,0):this._horizontalScrollDirection===ja.RIGHT&&i.scrollBy(e,0)})};_isOverContainer(i,e){return this._domRect!=null&&LE(this._domRect,i,e)}_getSiblingContainerFromPosition(i,e,t){return this._siblings.find(o=>o._canReceive(i,e,t))}_canReceive(i,e,t){if(!this._domRect||!LE(this._domRect,e,t)||!this.enterPredicate(i,this))return!1;let o=this._getShadowRoot().elementFromPoint(e,t);return o?o===this._container||this._container.contains(o):!1}_startReceiving(i,e){let t=this._activeSiblings;!t.has(i)&&e.every(o=>this.enterPredicate(o,this)||this._draggables.indexOf(o)>-1)&&(t.add(i),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:i,receiver:this,items:e}))}_stopReceiving(i){this._activeSiblings.delete(i),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:i,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(i=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(i);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let i=sC(this._container);this._cachedShadowRoot=i||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let i=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,i))}};function R6(n,i){let{top:e,bottom:t,height:o}=n,r=o*F6;return i>=e-r&&i<=e+r?ol.UP:i>=t-r&&i<=t+r?ol.DOWN:ol.NONE}function L6(n,i){let{left:e,right:t,width:o}=n,r=o*F6;return i>=e-r&&i<=e+r?ja.LEFT:i>=t-r&&i<=t+r?ja.RIGHT:ja.NONE}function qZ(n,i,e,t,o){let r=R6(i,o),a=L6(i,t),c=ol.NONE,p=ja.NONE;if(r){let u=n.scrollTop;r===ol.UP?u>0&&(c=ol.UP):n.scrollHeight-u>n.clientHeight&&(c=ol.DOWN)}if(a){let u=n.scrollLeft;e==="rtl"?a===ja.RIGHT?u<0&&(p=ja.RIGHT):n.scrollWidth+u>n.clientWidth&&(p=ja.LEFT):a===ja.LEFT?u>0&&(p=ja.LEFT):n.scrollWidth-u>n.clientWidth&&(p=ja.RIGHT)}return[c,p]}var QZ=(()=>{class n{_injector=f(Jo);constructor(){}createDrag(e,t){return UZ(this._injector,e,t)}createDropList(e){return WZ(this._injector,e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var V6=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({providers:[QZ],imports:[md]})}return n})();var XZ=[[["caption"]],[["colgroup"],["col"]],"*"],KZ=["caption","colgroup, col","*"];function YZ(n,i){n&1&&on(0,2)}function ZZ(n,i){n&1&&(s(0,"thead",0),ro(1,1),l(),s(2,"tbody",0),ro(3,2)(4,3),l(),s(5,"tfoot",0),ro(6,4),l())}function JZ(n,i){n&1&&ro(0,1)(1,2)(2,3)(3,4)}var Vl=new cn("CDK_TABLE");var hb=(()=>{class n{template=f(Oo);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkCellDef",""]]})}return n})(),fb=(()=>{class n{template=f(Oo);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkHeaderCellDef",""]]})}return n})(),j6=(()=>{class n{template=f(Oo);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkFooterCellDef",""]]})}return n})(),Cm=(()=>{class n{_table=f(Vl,{optional:!0});_hasStickyChanged=!1;get name(){return this._name}set name(e){this._setNameInput(e)}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=!0)}_sticky=!1;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=!0)}_stickyEnd=!1;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;constructor(){}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=!1}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`]}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName())}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,o,r){if(t&1&&Ki(r,hb,5)(r,fb,5)(r,j6,5),t&2){let a;mt(a=pt())&&(o.cell=a.first),mt(a=pt())&&(o.headerCell=a.first),mt(a=pt())&&(o.footerCell=a.first)}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Ct],stickyEnd:[2,"stickyEnd","stickyEnd",Ct]}})}return n})(),ub=class{constructor(i,e){e.nativeElement.classList.add(...i._columnCssClassName)}},$6=(()=>{class n extends ub{constructor(){super(f(Cm),f(Zt))}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[si]})}return n})();var H6=(()=>{class n extends ub{constructor(){let e=f(Cm),t=f(Zt);super(e,t);let o=e._table?._getCellRole();o&&t.nativeElement.setAttribute("role",o)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[si]})}return n})();var GE=(()=>{class n{template=f(Oo);_differs=f(ld);columns;_columnsDiffer;constructor(){}ngOnChanges(e){if(!this._columnsDiffer){let t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t)}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof f0?e.headerCell.template:this instanceof WE?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,features:[bn]})}return n})(),f0=(()=>{class n extends GE{_table=f(Vl,{optional:!0});_hasStickyChanged=!1;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=!0)}_sticky=!1;constructor(){super(f(Oo),f(ld))}ngOnChanges(e){super.ngOnChanges(e)}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=!1}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Ct]},features:[si,bn]})}return n})(),WE=(()=>{class n extends GE{_table=f(Vl,{optional:!0});_hasStickyChanged=!1;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=!0)}_sticky=!1;constructor(){super(f(Oo),f(ld))}ngOnChanges(e){super.ngOnChanges(e)}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=!1}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Ct]},features:[si,bn]})}return n})(),gb=(()=>{class n extends GE{_table=f(Vl,{optional:!0});when;constructor(){super(f(Oo),f(ld))}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[si]})}return n})(),nu=(()=>{class n{_viewContainer=f(oo);cells;context;static mostRecentCellOutlet=null;constructor(){n.mostRecentCellOutlet=this}ngOnDestroy(){n.mostRecentCellOutlet===this&&(n.mostRecentCellOutlet=null)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkCellOutlet",""]]})}return n})(),qE=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,o){t&1&&ro(0,0)},dependencies:[nu],encapsulation:2})}return n})();var QE=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,o){t&1&&ro(0,0)},dependencies:[nu],encapsulation:2})}return n})(),U6=(()=>{class n{templateRef=f(Oo);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["ng-template","cdkNoDataRow",""]]})}return n})(),B6=["top","bottom","left","right"],UE=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(i=>this._updateCachedSizes(i)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=!1;constructor(i,e,t=!0,o=!0,r,a,c){this._isNativeHtmlTable=i,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=o,this.direction=r,this._positionListener=a,this._tableInjector=c,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`}}clearStickyPositioning(i,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(i);let t=[];for(let o of i)o.nodeType===o.ELEMENT_NODE&&t.push(o,...Array.from(o.children));Xa({write:()=>{for(let o of t)this._removeStickyStyle(o,e)}},{injector:this._tableInjector})}updateStickyColumns(i,e,t,o=!0,r=!0){if(!i.length||!this._isBrowser||!(e.some(w=>w)||t.some(w=>w))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let a=i[0],c=a.children.length,p=this.direction==="rtl",u=p?"right":"left",h=p?"left":"right",_=e.lastIndexOf(!0),S=t.indexOf(!0),x,b,M;r&&this._updateStickyColumnReplayQueue({rows:[...i],stickyStartStates:[...e],stickyEndStates:[...t]}),Xa({earlyRead:()=>{x=this._getCellWidths(a,o),b=this._getStickyStartColumnPositions(x,e),M=this._getStickyEndColumnPositions(x,t)},write:()=>{for(let w of i)for(let y=0;y<c;y++){let E=w.children[y];e[y]&&this._addStickyStyle(E,u,b[y],y===_),t[y]&&this._addStickyStyle(E,h,M[y],y===S)}this._positionListener&&x.some(w=>!!w)&&(this._positionListener.stickyColumnsUpdated({sizes:_===-1?[]:x.slice(0,_+1).map((w,y)=>e[y]?w:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:S===-1?[]:x.slice(S).map((w,y)=>t[y+S]?w:null).reverse()}))}},{injector:this._tableInjector})}stickRows(i,e,t){if(!this._isBrowser)return;let o=t==="bottom"?i.slice().reverse():i,r=t==="bottom"?e.slice().reverse():e,a=[],c=[],p=[];Xa({earlyRead:()=>{for(let u=0,h=0;u<o.length;u++){if(!r[u])continue;a[u]=h;let _=o[u];p[u]=this._isNativeHtmlTable?Array.from(_.children):[_];let S=this._retrieveElementSize(_).height;h+=S,c[u]=S}},write:()=>{let u=r.lastIndexOf(!0);for(let h=0;h<o.length;h++){if(!r[h])continue;let _=a[h],S=h===u;for(let x of p[h])this._addStickyStyle(x,t,_,S)}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:c,offsets:a,elements:p}):this._positionListener?.stickyFooterRowsUpdated({sizes:c,offsets:a,elements:p})}},{injector:this._tableInjector})}updateStickyFooterContainer(i,e){this._isNativeHtmlTable&&Xa({write:()=>{let t=i.querySelector("tfoot");t&&(e.some(o=>!o)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,!1))}},{injector:this._tableInjector})}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=!0}_removeStickyStyle(i,e){if(!i.classList.contains(this._stickCellCss))return;for(let o of e)i.style[o]="",i.classList.remove(this._borderCellCss[o]);B6.some(o=>e.indexOf(o)===-1&&i.style[o])?i.style.zIndex=this._getCalculatedZIndex(i):(i.style.zIndex="",this._needsPositionStickyOnElement&&(i.style.position=""),i.classList.remove(this._stickCellCss))}_addStickyStyle(i,e,t,o){i.classList.add(this._stickCellCss),o&&i.classList.add(this._borderCellCss[e]),i.style[e]=`${t}px`,i.style.zIndex=this._getCalculatedZIndex(i),this._needsPositionStickyOnElement&&(i.style.cssText+="position: -webkit-sticky; position: sticky; ")}_getCalculatedZIndex(i){let e={top:100,bottom:10,left:1,right:1},t=0;for(let o of B6)i.style[o]&&(t+=e[o]);return t?`${t}`:""}_getCellWidths(i,e=!0){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],o=i.children;for(let r=0;r<o.length;r++){let a=o[r];t.push(this._retrieveElementSize(a).width)}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(i,e){let t=[],o=0;for(let r=0;r<i.length;r++)e[r]&&(t[r]=o,o+=i[r]);return t}_getStickyEndColumnPositions(i,e){let t=[],o=0;for(let r=i.length;r>0;r--)e[r]&&(t[r]=o,o+=i[r]);return t}_retrieveElementSize(i){let e=this._elemSizeCache.get(i);if(e)return e;let t=i.getBoundingClientRect(),o={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(i,o),this._resizeObserver.observe(i,{box:"border-box"})),o}_updateStickyColumnReplayQueue(i){this._removeFromStickyColumnReplayQueue(i.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(i)}_removeFromStickyColumnReplayQueue(i){let e=new Set(i);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(o=>!e.has(o));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length)}_updateCachedSizes(i){let e=!1;for(let t of i){let o=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};o.width!==this._elemSizeCache.get(t.target)?.width&&eJ(t.target)&&(e=!0),this._elemSizeCache.set(t.target,o)}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,!0,!1);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null}},0))}};function eJ(n){return["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(i=>n.classList.contains(i))}var h0=new cn("STICKY_POSITIONING_LISTENER");var XE=(()=>{class n{viewContainer=f(oo);elementRef=f(Zt);constructor(){let e=f(Vl);e._rowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","rowOutlet",""]]})}return n})(),KE=(()=>{class n{viewContainer=f(oo);elementRef=f(Zt);constructor(){let e=f(Vl);e._headerRowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","headerRowOutlet",""]]})}return n})(),YE=(()=>{class n{viewContainer=f(oo);elementRef=f(Zt);constructor(){let e=f(Vl);e._footerRowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","footerRowOutlet",""]]})}return n})(),ZE=(()=>{class n{viewContainer=f(oo);elementRef=f(Zt);constructor(){let e=f(Vl);e._noDataRowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","noDataRowOutlet",""]]})}return n})(),JE=(()=>{class n{_differs=f(ld);_changeDetectorRef=f(Q);_elementRef=f(Zt);_dir=f(Ka,{optional:!0});_platform=f($s);_viewRepeater;_viewportRuler=f(dd);_injector=f(Jo);_virtualScrollViewport=f(YO,{optional:!0,host:!0});_positionListener=f(h0,{optional:!0})||f(h0,{optional:!0,skipSelf:!0});_document=f(Xi);_data;_renderedRange;_onDestroy=new He;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=!0;_footerRowDefChanged=!0;_stickyColumnStylesNeedReset=!0;_forceRecalculateCellWidths=!0;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=!0;_isServer;_isShowingNoDataRow=!1;_hasAllOutlets=!1;_hasInitialized=!1;_headerRowStickyUpdates=new He;_footerRowStickyUpdates=new He;_disableVirtualScrolling=!1;_getCellRole(){if(this._cellRoleInternal===void 0){let e=this._elementRef.nativeElement.getAttribute("role");return e==="grid"||e==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&(this._switchDataSource(e),this._changeDetectorRef.markForCheck())}_dataSource;_dataSourceChanges=new He;_dataStream=new He;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles())}_multiTemplateDataRows=!1;get fixedLayout(){return this._virtualScrollEnabled()?!0:this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=!0,this._stickyColumnStylesNeedReset=!0}_fixedLayout=!1;recycleRows=!1;contentChanged=new ve;viewChange=new an({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;constructor(){f(new sc("role"),{optional:!0})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,o)=>this.trackBy?this.trackBy(o.dataIndex,o.data):o)}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(tt(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=!0})}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new XO:new i4,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=!0}ngAfterContentChecked(){this._canRender()&&this._render()}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear()}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),Uu(this.dataSource)&&this.dataSource.disconnect(this)}renderRows(){this._renderRows=this._getAllRenderRows();let e=this._dataDiffer.diff(this._renderRows);if(!e){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,(o,r,a)=>this._getEmbeddedViewArgs(o.item,a),o=>o.item.data,o=>{o.operation===QO.INSERTED&&o.context&&this._renderCellTemplateForItem(o.record.item.rowDef,o.context)}),this._updateRowIndexContext(),e.forEachIdentityChange(o=>{let r=t.get(o.currentIndex);r.context.$implicit=o.item.data}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles()}addColumnDef(e){this._customColumnDefs.add(e)}removeColumnDef(e){this._customColumnDefs.delete(e)}addRowDef(e){this._customRowDefs.add(e)}removeRowDef(e){this._customRowDefs.delete(e)}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=!0}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=!0}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=!0}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=!0}setNoDataRow(e){this._customNoDataRow=e}updateStickyHeaderRowStyles(){let e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let o=z6(this._headerRowOutlet,"thead");o&&(o.style.display=e.length?"":"none")}let t=this._headerRowDefs.map(o=>o.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(o=>o.resetStickyChanged())}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let o=z6(this._footerRowOutlet,"tfoot");o&&(o.style.display=e.length?"":"none")}let t=this._footerRowDefs.map(o=>o.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(o=>o.resetStickyChanged())}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),o=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...o],["left","right"]),this._stickyColumnStylesNeedReset=!1),e.forEach((r,a)=>{this._addStickyColumnStyles([r],this._headerRowDefs[a])}),this._rowDefs.forEach(r=>{let a=[];for(let c=0;c<t.length;c++)this._renderRows[c].rowDef===r&&a.push(t[c]);this._addStickyColumnStyles(a,r)}),o.forEach((r,a)=>{this._addStickyColumnStyles([r],this._footerRowDefs[a])}),Array.from(this._columnDefsByName.values()).forEach(r=>r.resetStickyChanged())}stickyColumnsUpdated(e){this._positionListener?.stickyColumnsUpdated(e)}stickyEndColumnsUpdated(e){this._positionListener?.stickyEndColumnsUpdated(e)}stickyHeaderRowsUpdated(e){this._headerRowStickyUpdates.next(e),this._positionListener?.stickyHeaderRowsUpdated(e)}stickyFooterRowsUpdated(e){this._footerRowStickyUpdates.next(e),this._positionListener?.stickyFooterRowsUpdated(e)}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=!0,this._canRender()&&this._render())}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates()}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return[];let e=[],t=Math.min(this._data.length,this._renderedRange.end),o=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let r=this._renderedRange.start;r<t;r++){let a=this._data[r],c=this._getRenderRowsForData(a,r,o.get(a));this._cachedRenderRowsMap.has(a)||this._cachedRenderRowsMap.set(a,new WeakMap);for(let p=0;p<c.length;p++){let u=c[p],h=this._cachedRenderRowsMap.get(u.data);h.has(u.rowDef)?h.get(u.rowDef).push(u):h.set(u.rowDef,[u]),e.push(u)}}return e}_getRenderRowsForData(e,t,o){return this._getRowDefs(e,t).map(a=>{let c=o&&o.has(a)?o.get(a):[];if(c.length){let p=c.shift();return p.dataIndex=t,p}else return{data:e,rowDef:a,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),pb(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t)})}_cacheRowDefs(){this._headerRowDefs=pb(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=pb(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=pb(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let e=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=e[0]}_renderUpdatedColumns(){let e=(a,c)=>{let p=!!c.getColumnsDiff();return a||p},t=this._rowDefs.reduce(e,!1);t&&this._forceRenderDataRows();let o=this._headerRowDefs.reduce(e,!1);o&&this._forceRenderHeaderRows();let r=this._footerRowDefs.reduce(e,!1);return r&&this._forceRenderFooterRows(),t||o||r}_switchDataSource(e){this._data=[],Uu(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e}_observeRenderChanges(){if(!this.dataSource)return;let e;Uu(this.dataSource)?e=this.dataSource.connect(this):Ng(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Nn(this.dataSource)),this._renderChangeSubscription=Pr([e,this.viewChange]).pipe(tt(this._onDestroy)).subscribe(([t,o])=>{this._data=t||[],this._renderedRange=o,this._dataStream.next(t),this.renderRows()})}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,t)=>this._renderRow(this._headerRowOutlet,e,t)),this.updateStickyHeaderRowStyles()}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,t)=>this._renderRow(this._footerRowOutlet,e,t)),this.updateStickyFooterRowStyles()}_addStickyColumnStyles(e,t){let o=Array.from(t?.columns||[]).map(c=>{let p=this._columnDefsByName.get(c);return p}),r=o.map(c=>c.sticky),a=o.map(c=>c.stickyEnd);this._stickyStyler.updateStickyColumns(e,r,a,!this.fixedLayout||this._forceRecalculateCellWidths)}_getRenderedRows(e){let t=[];for(let o=0;o<e.viewContainer.length;o++){let r=e.viewContainer.get(o);t.push(r.rootNodes[0])}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return[this._rowDefs[0]];let o=[];if(this.multiTemplateDataRows)o=this._rowDefs.filter(r=>!r.when||r.when(t,e));else{let r=this._rowDefs.find(a=>a.when&&a.when(t,e))||this._defaultRowDef;r&&o.push(r)}return o.length,o}_getEmbeddedViewArgs(e,t){let o=e.rowDef,r={$implicit:e.data};return{templateRef:o.template,context:r,index:t}}_renderRow(e,t,o,r={}){let a=e.viewContainer.createEmbeddedView(t.template,r,o);return this._renderCellTemplateForItem(t,r),a}_renderCellTemplateForItem(e,t){for(let o of this._getCellTemplates(e))nu.mostRecentCellOutlet&&nu.mostRecentCellOutlet._viewContainer.createEmbeddedView(o,t);this._changeDetectorRef.markForCheck()}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,o=e.length;t<o;t++){let a=e.get(t).context;a.count=o,a.first=t===0,a.last=t===o-1,a.even=t%2===0,a.odd=!a.even,this.multiTemplateDataRows?(a.dataIndex=this._renderRows[t].dataIndex,a.renderIndex=t):a.index=this._renderRows[t].dataIndex}}_getCellTemplates(e){return!e||!e.columns?[]:Array.from(e.columns,t=>{let o=this._columnDefsByName.get(t);return e.extractCellTemplate(o)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows()}_checkStickyStates(){let e=(t,o)=>t||o.hasStickyChanged();this._headerRowDefs.reduce(e,!1)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,!1)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,!1)&&(this._stickyColumnStylesNeedReset=!0,this.updateStickyColumnStyles())}_setupStickyStyler(){let e=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new UE(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Nn()).pipe(tt(this._onDestroy)).subscribe(o=>{this._stickyStyler.direction=o,this.updateStickyColumnStyles()})}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?nc:hO;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Ud(0,t),tt(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(o,r)=>this._measureRangeSize(o,r)}),Pr([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(tt(this._onDestroy)).subscribe(([o,r])=>{if(!(!r.sizes||!r.offsets||!r.elements))for(let a=0;a<r.elements.length;a++){let c=r.elements[a];if(c){let p=r.offsets[a],u=o!==0?Math.max(o-p,p):-p;for(let h of c)h.style.top=`${-u}px`}}}),Pr([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(tt(this._onDestroy)).subscribe(([o,r])=>{if(!(!r.sizes||!r.offsets||!r.elements))for(let a=0;a<r.elements.length;a++){let c=r.elements[a];if(c)for(let p of c)p.style.bottom=`${o+r.offsets[a]}px`}})}_getOwnDefs(e){return e.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let e=this._customNoDataRow||this._noDataRow;if(!e)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let o=this._noDataRowOutlet.viewContainer;if(t){let r=o.createEmbeddedView(e.templateRef),a=r.rootNodes[0];if(r.rootNodes.length===1&&a?.nodeType===this._document.ELEMENT_NODE){a.setAttribute("role","row"),a.classList.add(...e._contentClassNames);let c=a.querySelectorAll(e._cellSelector);for(let p=0;p<c.length;p++)c[p].classList.add(...e._cellClassNames)}}else o.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck()}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let o=this.viewChange.value,r=this._rowOutlet.viewContainer;e.start<o.start||e.end>o.end;let a=e.start-o.start,c=e.end-e.start,p,u;for(let S=0;S<c;S++){let x=r.get(S+a);if(x&&x.rootNodes.length){p=u=x.rootNodes[0];break}}for(let S=c-1;S>-1;S--){let x=r.get(S+a);if(x&&x.rootNodes.length){u=x.rootNodes[x.rootNodes.length-1];break}}let h=p?.getBoundingClientRect?.(),_=u?.getBoundingClientRect?.();return h&&_?_.bottom-h.top:0}_virtualScrollEnabled(){return!this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,o,r){if(t&1&&Ki(r,U6,5)(r,Cm,5)(r,gb,5)(r,f0,5)(r,WE,5),t&2){let a;mt(a=pt())&&(o._noDataRow=a.first),mt(a=pt())&&(o._contentColumnDefs=a),mt(a=pt())&&(o._contentRowDefs=a),mt(a=pt())&&(o._contentHeaderRowDefs=a),mt(a=pt())&&(o._contentFooterRowDefs=a)}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,o){t&2&&Be("cdk-table-fixed-layout",o.fixedLayout)},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Ct],fixedLayout:[2,"fixedLayout","fixedLayout",Ct],recycleRows:[2,"recycleRows","recycleRows",Ct]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[fn([{provide:Vl,useExisting:n},{provide:h0,useValue:null}])],ngContentSelectors:KZ,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,o){t&1&&(ii(XZ),on(0),on(1,1),A(2,YZ,1,0),A(3,ZZ,7,0)(4,JZ,4,0)),t&2&&(m(2),O(o._isServer?2:-1),m(),O(o._isNativeHtmlTable?3:4))},dependencies:[KE,XE,ZE,YE],styles:[`.cdk-table-fixed-layout{table-layout:fixed}
`],encapsulation:2})}return n})();function pb(n,i){return n.concat(Array.from(i))}function z6(n,i){let e=i.toUpperCase(),t=n.viewContainer.element.nativeElement;for(;t;){let o=t.nodeType===1?t.nodeName:null;if(o===e)return t;if(o==="TABLE")break;t=t.parentNode}return null}var _b=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[mC]})}return n})();var G6=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[md,hi,md]})}return n})();var qn=(function(n){return n[n.State=0]="State",n[n.Transition=1]="Transition",n[n.Sequence=2]="Sequence",n[n.Group=3]="Group",n[n.Animate=4]="Animate",n[n.Keyframes=5]="Keyframes",n[n.Style=6]="Style",n[n.Trigger=7]="Trigger",n[n.Reference=8]="Reference",n[n.AnimateChild=9]="AnimateChild",n[n.AnimateRef=10]="AnimateRef",n[n.Query=11]="Query",n[n.Stagger=12]="Stagger",n})(qn||{}),rl="*";function eD(n,i){return{type:qn.Trigger,name:n,definitions:i,options:{}}}function tD(n,i=null){return{type:qn.Animate,styles:i,timings:n}}function W6(n,i=null){return{type:qn.Sequence,steps:n,options:i}}function ou(n){return{type:qn.Style,styles:n,offset:null}}function vb(n,i,e){return{type:qn.State,name:n,styles:i,options:e}}function nD(n,i,e=null){return{type:qn.Transition,expr:n,animation:i,options:e}}var Pc=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(i=0,e=0){this.totalTime=i+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(i=>i()),this._onDoneFns=[])}onStart(i){this._originalOnStartFns.push(i),this._onStartFns.push(i)}onDone(i){this._originalOnDoneFns.push(i),this._onDoneFns.push(i)}onDestroy(i){this._onDestroyFns.push(i)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(i=>i()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(i=>i()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(i){this._position=this.totalTime?i*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(i){let e=i=="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},iu=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(i){this.players=i;let e=0,t=0,o=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++t==r&&this._onDestroy()}),a.onStart(()=>{++o==r&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(i=>i()),this._onDoneFns=[])}init(){this.players.forEach(i=>i.init())}onStart(i){this._onStartFns.push(i)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(i=>i()),this._onStartFns=[])}onDone(i){this._onDoneFns.push(i)}onDestroy(i){this._onDestroyFns.push(i)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(i=>i.play())}pause(){this.players.forEach(i=>i.pause())}restart(){this.players.forEach(i=>i.restart())}finish(){this._onFinish(),this.players.forEach(i=>i.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(i=>i.destroy()),this._onDestroyFns.forEach(i=>i()),this._onDestroyFns=[])}reset(){this.players.forEach(i=>i.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(i){let e=i*this.totalTime;this.players.forEach(t=>{let o=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(o)})}getPosition(){let i=this.players.reduce((e,t)=>e===null||t.totalTime>e.totalTime?t:e,null);return i!=null?i.getPosition():0}beforeDestroy(){this.players.forEach(i=>{i.beforeDestroy&&i.beforeDestroy()})}triggerCallback(i){let e=i=="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Uh="!";function q6(n){return new yi(3e3,!1)}function tJ(){return new yi(3100,!1)}function nJ(){return new yi(3101,!1)}function iJ(n){return new yi(3001,!1)}function oJ(n){return new yi(3003,!1)}function rJ(n){return new yi(3004,!1)}function X6(n,i){return new yi(3005,!1)}function K6(){return new yi(3006,!1)}function Y6(){return new yi(3007,!1)}function Z6(n,i){return new yi(3008,!1)}function J6(n){return new yi(3002,!1)}function eR(n,i,e,t,o){return new yi(3010,!1)}function tR(){return new yi(3011,!1)}function nR(){return new yi(3012,!1)}function iR(){return new yi(3200,!1)}function oR(){return new yi(3202,!1)}function rR(){return new yi(3013,!1)}function aR(n){return new yi(3014,!1)}function sR(n){return new yi(3015,!1)}function lR(n){return new yi(3016,!1)}function cR(n,i){return new yi(3404,!1)}function aJ(n){return new yi(3502,!1)}function dR(n){return new yi(3503,!1)}function mR(){return new yi(3300,!1)}function pR(n){return new yi(3504,!1)}function uR(n){return new yi(3301,!1)}function hR(n,i){return new yi(3302,!1)}function fR(n){return new yi(3303,!1)}function gR(n,i){return new yi(3400,!1)}function _R(n){return new yi(3401,!1)}function vR(n){return new yi(3402,!1)}function CR(n,i){return new yi(3505,!1)}function Md(n){switch(n.length){case 0:return new Pc;case 1:return n[0];default:return new iu(n)}}function aD(n,i,e=new Map,t=new Map){let o=[],r=[],a=-1,c=null;if(i.forEach(p=>{let u=p.get("offset"),h=u==a,_=h&&c||new Map;p.forEach((S,x)=>{let b=x,M=S;if(x!=="offset")switch(b=n.normalizePropertyName(b,o),M){case Uh:M=e.get(x);break;case rl:M=t.get(x);break;default:M=n.normalizeStyleValue(x,b,M,o);break}_.set(b,M)}),h||r.push(_),c=_,a=u}),o.length)throw aJ(o);return r}function Cb(n,i,e,t){switch(i){case"start":n.onStart(()=>t(e&&iD(e,"start",n)));break;case"done":n.onDone(()=>t(e&&iD(e,"done",n)));break;case"destroy":n.onDestroy(()=>t(e&&iD(e,"destroy",n)));break}}function iD(n,i,e){let t=e.totalTime,o=!!e.disabled,r=bb(n.element,n.triggerName,n.fromState,n.toState,i||n.phaseName,t??n.totalTime,o),a=n._data;return a!=null&&(r._data=a),r}function bb(n,i,e,t,o="",r=0,a){return{element:n,triggerName:i,fromState:e,toState:t,phaseName:o,totalTime:r,disabled:!!a}}function ls(n,i,e){let t=n.get(i);return t||n.set(i,t=e),t}function sD(n){let i=n.indexOf(":"),e=n.substring(1,i),t=n.slice(i+1);return[e,t]}var sJ=typeof document>"u"?null:document.documentElement;function xb(n){let i=n.parentNode||n.host||null;return i===sJ?null:i}function lJ(n){return n.substring(1,6)=="ebkit"}var ru=null,Q6=!1;function bR(n){ru||(ru=cJ()||{},Q6=ru.style?"WebkitAppearance"in ru.style:!1);let i=!0;return ru.style&&!lJ(n)&&(i=n in ru.style,!i&&Q6&&(i="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in ru.style)),i}function cJ(){return typeof document<"u"?document.body:null}function lD(n,i){for(;i;){if(i===n)return!0;i=xb(i)}return!1}function cD(n,i,e){if(e)return Array.from(n.querySelectorAll(i));let t=n.querySelector(i);return t?[t]:[]}var dJ=1e3,dD="{{",mJ="}}",mD="ng-enter",yb="ng-leave",g0="ng-trigger",_0=".ng-trigger",pD="ng-animating",Sb=".ng-animating";function Ic(n){if(typeof n=="number")return n;let i=n.match(/^(-?[\.\d]+)(m?s)/);return!i||i.length<2?0:oD(parseFloat(i[1]),i[2])}function oD(n,i){return i==="s"?n*dJ:n}function v0(n,i,e){return n.hasOwnProperty("duration")?n:uJ(n,i,e)}var pJ=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function uJ(n,i,e){let t,o=0,r="";if(typeof n=="string"){let a=n.match(pJ);if(a===null)return i.push(q6(n)),{duration:0,delay:0,easing:""};t=oD(parseFloat(a[1]),a[2]);let c=a[3];c!=null&&(o=oD(parseFloat(c),a[4]));let p=a[5];p&&(r=p)}else t=n;if(!e){let a=!1,c=i.length;t<0&&(i.push(tJ()),a=!0),o<0&&(i.push(nJ()),a=!0),a&&i.splice(c,0,q6(n))}return{duration:t,delay:o,easing:r}}function xR(n){return n.length?n[0]instanceof Map?n:n.map(i=>new Map(Object.entries(i))):[]}function Bl(n,i,e){i.forEach((t,o)=>{let r=wb(o);e&&!e.has(o)&&e.set(o,n.style[r]),n.style[r]=t})}function bm(n,i){i.forEach((e,t)=>{let o=wb(t);n.style[o]=""})}function Gh(n){return Array.isArray(n)?n.length==1?n[0]:W6(n):n}function yR(n,i,e){let t=i.params||{},o=uD(n);o.length&&o.forEach(r=>{t.hasOwnProperty(r)||e.push(iJ(r))})}var rD=new RegExp(`${dD}\\s*(.+?)\\s*${mJ}`,"g");function uD(n){let i=[];if(typeof n=="string"){let e;for(;e=rD.exec(n);)i.push(e[1]);rD.lastIndex=0}return i}function Wh(n,i,e){let t=`${n}`,o=t.replace(rD,(r,a)=>{let c=i[a];return c==null&&(e.push(oJ(a)),c=""),c.toString()});return o==t?n:o}var hJ=/-+([a-z0-9])/g;function wb(n){return n.replace(hJ,(...i)=>i[1].toUpperCase())}function SR(n,i){return n===0||i===0}function wR(n,i,e){if(e.size&&i.length){let t=i[0],o=[];if(e.forEach((r,a)=>{t.has(a)||o.push(a),t.set(a,r)}),o.length)for(let r=1;r<i.length;r++){let a=i[r];o.forEach(c=>a.set(c,Mb(n,c)))}}return i}function cs(n,i,e){switch(i.type){case qn.Trigger:return n.visitTrigger(i,e);case qn.State:return n.visitState(i,e);case qn.Transition:return n.visitTransition(i,e);case qn.Sequence:return n.visitSequence(i,e);case qn.Group:return n.visitGroup(i,e);case qn.Animate:return n.visitAnimate(i,e);case qn.Keyframes:return n.visitKeyframes(i,e);case qn.Style:return n.visitStyle(i,e);case qn.Reference:return n.visitReference(i,e);case qn.AnimateChild:return n.visitAnimateChild(i,e);case qn.AnimateRef:return n.visitAnimateRef(i,e);case qn.Query:return n.visitQuery(i,e);case qn.Stagger:return n.visitStagger(i,e);default:throw rJ(i.type)}}function Mb(n,i){return window.getComputedStyle(n)[i]}var PD=(()=>{class n{validateStyleProperty(e){return bR(e)}containsElement(e,t){return lD(e,t)}getParentElement(e){return xb(e)}query(e,t,o){return cD(e,t,o)}computeStyle(e,t,o){return o||""}animate(e,t,o,r,a,c=[],p){return new Pc(o,r)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})(),su=class{static NOOP=new PD},lu=class{};var fJ=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Pb=class extends lu{normalizePropertyName(i,e){return wb(i)}normalizeStyleValue(i,e,t,o){let r="",a=t.toString().trim();if(fJ.has(e)&&t!==0&&t!=="0")if(typeof t=="number")r="px";else{let c=t.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&o.push(X6(i,t))}return a+r}};var Ib="*";function gJ(n,i){let e=[];return typeof n=="string"?n.split(/\s*,\s*/).forEach(t=>_J(t,e,i)):e.push(n),e}function _J(n,i,e){if(n[0]==":"){let p=vJ(n,e);if(typeof p=="function"){i.push(p);return}n=p}let t=n.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(t==null||t.length<4)return e.push(sR(n)),i;let o=t[1],r=t[2],a=t[3];i.push(MR(o,a));let c=o==Ib&&a==Ib;r[0]=="<"&&!c&&i.push(MR(a,o))}function vJ(n,i){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return i.push(lR(n)),"* => *"}}var kb=new Set(["true","1"]),Tb=new Set(["false","0"]);function MR(n,i){let e=kb.has(n)||Tb.has(n),t=kb.has(i)||Tb.has(i);return(o,r)=>{let a=n==Ib||n==o,c=i==Ib||i==r;return!a&&e&&typeof o=="boolean"&&(a=o?kb.has(n):Tb.has(n)),!c&&t&&typeof r=="boolean"&&(c=r?kb.has(i):Tb.has(i)),a&&c}}var FR=":self",CJ=new RegExp(`s*${FR}s*,?`,"g");function RR(n,i,e,t){return new CD(n).build(i,e,t)}var kR="",CD=class{_driver;constructor(i){this._driver=i}build(i,e,t){let o=new bD(e);return this._resetContextStyleTimingState(o),cs(this,Gh(i),o)}_resetContextStyleTimingState(i){i.currentQuerySelector=kR,i.collectedStyles=new Map,i.collectedStyles.set(kR,new Map),i.currentTime=0}visitTrigger(i,e){let t=e.queryCount=0,o=e.depCount=0,r=[],a=[];return i.name.charAt(0)=="@"&&e.errors.push(K6()),i.definitions.forEach(c=>{if(this._resetContextStyleTimingState(e),c.type==qn.State){let p=c,u=p.name;u.toString().split(/\s*,\s*/).forEach(h=>{p.name=h,r.push(this.visitState(p,e))}),p.name=u}else if(c.type==qn.Transition){let p=this.visitTransition(c,e);t+=p.queryCount,o+=p.depCount,a.push(p)}else e.errors.push(Y6())}),{type:qn.Trigger,name:i.name,states:r,transitions:a,queryCount:t,depCount:o,options:null}}visitState(i,e){let t=this.visitStyle(i.styles,e),o=i.options&&i.options.params||null;if(t.containsDynamicStyles){let r=new Set,a=o||{};t.styles.forEach(c=>{c instanceof Map&&c.forEach(p=>{uD(p).forEach(u=>{a.hasOwnProperty(u)||r.add(u)})})}),r.size&&e.errors.push(Z6(i.name,[...r.values()]))}return{type:qn.State,name:i.name,style:t,options:o?{params:o}:null}}visitTransition(i,e){e.queryCount=0,e.depCount=0;let t=cs(this,Gh(i.animation),e),o=gJ(i.expr,e.errors);return{type:qn.Transition,matchers:o,animation:t,queryCount:e.queryCount,depCount:e.depCount,options:au(i.options)}}visitSequence(i,e){return{type:qn.Sequence,steps:i.steps.map(t=>cs(this,t,e)),options:au(i.options)}}visitGroup(i,e){let t=e.currentTime,o=0,r=i.steps.map(a=>{e.currentTime=t;let c=cs(this,a,e);return o=Math.max(o,e.currentTime),c});return e.currentTime=o,{type:qn.Group,steps:r,options:au(i.options)}}visitAnimate(i,e){let t=SJ(i.timings,e.errors);e.currentAnimateTimings=t;let o,r=i.styles?i.styles:ou({});if(r.type==qn.Keyframes)o=this.visitKeyframes(r,e);else{let a=i.styles,c=!1;if(!a){c=!0;let u={};t.easing&&(u.easing=t.easing),a=ou(u)}e.currentTime+=t.duration+t.delay;let p=this.visitStyle(a,e);p.isEmptyStep=c,o=p}return e.currentAnimateTimings=null,{type:qn.Animate,timings:t,style:o,options:null}}visitStyle(i,e){let t=this._makeStyleAst(i,e);return this._validateStyleAst(t,e),t}_makeStyleAst(i,e){let t=[],o=Array.isArray(i.styles)?i.styles:[i.styles];for(let c of o)typeof c=="string"?c===rl?t.push(c):e.errors.push(J6(c)):t.push(new Map(Object.entries(c)));let r=!1,a=null;return t.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!r)){for(let p of c.values())if(p.toString().indexOf(dD)>=0){r=!0;break}}}),{type:qn.Style,styles:t,easing:a,offset:i.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(i,e){let t=e.currentAnimateTimings,o=e.currentTime,r=e.currentTime;t&&r>0&&(r-=t.duration+t.delay),i.styles.forEach(a=>{typeof a!="string"&&a.forEach((c,p)=>{let u=e.collectedStyles.get(e.currentQuerySelector),h=u.get(p),_=!0;h&&(r!=o&&r>=h.startTime&&o<=h.endTime&&(e.errors.push(eR(p,h.startTime,h.endTime,r,o)),_=!1),r=h.startTime),_&&u.set(p,{startTime:r,endTime:o}),e.options&&yR(c,e.options,e.errors)})})}visitKeyframes(i,e){let t={type:qn.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(tR()),t;let o=1,r=0,a=[],c=!1,p=!1,u=0,h=i.steps.map(y=>{let E=this._makeStyleAst(y,e),I=E.offset!=null?E.offset:yJ(E.styles),D=0;return I!=null&&(r++,D=E.offset=I),p=p||D<0||D>1,c=c||D<u,u=D,a.push(D),E});p&&e.errors.push(nR()),c&&e.errors.push(iR());let _=i.steps.length,S=0;r>0&&r<_?e.errors.push(oR()):r==0&&(S=o/(_-1));let x=_-1,b=e.currentTime,M=e.currentAnimateTimings,w=M.duration;return h.forEach((y,E)=>{let I=S>0?E==x?1:S*E:a[E],D=I*w;e.currentTime=b+M.delay+D,M.duration=D,this._validateStyleAst(y,e),y.offset=I,t.styles.push(y)}),t}visitReference(i,e){return{type:qn.Reference,animation:cs(this,Gh(i.animation),e),options:au(i.options)}}visitAnimateChild(i,e){return e.depCount++,{type:qn.AnimateChild,options:au(i.options)}}visitAnimateRef(i,e){return{type:qn.AnimateRef,animation:this.visitReference(i.animation,e),options:au(i.options)}}visitQuery(i,e){let t=e.currentQuerySelector,o=i.options||{};e.queryCount++,e.currentQuery=i;let[r,a]=bJ(i.selector);e.currentQuerySelector=t.length?t+" "+r:r,ls(e.collectedStyles,e.currentQuerySelector,new Map);let c=cs(this,Gh(i.animation),e);return e.currentQuery=null,e.currentQuerySelector=t,{type:qn.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:a,animation:c,originalSelector:i.selector,options:au(i.options)}}visitStagger(i,e){e.currentQuery||e.errors.push(rR());let t=i.timings==="full"?{duration:0,delay:0,easing:"full"}:v0(i.timings,e.errors,!0);return{type:qn.Stagger,animation:cs(this,Gh(i.animation),e),timings:t,options:null}}};function bJ(n){let i=!!n.split(/\s*,\s*/).find(e=>e==FR);return i&&(n=n.replace(CJ,"")),n=n.replace(/@\*/g,_0).replace(/@\w+/g,e=>_0+"-"+e.slice(1)).replace(/:animating/g,Sb),[n,i]}function xJ(n){return n?K({},n):null}var bD=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(i){this.errors=i}};function yJ(n){if(typeof n=="string")return null;let i=null;if(Array.isArray(n))n.forEach(e=>{if(e instanceof Map&&e.has("offset")){let t=e;i=parseFloat(t.get("offset")),t.delete("offset")}});else if(n instanceof Map&&n.has("offset")){let e=n;i=parseFloat(e.get("offset")),e.delete("offset")}return i}function SJ(n,i){if(n.hasOwnProperty("duration"))return n;if(typeof n=="number"){let r=v0(n,i).duration;return hD(r,0,"")}let e=n;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=hD(0,0,"");return r.dynamic=!0,r.strValue=e,r}let o=v0(e,i);return hD(o.duration,o.delay,o.easing)}function au(n){return n?(n=K({},n),n.params&&(n.params=xJ(n.params))):n={},n}function hD(n,i,e){return{duration:n,delay:i,easing:e}}function ID(n,i,e,t,o,r,a=null,c=!1){return{type:1,element:n,keyframes:i,preStyleProps:e,postStyleProps:t,duration:o,delay:r,totalTime:o+r,easing:a,subTimeline:c}}var b0=class{_map=new Map;get(i){return this._map.get(i)||[]}append(i,e){let t=this._map.get(i);t||this._map.set(i,t=[]),t.push(...e)}has(i){return this._map.has(i)}clear(){this._map.clear()}},wJ=1,MJ=":enter",kJ=new RegExp(MJ,"g"),TJ=":leave",EJ=new RegExp(TJ,"g");function LR(n,i,e,t,o,r=new Map,a=new Map,c,p,u=[]){return new xD().buildKeyframes(n,i,e,t,o,r,a,c,p,u)}var xD=class{buildKeyframes(i,e,t,o,r,a,c,p,u,h=[]){u=u||new b0;let _=new yD(i,e,u,o,r,h,[]);_.options=p;let S=p.delay?Ic(p.delay):0;_.currentTimeline.delayNextStep(S),_.currentTimeline.setStyles([a],null,_.errors,p),cs(this,t,_);let x=_.timelines.filter(b=>b.containsAnimation());if(x.length&&c.size){let b;for(let M=x.length-1;M>=0;M--){let w=x[M];if(w.element===e){b=w;break}}b&&!b.allowOnlyTimelineStyles()&&b.setStyles([c],null,_.errors,p)}return x.length?x.map(b=>b.buildKeyframes()):[ID(e,[],[],[],0,S,"",!1)]}visitTrigger(i,e){}visitState(i,e){}visitTransition(i,e){}visitAnimateChild(i,e){let t=e.subInstructions.get(e.element);if(t){let o=e.createSubContext(i.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(t,o,o.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=i}visitAnimateRef(i,e){let t=e.createSubContext(i.options);t.transformIntoNewTimeline(),this._applyAnimationRefDelays([i.options,i.animation.options],e,t),this.visitReference(i.animation,t),e.transformIntoNewTimeline(t.currentTimeline.currentTime),e.previousNode=i}_applyAnimationRefDelays(i,e,t){for(let o of i){let r=o?.delay;if(r){let a=typeof r=="number"?r:Ic(Wh(r,o?.params??{},e.errors));t.delayNextStep(a)}}}_visitSubInstructions(i,e,t){let r=e.currentTimeline.currentTime,a=t.duration!=null?Ic(t.duration):null,c=t.delay!=null?Ic(t.delay):null;return a!==0&&i.forEach(p=>{let u=e.appendInstructionToTimeline(p,a,c);r=Math.max(r,u.duration+u.delay)}),r}visitReference(i,e){e.updateOptions(i.options,!0),cs(this,i.animation,e),e.previousNode=i}visitSequence(i,e){let t=e.subContextCount,o=e,r=i.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),r.delay!=null)){o.previousNode.type==qn.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Ab);let a=Ic(r.delay);o.delayNextStep(a)}i.steps.length&&(i.steps.forEach(a=>cs(this,a,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>t&&o.transformIntoNewTimeline()),e.previousNode=i}visitGroup(i,e){let t=[],o=e.currentTimeline.currentTime,r=i.options&&i.options.delay?Ic(i.options.delay):0;i.steps.forEach(a=>{let c=e.createSubContext(i.options);r&&c.delayNextStep(r),cs(this,a,c),o=Math.max(o,c.currentTimeline.currentTime),t.push(c.currentTimeline)}),t.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(o),e.previousNode=i}_visitTiming(i,e){if(i.dynamic){let t=i.strValue,o=e.params?Wh(t,e.params,e.errors):t;return v0(o,e.errors)}else return{duration:i.duration,delay:i.delay,easing:i.easing}}visitAnimate(i,e){let t=e.currentAnimateTimings=this._visitTiming(i.timings,e),o=e.currentTimeline;t.delay&&(e.incrementTime(t.delay),o.snapshotCurrentStyles());let r=i.style;r.type==qn.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(t.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=i}visitStyle(i,e){let t=e.currentTimeline,o=e.currentAnimateTimings;!o&&t.hasCurrentStyleProperties()&&t.forwardFrame();let r=o&&o.easing||i.easing;i.isEmptyStep?t.applyEmptyStep(r):t.setStyles(i.styles,r,e.errors,e.options),e.previousNode=i}visitKeyframes(i,e){let t=e.currentAnimateTimings,o=e.currentTimeline.duration,r=t.duration,c=e.createSubContext().currentTimeline;c.easing=t.easing,i.styles.forEach(p=>{let u=p.offset||0;c.forwardTime(u*r),c.setStyles(p.styles,p.easing,e.errors,e.options),c.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(c),e.transformIntoNewTimeline(o+r),e.previousNode=i}visitQuery(i,e){let t=e.currentTimeline.currentTime,o=i.options||{},r=o.delay?Ic(o.delay):0;r&&(e.previousNode.type===qn.Style||t==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Ab);let a=t,c=e.invokeQuery(i.selector,i.originalSelector,i.limit,i.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=c.length;let p=null;c.forEach((u,h)=>{e.currentQueryIndex=h;let _=e.createSubContext(i.options,u);r&&_.delayNextStep(r),u===e.element&&(p=_.currentTimeline),cs(this,i.animation,_),_.currentTimeline.applyStylesToKeyframe();let S=_.currentTimeline.currentTime;a=Math.max(a,S)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),p&&(e.currentTimeline.mergeTimelineCollectedStyles(p),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=i}visitStagger(i,e){let t=e.parentContext,o=e.currentTimeline,r=i.timings,a=Math.abs(r.duration),c=a*(e.currentQueryTotal-1),p=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":p=c-p;break;case"full":p=t.currentStaggerTime;break}let h=e.currentTimeline;p&&h.delayNextStep(p);let _=h.currentTime;cs(this,i.animation,e),e.previousNode=i,t.currentStaggerTime=o.currentTime-_+(o.startTime-t.currentTimeline.startTime)}},Ab={},yD=class n{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Ab;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(i,e,t,o,r,a,c,p){this._driver=i,this.element=e,this.subInstructions=t,this._enterClassName=o,this._leaveClassName=r,this.errors=a,this.timelines=c,this.currentTimeline=p||new Ob(this._driver,e,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(i,e){if(!i)return;let t=i,o=this.options;t.duration!=null&&(o.duration=Ic(t.duration)),t.delay!=null&&(o.delay=Ic(t.delay));let r=t.params;if(r){let a=o.params;a||(a=this.options.params={}),Object.keys(r).forEach(c=>{(!e||!a.hasOwnProperty(c))&&(a[c]=Wh(r[c],a,this.errors))})}}_copyOptions(){let i={};if(this.options){let e=this.options.params;if(e){let t=i.params={};Object.keys(e).forEach(o=>{t[o]=e[o]})}}return i}createSubContext(i=null,e,t){let o=e||this.element,r=new n(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,t||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(i),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(i){return this.previousNode=Ab,this.currentTimeline=this.currentTimeline.fork(this.element,i),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(i,e,t){let o={duration:e??i.duration,delay:this.currentTimeline.currentTime+(t??0)+i.delay,easing:""},r=new SD(this._driver,i.element,i.keyframes,i.preStyleProps,i.postStyleProps,o,i.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(i){this.currentTimeline.forwardTime(this.currentTimeline.duration+i)}delayNextStep(i){i>0&&this.currentTimeline.delayNextStep(i)}invokeQuery(i,e,t,o,r,a){let c=[];if(o&&c.push(this.element),i.length>0){i=i.replace(kJ,"."+this._enterClassName),i=i.replace(EJ,"."+this._leaveClassName);let p=t!=1,u=this._driver.query(this.element,i,p);t!==0&&(u=t<0?u.slice(u.length+t,u.length):u.slice(0,t)),c.push(...u)}return!r&&c.length==0&&a.push(aR(e)),c}},Ob=class n{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(i,e,t,o){this._driver=i,this.element=e,this.startTime=t,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(i){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+i),e&&this.snapshotCurrentStyles()):this.startTime+=i}fork(i,e){return this.applyStylesToKeyframe(),new n(this._driver,i,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=wJ,this._loadKeyframe()}forwardTime(i){this.applyStylesToKeyframe(),this.duration=i,this._loadKeyframe()}_updateStyle(i,e){this._localTimelineStyles.set(i,e),this._globalTimelineStyles.set(i,e),this._styleSummary.set(i,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(i){i&&this._previousKeyframe.set("easing",i);for(let[e,t]of this._globalTimelineStyles)this._backFill.set(e,t||rl),this._currentKeyframe.set(e,rl);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(i,e,t,o){e&&this._previousKeyframe.set("easing",e);let r=o&&o.params||{},a=DJ(i,this._globalTimelineStyles);for(let[c,p]of a){let u=Wh(p,r,t);this._pendingStyles.set(c,u),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??rl),this._updateStyle(c,u)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((i,e)=>{this._currentKeyframe.set(e,i)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((i,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,i)}))}snapshotCurrentStyles(){for(let[i,e]of this._localTimelineStyles)this._pendingStyles.set(i,e),this._updateStyle(i,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let i=[];for(let e in this._currentKeyframe)i.push(e);return i}mergeTimelineCollectedStyles(i){i._styleSummary.forEach((e,t)=>{let o=this._styleSummary.get(t);(!o||e.time>o.time)&&this._updateStyle(t,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let i=new Set,e=new Set,t=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((c,p)=>{let u=new Map([...this._backFill,...c]);u.forEach((h,_)=>{h===Uh?i.add(_):h===rl&&e.add(_)}),t||u.set("offset",p/this.duration),o.push(u)});let r=[...i.values()],a=[...e.values()];if(t){let c=o[0],p=new Map(c);c.set("offset",0),p.set("offset",1),o=[c,p]}return ID(this.element,o,r,a,this.duration,this.startTime,this.easing,!1)}},SD=class extends Ob{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(i,e,t,o,r,a,c=!1){super(i,e,a.delay),this.keyframes=t,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let i=this.keyframes,{delay:e,duration:t,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=t+e,c=e/a,p=new Map(i[0]);p.set("offset",0),r.push(p);let u=new Map(i[0]);u.set("offset",TR(c)),r.push(u);let h=i.length-1;for(let _=1;_<=h;_++){let S=new Map(i[_]),x=S.get("offset"),b=e+x*t;S.set("offset",TR(b/a)),r.push(S)}t=a,e=0,o="",i=r}return ID(this.element,i,this.preStyleProps,this.postStyleProps,t,e,o,!0)}};function TR(n,i=3){let e=Math.pow(10,i-1);return Math.round(n*e)/e}function DJ(n,i){let e=new Map,t;return n.forEach(o=>{if(o==="*"){t??=i.keys();for(let r of t)e.set(r,rl)}else for(let[r,a]of o)e.set(r,a)}),e}function ER(n,i,e,t,o,r,a,c,p,u,h,_,S){return{type:0,element:n,triggerName:i,isRemovalTransition:o,fromState:e,fromStyles:r,toState:t,toStyles:a,timelines:c,queriedElements:p,preStyleProps:u,postStyleProps:h,totalTime:_,errors:S}}var fD={},Nb=class{_triggerName;ast;_stateStyles;constructor(i,e,t){this._triggerName=i,this.ast=e,this._stateStyles=t}match(i,e,t,o){return PJ(this.ast.matchers,i,e,t,o)}buildStyles(i,e,t){let o=this._stateStyles.get("*");return i!==void 0&&(o=this._stateStyles.get(i?.toString())||o),o?o.buildStyles(e,t):new Map}build(i,e,t,o,r,a,c,p,u,h){let _=[],S=this.ast.options&&this.ast.options.params||fD,x=c&&c.params||fD,b=this.buildStyles(t,x,_),M=p&&p.params||fD,w=this.buildStyles(o,M,_),y=new Set,E=new Map,I=new Map,D=o==="void",N={params:VR(M,S),delay:this.ast.options?.delay},P=h?[]:LR(i,e,this.ast.animation,r,a,b,w,N,u,_),L=0;return P.forEach(re=>{L=Math.max(re.duration+re.delay,L)}),_.length?ER(e,this._triggerName,t,o,D,b,w,[],[],E,I,L,_):(P.forEach(re=>{let oe=re.element,G=ls(E,oe,new Set);re.preStyleProps.forEach(ue=>G.add(ue));let $=ls(I,oe,new Set);re.postStyleProps.forEach(ue=>$.add(ue)),oe!==e&&y.add(oe)}),ER(e,this._triggerName,t,o,D,b,w,P,[...y.values()],E,I,L))}};function PJ(n,i,e,t,o){return n.some(r=>r(i,e,t,o))}function VR(n,i){let e=K({},i);return Object.entries(n).forEach(([t,o])=>{o!=null&&(e[t]=o)}),e}var wD=class{styles;defaultParams;normalizer;constructor(i,e,t){this.styles=i,this.defaultParams=e,this.normalizer=t}buildStyles(i,e){let t=new Map,o=VR(i,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,c)=>{a&&(a=Wh(a,o,e));let p=this.normalizer.normalizePropertyName(c,e);a=this.normalizer.normalizeStyleValue(c,p,a,e),t.set(c,a)})}),t}};function IJ(n,i,e){return new MD(n,i,e)}var MD=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(i,e,t){this.name=i,this.ast=e,this._normalizer=t,e.states.forEach(o=>{let r=o.options&&o.options.params||{};this.states.set(o.name,new wD(o.style,r,t))}),DR(this.states,"true","1"),DR(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new Nb(i,o,this.states))}),this.fallbackTransition=AJ(i,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(i,e,t,o){return this.transitionFactories.find(a=>a.match(i,e,t,o))||null}matchStyles(i,e,t){return this.fallbackTransition.buildStyles(i,e,t)}};function AJ(n,i,e){let t=[(a,c)=>!0],o={type:qn.Sequence,steps:[],options:null},r={type:qn.Transition,animation:o,matchers:t,options:null,queryCount:0,depCount:0};return new Nb(n,r,i)}function DR(n,i,e){n.has(i)?n.has(e)||n.set(e,n.get(i)):n.has(e)&&n.set(i,n.get(e))}var OJ=new b0,kD=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(i,e,t){this.bodyNode=i,this._driver=e,this._normalizer=t}register(i,e){let t=[],o=[],r=RR(this._driver,e,t,o);if(t.length)throw dR(t);this._animations.set(i,r)}_buildPlayer(i,e,t){let o=i.element,r=aD(this._normalizer,i.keyframes,e,t);return this._driver.animate(o,r,i.duration,i.delay,i.easing,[],!0)}create(i,e,t={}){let o=[],r=this._animations.get(i),a,c=new Map;if(r?(a=LR(this._driver,e,r,mD,yb,new Map,new Map,t,OJ,o),a.forEach(h=>{let _=ls(c,h.element,new Map);h.postStyleProps.forEach(S=>_.set(S,null))})):(o.push(mR()),a=[]),o.length)throw pR(o);c.forEach((h,_)=>{h.forEach((S,x)=>{h.set(x,this._driver.computeStyle(_,x,rl))})});let p=a.map(h=>{let _=c.get(h.element);return this._buildPlayer(h,new Map,_)}),u=Md(p);return this._playersById.set(i,u),u.onDestroy(()=>this.destroy(i)),this.players.push(u),u}destroy(i){let e=this._getPlayer(i);e.destroy(),this._playersById.delete(i);let t=this.players.indexOf(e);t>=0&&this.players.splice(t,1)}_getPlayer(i){let e=this._playersById.get(i);if(!e)throw uR(i);return e}listen(i,e,t,o){let r=bb(e,"","","");return Cb(this._getPlayer(i),t,r,o),()=>{}}command(i,e,t,o){if(t=="register"){this.register(i,o[0]);return}if(t=="create"){let a=o[0]||{};this.create(i,e,a);return}let r=this._getPlayer(i);switch(t){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(i);break}}},PR="ng-animate-queued",NJ=".ng-animate-queued",gD="ng-animate-disabled",FJ=".ng-animate-disabled",RJ="ng-star-inserted",LJ=".ng-star-inserted",VJ=[],BR={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},BJ={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},zl="__ng_removed",x0=class{namespaceId;value;options;get params(){return this.options.params}constructor(i,e=""){this.namespaceId=e;let t=i&&i.hasOwnProperty("value"),o=t?i.value:i;if(this.value=jJ(o),t){let r=i,{value:a}=r,c=uO(r,["value"]);this.options=c}else this.options={};this.options.params||(this.options.params={})}absorbOptions(i){let e=i.params;if(e){let t=this.options.params;Object.keys(e).forEach(o=>{t[o]==null&&(t[o]=e[o])})}}},C0="void",_D=new x0(C0),TD=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(i,e,t){this.id=i,this.hostElement=e,this._engine=t,this._hostClassName="ng-tns-"+i,al(e,this._hostClassName)}listen(i,e,t,o){if(!this._triggers.has(e))throw hR(t,e);if(t==null||t.length==0)throw fR(e);if(!$J(t))throw gR(t,e);let r=ls(this._elementListeners,i,[]),a={name:e,phase:t,callback:o};r.push(a);let c=ls(this._engine.statesByElement,i,new Map);return c.has(e)||(al(i,g0),al(i,g0+"-"+e),c.set(e,_D)),()=>{this._engine.afterFlush(()=>{let p=r.indexOf(a);p>=0&&r.splice(p,1),this._triggers.has(e)||c.delete(e)})}}register(i,e){return this._triggers.has(i)?!1:(this._triggers.set(i,e),!0)}_getTrigger(i){let e=this._triggers.get(i);if(!e)throw _R(i);return e}trigger(i,e,t,o=!0){let r=this._getTrigger(e),a=new y0(this.id,e,i),c=this._engine.statesByElement.get(i);c||(al(i,g0),al(i,g0+"-"+e),this._engine.statesByElement.set(i,c=new Map));let p=c.get(e),u=new x0(t,this.id);if(!(t&&t.hasOwnProperty("value"))&&p&&u.absorbOptions(p.options),c.set(e,u),p||(p=_D),!(u.value===C0)&&p.value===u.value){if(!GJ(p.params,u.params)){let M=[],w=r.matchStyles(p.value,p.params,M),y=r.matchStyles(u.value,u.params,M);M.length?this._engine.reportError(M):this._engine.afterFlush(()=>{bm(i,w),Bl(i,y)})}return}let S=ls(this._engine.playersByElement,i,[]);S.forEach(M=>{M.namespaceId==this.id&&M.triggerName==e&&M.queued&&M.destroy()});let x=r.matchTransition(p.value,u.value,i,u.params),b=!1;if(!x){if(!o)return;x=r.fallbackTransition,b=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:i,triggerName:e,transition:x,fromState:p,toState:u,player:a,isFallbackTransition:b}),b||(al(i,PR),a.onStart(()=>{qh(i,PR)})),a.onDone(()=>{let M=this.players.indexOf(a);M>=0&&this.players.splice(M,1);let w=this._engine.playersByElement.get(i);if(w){let y=w.indexOf(a);y>=0&&w.splice(y,1)}}),this.players.push(a),S.push(a),a}deregister(i){this._triggers.delete(i),this._engine.statesByElement.forEach(e=>e.delete(i)),this._elementListeners.forEach((e,t)=>{this._elementListeners.set(t,e.filter(o=>o.name!=i))})}clearElementCache(i){this._engine.statesByElement.delete(i),this._elementListeners.delete(i);let e=this._engine.playersByElement.get(i);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(i))}_signalRemovalForInnerTriggers(i,e){let t=this._engine.driver.query(i,_0,!0);t.forEach(o=>{if(o[zl])return;let r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(a=>a.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>t.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(i,e,t,o){let r=this._engine.statesByElement.get(i),a=new Map;if(r){let c=[];if(r.forEach((p,u)=>{if(a.set(u,p.value),this._triggers.has(u)){let h=this.trigger(i,u,C0,o);h&&c.push(h)}}),c.length)return this._engine.markElementAsRemoved(this.id,i,!0,e,a),t&&Md(c).onDone(()=>this._engine.processLeaveNode(i)),!0}return!1}prepareLeaveAnimationListeners(i){let e=this._elementListeners.get(i),t=this._engine.statesByElement.get(i);if(e&&t){let o=new Set;e.forEach(r=>{let a=r.name;if(o.has(a))return;o.add(a);let p=this._triggers.get(a).fallbackTransition,u=t.get(a)||_D,h=new x0(C0),_=new y0(this.id,a,i);this._engine.totalQueuedPlayers++,this._queue.push({element:i,triggerName:a,transition:p,fromState:u,toState:h,player:_,isFallbackTransition:!0})})}}removeNode(i,e){let t=this._engine;if(i.childElementCount&&this._signalRemovalForInnerTriggers(i,e),this.triggerLeaveAnimation(i,e,!0))return;let o=!1;if(t.totalAnimations){let r=t.players.length?t.playersByQueriedElement.get(i):[];if(r&&r.length)o=!0;else{let a=i;for(;a=a.parentNode;)if(t.statesByElement.get(a)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(i),o)t.markElementAsRemoved(this.id,i,!1,e);else{let r=i[zl];(!r||r===BR)&&(t.afterFlush(()=>this.clearElementCache(i)),t.destroyInnerAnimations(i),t._onRemovalComplete(i,e))}}insertNode(i,e){al(i,this._hostClassName)}drainQueuedTransitions(i){let e=[];return this._queue.forEach(t=>{let o=t.player;if(o.destroyed)return;let r=t.element,a=this._elementListeners.get(r);a&&a.forEach(c=>{if(c.name==t.triggerName){let p=bb(r,t.triggerName,t.fromState.value,t.toState.value);p._data=i,Cb(t.player,c.phase,p,c.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(t)}),this._queue=[],e.sort((t,o)=>{let r=t.transition.ast.depCount,a=o.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(t.element,o.element)?1:-1})}destroy(i){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,i)}},ED=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(i,e)=>{};_onRemovalComplete(i,e){this.onRemovalComplete(i,e)}constructor(i,e,t){this.bodyNode=i,this.driver=e,this._normalizer=t}get queuedPlayers(){let i=[];return this._namespaceList.forEach(e=>{e.players.forEach(t=>{t.queued&&i.push(t)})}),i}createNamespace(i,e){let t=new TD(i,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(t,e):(this.newHostElements.set(e,t),this.collectEnterElement(e)),this._namespaceLookup[i]=t}_balanceNamespaceList(i,e){let t=this._namespaceList,o=this.namespacesByHostElement;if(t.length-1>=0){let a=!1,c=this.driver.getParentElement(e);for(;c;){let p=o.get(c);if(p){let u=t.indexOf(p);t.splice(u+1,0,i),a=!0;break}c=this.driver.getParentElement(c)}a||t.unshift(i)}else t.push(i);return o.set(e,i),i}register(i,e){let t=this._namespaceLookup[i];return t||(t=this.createNamespace(i,e)),t}registerTrigger(i,e,t){let o=this._namespaceLookup[i];o&&o.register(e,t)&&this.totalAnimations++}destroy(i,e){i&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let t=this._fetchNamespace(i);this.namespacesByHostElement.delete(t.hostElement);let o=this._namespaceList.indexOf(t);o>=0&&this._namespaceList.splice(o,1),t.destroy(e),delete this._namespaceLookup[i]}))}_fetchNamespace(i){return this._namespaceLookup[i]}fetchNamespacesByElement(i){let e=new Set,t=this.statesByElement.get(i);if(t){for(let o of t.values())if(o.namespaceId){let r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}}return e}trigger(i,e,t,o){if(Eb(e)){let r=this._fetchNamespace(i);if(r)return r.trigger(e,t,o),!0}return!1}insertNode(i,e,t,o){if(!Eb(e))return;let r=e[zl];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(i){let a=this._fetchNamespace(i);a&&a.insertNode(e,t)}o&&this.collectEnterElement(e)}collectEnterElement(i){this.collectedEnterElements.push(i)}markElementAsDisabled(i,e){e?this.disabledNodes.has(i)||(this.disabledNodes.add(i),al(i,gD)):this.disabledNodes.has(i)&&(this.disabledNodes.delete(i),qh(i,gD))}removeNode(i,e,t){if(Eb(e)){let o=i?this._fetchNamespace(i):null;o?o.removeNode(e,t):this.markElementAsRemoved(i,e,!1,t);let r=this.namespacesByHostElement.get(e);r&&r.id!==i&&r.removeNode(e,t)}else this._onRemovalComplete(e,t)}markElementAsRemoved(i,e,t,o,r){this.collectedLeaveElements.push(e),e[zl]={namespaceId:i,setForRemoval:o,hasAnimation:t,removedBeforeQueried:!1,previousTriggersValues:r}}listen(i,e,t,o,r){return Eb(e)?this._fetchNamespace(i).listen(e,t,o,r):()=>{}}_buildInstruction(i,e,t,o,r){return i.transition.build(this.driver,i.element,i.fromState.value,i.toState.value,t,o,i.fromState.options,i.toState.options,e,r)}destroyInnerAnimations(i){let e=this.driver.query(i,_0,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(i,Sb,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(i){let e=this.playersByElement.get(i);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(i){let e=this.playersByQueriedElement.get(i);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(i=>{if(this.players.length)return Md(this.players).onDone(()=>i());i()})}processLeaveNode(i){let e=i[zl];if(e&&e.setForRemoval){if(i[zl]=BR,e.namespaceId){this.destroyInnerAnimations(i);let t=this._fetchNamespace(e.namespaceId);t&&t.clearElementCache(i)}this._onRemovalComplete(i,e.setForRemoval)}i.classList?.contains(gD)&&this.markElementAsDisabled(i,!1),this.driver.query(i,FJ,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(i=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,o)=>this._balanceNamespaceList(t,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let t=0;t<this.collectedEnterElements.length;t++){let o=this.collectedEnterElements[t];al(o,RJ)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let t=[];try{e=this._flushAnimations(t,i)}finally{for(let o=0;o<t.length;o++)t[o]()}}else for(let t=0;t<this.collectedLeaveElements.length;t++){let o=this.collectedLeaveElements[t];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(t=>t()),this._flushFns=[],this._whenQuietFns.length){let t=this._whenQuietFns;this._whenQuietFns=[],e.length?Md(e).onDone(()=>{t.forEach(o=>o())}):t.forEach(o=>o())}}reportError(i){throw vR(i)}_flushAnimations(i,e){let t=new b0,o=[],r=new Map,a=[],c=new Map,p=new Map,u=new Map,h=new Set;this.disabledNodes.forEach(he=>{h.add(he);let B=this.driver.query(he,NJ,!0);for(let X=0;X<B.length;X++)h.add(B[X])});let _=this.bodyNode,S=Array.from(this.statesByElement.keys()),x=OR(S,this.collectedEnterElements),b=new Map,M=0;x.forEach((he,B)=>{let X=mD+M++;b.set(B,X),he.forEach(se=>al(se,X))});let w=[],y=new Set,E=new Set;for(let he=0;he<this.collectedLeaveElements.length;he++){let B=this.collectedLeaveElements[he],X=B[zl];X&&X.setForRemoval&&(w.push(B),y.add(B),X.hasAnimation?this.driver.query(B,LJ,!0).forEach(se=>y.add(se)):E.add(B))}let I=new Map,D=OR(S,Array.from(y));D.forEach((he,B)=>{let X=yb+M++;I.set(B,X),he.forEach(se=>al(se,X))}),i.push(()=>{x.forEach((he,B)=>{let X=b.get(B);he.forEach(se=>qh(se,X))}),D.forEach((he,B)=>{let X=I.get(B);he.forEach(se=>qh(se,X))}),w.forEach(he=>{this.processLeaveNode(he)})});let N=[],P=[];for(let he=this._namespaceList.length-1;he>=0;he--)this._namespaceList[he].drainQueuedTransitions(e).forEach(X=>{let se=X.player,ce=X.element;if(N.push(se),this.collectedEnterElements.length){let Oe=ce[zl];if(Oe&&Oe.setForMove){if(Oe.previousTriggersValues&&Oe.previousTriggersValues.has(X.triggerName)){let We=Oe.previousTriggersValues.get(X.triggerName),ct=this.statesByElement.get(X.element);if(ct&&ct.has(X.triggerName)){let Tt=ct.get(X.triggerName);Tt.value=We,ct.set(X.triggerName,Tt)}}se.destroy();return}}let ke=!_||!this.driver.containsElement(_,ce),ze=I.get(ce),Ke=b.get(ce),Qe=this._buildInstruction(X,t,Ke,ze,ke);if(Qe.errors&&Qe.errors.length){P.push(Qe);return}if(ke){se.onStart(()=>bm(ce,Qe.fromStyles)),se.onDestroy(()=>Bl(ce,Qe.toStyles)),o.push(se);return}if(X.isFallbackTransition){se.onStart(()=>bm(ce,Qe.fromStyles)),se.onDestroy(()=>Bl(ce,Qe.toStyles)),o.push(se);return}let ye=[];Qe.timelines.forEach(Oe=>{Oe.stretchStartingKeyframe=!0,this.disabledNodes.has(Oe.element)||ye.push(Oe)}),Qe.timelines=ye,t.append(ce,Qe.timelines);let q={instruction:Qe,player:se,element:ce};a.push(q),Qe.queriedElements.forEach(Oe=>ls(c,Oe,[]).push(se)),Qe.preStyleProps.forEach((Oe,We)=>{if(Oe.size){let ct=p.get(We);ct||p.set(We,ct=new Set),Oe.forEach((Tt,Xn)=>ct.add(Xn))}}),Qe.postStyleProps.forEach((Oe,We)=>{let ct=u.get(We);ct||u.set(We,ct=new Set),Oe.forEach((Tt,Xn)=>ct.add(Xn))})});if(P.length){let he=[];P.forEach(B=>{he.push(CR(B.triggerName,B.errors))}),N.forEach(B=>B.destroy()),this.reportError(he)}let L=new Map,re=new Map;a.forEach(he=>{let B=he.element;t.has(B)&&(re.set(B,B),this._beforeAnimationBuild(he.player.namespaceId,he.instruction,L))}),o.forEach(he=>{let B=he.element;this._getPreviousPlayers(B,!1,he.namespaceId,he.triggerName,null).forEach(se=>{ls(L,B,[]).push(se),se.destroy()})});let oe=w.filter(he=>NR(he,p,u)),G=new Map;AR(G,this.driver,E,u,rl).forEach(he=>{NR(he,p,u)&&oe.push(he)});let ue=new Map;x.forEach((he,B)=>{AR(ue,this.driver,new Set(he),p,Uh)}),oe.forEach(he=>{let B=G.get(he),X=ue.get(he);G.set(he,new Map([...B?.entries()??[],...X?.entries()??[]]))});let be=[],me=[],De={};a.forEach(he=>{let{element:B,player:X,instruction:se}=he;if(t.has(B)){if(h.has(B)){X.onDestroy(()=>Bl(B,se.toStyles)),X.disabled=!0,X.overrideTotalTime(se.totalTime),o.push(X);return}let ce=De;if(re.size>1){let ze=B,Ke=[];for(;ze=ze.parentNode;){let Qe=re.get(ze);if(Qe){ce=Qe;break}Ke.push(ze)}Ke.forEach(Qe=>re.set(Qe,ce))}let ke=this._buildAnimation(X.namespaceId,se,L,r,ue,G);if(X.setRealPlayer(ke),ce===De)be.push(X);else{let ze=this.playersByElement.get(ce);ze&&ze.length&&(X.parentPlayer=Md(ze)),o.push(X)}}else bm(B,se.fromStyles),X.onDestroy(()=>Bl(B,se.toStyles)),me.push(X),h.has(B)&&o.push(X)}),me.forEach(he=>{let B=r.get(he.element);if(B&&B.length){let X=Md(B);he.setRealPlayer(X)}}),o.forEach(he=>{he.parentPlayer?he.syncPlayerEvents(he.parentPlayer):he.destroy()});for(let he=0;he<w.length;he++){let B=w[he],X=B[zl];if(qh(B,yb),X&&X.hasAnimation)continue;let se=[];if(c.size){let ke=c.get(B);ke&&ke.length&&se.push(...ke);let ze=this.driver.query(B,Sb,!0);for(let Ke=0;Ke<ze.length;Ke++){let Qe=c.get(ze[Ke]);Qe&&Qe.length&&se.push(...Qe)}}let ce=se.filter(ke=>!ke.destroyed);ce.length?HJ(this,B,ce):this.processLeaveNode(B)}return w.length=0,be.forEach(he=>{this.players.push(he),he.onDone(()=>{he.destroy();let B=this.players.indexOf(he);this.players.splice(B,1)}),he.play()}),be}afterFlush(i){this._flushFns.push(i)}afterFlushAnimationsDone(i){this._whenQuietFns.push(i)}_getPreviousPlayers(i,e,t,o,r){let a=[];if(e){let c=this.playersByQueriedElement.get(i);c&&(a=c)}else{let c=this.playersByElement.get(i);if(c){let p=!r||r==C0;c.forEach(u=>{u.queued||!p&&u.triggerName!=o||a.push(u)})}}return(t||o)&&(a=a.filter(c=>!(t&&t!=c.namespaceId||o&&o!=c.triggerName))),a}_beforeAnimationBuild(i,e,t){let o=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:i,c=e.isRemovalTransition?void 0:o;for(let p of e.timelines){let u=p.element,h=u!==r,_=ls(t,u,[]);this._getPreviousPlayers(u,h,a,c,e.toState).forEach(x=>{let b=x.getRealPlayer();b.beforeDestroy&&b.beforeDestroy(),x.destroy(),_.push(x)})}bm(r,e.fromStyles)}_buildAnimation(i,e,t,o,r,a){let c=e.triggerName,p=e.element,u=[],h=new Set,_=new Set,S=e.timelines.map(b=>{let M=b.element;h.add(M);let w=M[zl];if(w&&w.removedBeforeQueried)return new Pc(b.duration,b.delay);let y=M!==p,E=UJ((t.get(M)||VJ).map(L=>L.getRealPlayer())).filter(L=>{let re=L;return re.element?re.element===M:!1}),I=r.get(M),D=a.get(M),N=aD(this._normalizer,b.keyframes,I,D),P=this._buildPlayer(b,N,E);if(b.subTimeline&&o&&_.add(M),y){let L=new y0(i,c,M);L.setRealPlayer(P),u.push(L)}return P});u.forEach(b=>{ls(this.playersByQueriedElement,b.element,[]).push(b),b.onDone(()=>zJ(this.playersByQueriedElement,b.element,b))}),h.forEach(b=>al(b,pD));let x=Md(S);return x.onDestroy(()=>{h.forEach(b=>qh(b,pD)),Bl(p,e.toStyles)}),_.forEach(b=>{ls(o,b,[]).push(x)}),x}_buildPlayer(i,e,t){return e.length>0?this.driver.animate(i.element,e,i.duration,i.delay,i.easing,t):new Pc(i.duration,i.delay)}},y0=class{namespaceId;triggerName;element;_player=new Pc;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(i,e,t){this.namespaceId=i,this.triggerName=e,this.element=t}setRealPlayer(i){this._containsRealPlayer||(this._player=i,this._queuedCallbacks.forEach((e,t)=>{e.forEach(o=>Cb(i,t,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(i.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(i){this.totalTime=i}syncPlayerEvents(i){let e=this._player;e.triggerCallback&&i.onStart(()=>e.triggerCallback("start")),i.onDone(()=>this.finish()),i.onDestroy(()=>this.destroy())}_queueEvent(i,e){ls(this._queuedCallbacks,i,[]).push(e)}onDone(i){this.queued&&this._queueEvent("done",i),this._player.onDone(i)}onStart(i){this.queued&&this._queueEvent("start",i),this._player.onStart(i)}onDestroy(i){this.queued&&this._queueEvent("destroy",i),this._player.onDestroy(i)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(i){this.queued||this._player.setPosition(i)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(i){let e=this._player;e.triggerCallback&&e.triggerCallback(i)}};function zJ(n,i,e){let t=n.get(i);if(t){if(t.length){let o=t.indexOf(e);t.splice(o,1)}t.length==0&&n.delete(i)}return t}function jJ(n){return n??null}function Eb(n){return n&&n.nodeType===1}function $J(n){return n=="start"||n=="done"}function IR(n,i){let e=n.style.display;return n.style.display=i??"none",e}function AR(n,i,e,t,o){let r=[];e.forEach(p=>r.push(IR(p)));let a=[];t.forEach((p,u)=>{let h=new Map;p.forEach(_=>{let S=i.computeStyle(u,_,o);h.set(_,S),(!S||S.length==0)&&(u[zl]=BJ,a.push(u))}),n.set(u,h)});let c=0;return e.forEach(p=>IR(p,r[c++])),a}function OR(n,i){let e=new Map;if(n.forEach(c=>e.set(c,[])),i.length==0)return e;let t=1,o=new Set(i),r=new Map;function a(c){if(!c)return t;let p=r.get(c);if(p)return p;let u=c.parentNode;return e.has(u)?p=u:o.has(u)?p=t:p=a(u),r.set(c,p),p}return i.forEach(c=>{let p=a(c);p!==t&&e.get(p).push(c)}),e}function al(n,i){n.classList?.add(i)}function qh(n,i){n.classList?.remove(i)}function HJ(n,i,e){Md(e).onDone(()=>n.processLeaveNode(i))}function UJ(n){let i=[];return zR(n,i),i}function zR(n,i){for(let e=0;e<n.length;e++){let t=n[e];t instanceof iu?zR(t.players,i):i.push(t)}}function GJ(n,i){let e=Object.keys(n),t=Object.keys(i);if(e.length!=t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o];if(!i.hasOwnProperty(r)||n[r]!==i[r])return!1}return!0}function NR(n,i,e){let t=e.get(n);if(!t)return!1;let o=i.get(n);return o?t.forEach(r=>o.add(r)):i.set(n,t),e.delete(n),!0}var Qh=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(i,e)=>{};constructor(i,e,t){this._driver=e,this._normalizer=t,this._transitionEngine=new ED(i.body,e,t),this._timelineEngine=new kD(i.body,e,t),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(i,e,t,o,r){let a=i+"-"+o,c=this._triggerCache[a];if(!c){let p=[],u=[],h=RR(this._driver,r,p,u);if(p.length)throw cR(o,p);c=IJ(o,h,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(e,o,c)}register(i,e){this._transitionEngine.register(i,e)}destroy(i,e){this._transitionEngine.destroy(i,e)}onInsert(i,e,t,o){this._transitionEngine.insertNode(i,e,t,o)}onRemove(i,e,t){this._transitionEngine.removeNode(i,e,t)}disableAnimations(i,e){this._transitionEngine.markElementAsDisabled(i,e)}process(i,e,t,o){if(t.charAt(0)=="@"){let[r,a]=sD(t),c=o;this._timelineEngine.command(r,e,a,c)}else this._transitionEngine.trigger(i,e,t,o)}listen(i,e,t,o,r){if(t.charAt(0)=="@"){let[a,c]=sD(t);return this._timelineEngine.listen(a,e,c,r)}return this._transitionEngine.listen(i,e,t,o,r)}flush(i=-1){this._transitionEngine.flush(i)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(i){this._transitionEngine.afterFlushAnimationsDone(i)}};function WJ(n,i){let e=null,t=null;return Array.isArray(i)&&i.length?(e=vD(i[0]),i.length>1&&(t=vD(i[i.length-1]))):i instanceof Map&&(e=vD(i)),e||t?new qJ(n,e,t):null}var qJ=(()=>{class n{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,t,o){this._element=e,this._startStyles=t,this._endStyles=o;let r=n.initialStylesByElement.get(e);r||n.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Bl(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Bl(this._element,this._initialStyles),this._endStyles&&(Bl(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(bm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(bm(this._element,this._endStyles),this._endStyles=null),Bl(this._element,this._initialStyles),this._state=3)}}return n})();function vD(n){let i=null;return n.forEach((e,t)=>{QJ(t)&&(i=i||new Map,i.set(t,e))}),i}function QJ(n){return n==="display"||n==="position"}var Fb=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(i,e,t,o){this.element=i,this.keyframes=e,this.options=t,this._specialStyles=o,this._duration=t.duration,this._delay=t.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(i=>i()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let i=this.keyframes,e=this._triggerWebAnimation(this.element,i,this.options);if(!e)return this._onFinish(),null;this.domPlayer=e,this._finalKeyframe=i.length?i[i.length-1]:new Map;let t=()=>this._onFinish();return e.addEventListener("finish",t),this.onDestroy(()=>{e.removeEventListener("finish",t)}),e}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(i){let e=[];return i.forEach(t=>{e.push(Object.fromEntries(t))}),e}_triggerWebAnimation(i,e,t){let o=this._convertKeyframesToObject(e);try{return i.animate(o,t)}catch{return null}}onStart(i){this._originalOnStartFns.push(i),this._onStartFns.push(i)}onDone(i){this._originalOnDoneFns.push(i),this._onDoneFns.push(i)}onDestroy(i){this._onDestroyFns.push(i)}play(){let i=this._buildPlayer();i&&(this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),i.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(i=>i()),this._onDestroyFns=[])}setPosition(i){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=i*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let i=new Map;this.hasStarted()&&this._finalKeyframe.forEach((t,o)=>{o!=="offset"&&i.set(o,this._finished?t:Mb(this.element,o))}),this.currentSnapshot=i}triggerCallback(i){let e=i==="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Rb=class{validateStyleProperty(i){return!0}validateAnimatableStyleProperty(i){return!0}containsElement(i,e){return lD(i,e)}getParentElement(i){return xb(i)}query(i,e,t){return cD(i,e,t)}computeStyle(i,e,t){return Mb(i,e)}animate(i,e,t,o,r,a=[]){let c=o==0?"both":"forwards",p={duration:t,delay:o,fill:c};r&&(p.easing=r);let u=new Map,h=a.filter(x=>x instanceof Fb);SR(t,o)&&h.forEach(x=>{x.currentSnapshot.forEach((b,M)=>u.set(M,b))});let _=xR(e).map(x=>new Map(x));_=wR(i,_,u);let S=WJ(i,_);return new Fb(i,_,p,S)}};var Db="@",jR="@.disabled",Lb=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(i,e,t,o){this.namespaceId=i,this.delegate=e,this.engine=t,this._onDestroy=o}get data(){return this.delegate.data}destroyNode(i){this.delegate.destroyNode?.(i)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(i,e){return this.delegate.createElement(i,e)}createComment(i){return this.delegate.createComment(i)}createText(i){return this.delegate.createText(i)}appendChild(i,e){this.delegate.appendChild(i,e),this.engine.onInsert(this.namespaceId,e,i,!1)}insertBefore(i,e,t,o=!0){this.delegate.insertBefore(i,e,t),this.engine.onInsert(this.namespaceId,e,i,o)}removeChild(i,e,t,o){if(o){this.delegate.removeChild(i,e,t,o);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(i,e){return this.delegate.selectRootElement(i,e)}parentNode(i){return this.delegate.parentNode(i)}nextSibling(i){return this.delegate.nextSibling(i)}setAttribute(i,e,t,o){this.delegate.setAttribute(i,e,t,o)}removeAttribute(i,e,t){this.delegate.removeAttribute(i,e,t)}addClass(i,e){this.delegate.addClass(i,e)}removeClass(i,e){this.delegate.removeClass(i,e)}setStyle(i,e,t,o){this.delegate.setStyle(i,e,t,o)}removeStyle(i,e,t){this.delegate.removeStyle(i,e,t)}setProperty(i,e,t){e.charAt(0)==Db&&e==jR?this.disableAnimations(i,!!t):this.delegate.setProperty(i,e,t)}setValue(i,e){this.delegate.setValue(i,e)}listen(i,e,t,o){return this.delegate.listen(i,e,t,o)}disableAnimations(i,e){this.engine.disableAnimations(i,e)}},DD=class extends Lb{factory;constructor(i,e,t,o,r){super(e,t,o,r),this.factory=i,this.namespaceId=e}setProperty(i,e,t){e.charAt(0)==Db?e.charAt(1)=="."&&e==jR?(t=t===void 0?!0:!!t,this.disableAnimations(i,t)):this.engine.process(this.namespaceId,i,e.slice(1),t):this.delegate.setProperty(i,e,t)}listen(i,e,t,o){if(e.charAt(0)==Db){let r=XJ(i),a=e.slice(1),c="";return a.charAt(0)!=Db&&([a,c]=KJ(a)),this.engine.listen(this.namespaceId,r,a,c,p=>{let u=p._data||-1;this.factory.scheduleListenerCallback(u,t,p)})}return this.delegate.listen(i,e,t,o)}};function XJ(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}function KJ(n){let i=n.indexOf("."),e=n.substring(0,i),t=n.slice(i+1);return[e,t]}var Vb=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(i,e,t){this.delegate=i,this.engine=e,this._zone=t,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(i,e){let o=this.delegate.createRenderer(i,e);if(!i||!e?.data?.animation){let u=this._rendererCache,h=u.get(o);if(!h){let _=()=>u.delete(o);h=new Lb("",o,this.engine,_),u.set(o,h)}return h}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,i);let c=u=>{Array.isArray(u)?u.forEach(c):this.engine.registerTrigger(r,a,i,u.name,u)};return e.data.animation.forEach(c),new DD(this,a,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(i,e,t){if(i>=0&&i<this._microtaskId){this._zone.run(()=>e(t));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{let[a,c]=r;a(c)}),this._animationCallbacksBuffer=[]})}),o.push([e,t])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(i){this.engine.flush(),this.delegate.componentReplaced?.(i)}};var ZJ=(()=>{class n extends Qh{constructor(e,t,o){super(e,t,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(t){return new(t||n)(ge(Xi),ge(su),ge(lu))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function JJ(){return new Pb}function eee(){return new Vb(f(VO),f(Qh),f(Vi))}var HR=[{provide:lu,useFactory:JJ},{provide:Qh,useClass:ZJ},{provide:sd,useFactory:eee}],tee=[{provide:su,useClass:PD},{provide:ak,useValue:"NoopAnimations"},...HR],$R=[{provide:su,useFactory:()=>new Rb},{provide:ak,useFactory:()=>"BrowserAnimations"},...HR],UR=(()=>{class n{static withConfig(e){return{ngModule:n,providers:e.disableAnimations?tee:$R}}static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({providers:$R,imports:[rC]})}return n})();function nee(n,i){return typeof n>"u"?typeof i>"u"?n:i:n}function FD(n,i){return n=nee(n,i),typeof n=="function"?function(){for(var t=arguments,o=arguments.length,r=Array(o),a=0;a<o;a++)r[a]=t[a];return!!n.apply(this,r)}:n?function(){return!0}:function(){return!1}}var AD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol?"symbol":typeof n},WR=function(n){return n!=null&&(typeof n>"u"?"undefined":AD(n))==="object"&&n.nodeType===1&&AD(n.style)==="object"&&AD(n.ownerDocument)==="object"};function qR(n,i){if(i=VD(i,!0),!WR(i))return-1;for(var e=0;e<n.length;e++)if(n[e]===i)return e;return-1}function RD(n,i){return qR(n,i)!==-1}function iee(n,i){for(var e=0;e<i.length;e++)RD(n,i[e])||n.push(i[e]);return i}function oee(n){for(var i=arguments,e=[],t=arguments.length-1;t-- >0;)e[t]=i[t+1];return e=e.map(VD),iee(n,e)}function ree(n){for(var i=arguments,e=[],t=arguments.length-1;t-- >0;)e[t]=i[t+1];return e.map(VD).reduce(function(o,r){var a=qR(n,r);return a!==-1?o.concat(n.splice(a,1)):o},[])}function VD(n,i){if(typeof n=="string")try{return document.querySelector(n)}catch(e){throw e}if(!WR(n)&&!i)throw new TypeError(n+" is not a DOM element.");return n}function aee(n,i){i=i||{};var e=FD(i.allowUpdate,!0);return function(o){if(o=o||window.event,n.target=o.target||o.srcElement||o.originalTarget,n.element=this,n.type=o.type,!!e(o)){if(o.targetTouches)n.x=o.targetTouches[0].clientX,n.y=o.targetTouches[0].clientY,n.pageX=o.targetTouches[0].pageX,n.pageY=o.targetTouches[0].pageY,n.screenX=o.targetTouches[0].screenX,n.screenY=o.targetTouches[0].screenY;else{if(o.pageX===null&&o.clientX!==null){var r=o.target&&o.target.ownerDocument||document,a=r.documentElement,c=r.body;n.pageX=o.clientX+(a&&a.scrollLeft||c&&c.scrollLeft||0)-(a&&a.clientLeft||c&&c.clientLeft||0),n.pageY=o.clientY+(a&&a.scrollTop||c&&c.scrollTop||0)-(a&&a.clientTop||c&&c.clientTop||0)}else n.pageX=o.pageX,n.pageY=o.pageY;n.x=o.clientX,n.y=o.clientY,n.screenX=o.screenX,n.screenY=o.screenY}n.clientX=n.x,n.clientY=n.y}}}function see(){var n={top:{value:0,enumerable:!0},left:{value:0,enumerable:!0},right:{value:window.innerWidth,enumerable:!0},bottom:{value:window.innerHeight,enumerable:!0},width:{value:window.innerWidth,enumerable:!0},height:{value:window.innerHeight,enumerable:!0},x:{value:0,enumerable:!0},y:{value:0,enumerable:!0}};if(Object.create)return Object.create({},n);var i={};return Object.defineProperties(i,n),i}function QR(n){if(n===window)return see();try{var i=n.getBoundingClientRect();return i.x===void 0&&(i.x=i.left,i.y=i.top),i}catch{throw new TypeError("Can't call getBoundingClientRect on "+n)}}function lee(n,i){var e=QR(i);return n.y>e.top&&n.y<e.bottom&&n.x>e.left&&n.x<e.right}var LD=void 0;typeof Object.create!="function"?LD=(function(n){var i=function(){};return function(e,t){if(e!==Object(e)&&e!==null)throw TypeError("Argument must be an object, or null");i.prototype=e||{};var o=new i;return i.prototype=null,t!==n&&Object.defineProperties(o,t),e===null&&(o.__proto__=null),o}})():LD=Object.create;var cee=LD,cu=["altKey","button","buttons","clientX","clientY","ctrlKey","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","region","relatedTarget","screenX","screenY","shiftKey","which","x","y"];function dee(n){var i={screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1,button:0,buttons:1,relatedTarget:null,region:null};n!==void 0&&n.addEventListener("mousemove",e);function e(r){for(var a=0;a<cu.length;a++)i[cu[a]]=r[cu[a]]}var t=(function(){if(MouseEvent)return function(a,c,p){var u=new MouseEvent("mousemove",OD(i,c));return ND(u,p),a.dispatchEvent(u)};if(typeof document.createEvent=="function")return function(a,c,p){var u=OD(i,c),h=document.createEvent("MouseEvents");return h.initMouseEvent("mousemove",!0,!0,window,0,u.screenX,u.screenY,u.clientX,u.clientY,u.ctrlKey,u.altKey,u.shiftKey,u.metaKey,u.button,u.relatedTarget),ND(h,p),a.dispatchEvent(h)};if(typeof document.createEventObject=="function")return function(a,c,p){var u=document.createEventObject(),h=OD(i,c);for(var _ in h)u[_]=h[_];return ND(u,p),a.dispatchEvent(u)}})();function o(){n&&n.removeEventListener("mousemove",e,!1),i=null}return{destroy:o,dispatch:t}}function OD(n,i){i=i||{};for(var e=cee(n),t=0;t<cu.length;t++)i[cu[t]]!==void 0&&(e[cu[t]]=i[cu[t]]);return e}function ND(n,i){console.log("data ",i),n.data=i||{},n.dispatched="mousemove"}var w0=["webkit","moz","ms","o"],S0=(function(){if(typeof window>"u")return function(){};for(var n=0,i=w0.length;n<i&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[w0[n]+"RequestAnimationFrame"];if(!window.requestAnimationFrame){var e=0;window.requestAnimationFrame=function(t){var o=new Date().getTime(),r=Math.max(0,16-o-e),a=window.setTimeout(function(){return t(o+r)},r);return e=o+r,a}}return window.requestAnimationFrame.bind(window)})(),Xh=(function(){if(typeof window>"u")return function(){};for(var n=0,i=w0.length;n<i&&!window.cancelAnimationFrame;++n)window.cancelAnimationFrame=window[w0[n]+"CancelAnimationFrame"]||window[w0[n]+"CancelRequestAnimationFrame"];return window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){window.clearTimeout(e)}),window.cancelAnimationFrame.bind(window)})();function mee(n,i){i===void 0&&(i={});var e=this,t=4,o=!1;if(typeof i.margin!="object"){var r=i.margin||-1;this.margin={left:r,right:r,top:r,bottom:r}}else this.margin=i.margin;this.scrollWhenOutside=i.scrollWhenOutside||!1;var a={},c=aee(a),p=dee(),u=!1;window.addEventListener("mousemove",c,!1),window.addEventListener("touchmove",c,!1),isNaN(i.maxSpeed)||(t=i.maxSpeed),typeof t!="object"&&(t={left:t,right:t,top:t,bottom:t}),this.autoScroll=FD(i.autoScroll),this.syncMove=FD(i.syncMove,!1),this.destroy=function($){window.removeEventListener("mousemove",c,!1),window.removeEventListener("touchmove",c,!1),window.removeEventListener("mousedown",M,!1),window.removeEventListener("touchstart",M,!1),window.removeEventListener("mouseup",w,!1),window.removeEventListener("touchend",w,!1),window.removeEventListener("pointerup",w,!1),window.removeEventListener("mouseleave",E,!1),window.removeEventListener("mousemove",N,!1),window.removeEventListener("touchmove",N,!1),window.removeEventListener("scroll",b,!0),n=[],$&&y()},this.add=function(){for(var $=[],ue=arguments.length;ue--;)$[ue]=arguments[ue];return oee.apply(void 0,[n].concat($)),this},this.remove=function(){for(var $=[],ue=arguments.length;ue--;)$[ue]=arguments[ue];return ree.apply(void 0,[n].concat($))};var h=null,_;Object.prototype.toString.call(n)!=="[object Array]"&&(n=[n]),(function($){n=[],$.forEach(function(ue){ue===window?h=window:e.add(ue)})})(n),Object.defineProperties(this,{down:{get:function(){return u}},maxSpeed:{get:function(){return t}},point:{get:function(){return a}},scrolling:{get:function(){return o}}});var S=null,x;window.addEventListener("mousedown",M,!1),window.addEventListener("touchstart",M,!1),window.addEventListener("mouseup",w,!1),window.addEventListener("touchend",w,!1),window.addEventListener("pointerup",w,!1),window.addEventListener("mousemove",N,!1),window.addEventListener("touchmove",N,!1),window.addEventListener("mouseleave",E,!1),window.addEventListener("scroll",b,!0);function b($){for(var ue=0;ue<n.length;ue++)if(n[ue]===$.target){o=!0;break}o&&S0(function(){return o=!1})}function M(){u=!0}function w(){u=!1,y()}function y(){Xh(x),Xh(_)}function E(){u=!1}function I($){if(!$)return null;if(S===$||RD(n,$))return $;for(;$=$.parentNode;)if(RD(n,$))return $;return null}function D(){for(var $=null,ue=0;ue<n.length;ue++)GR(a,n[ue])&&($=n[ue]);return $}function N($){if(e.autoScroll()&&!$.dispatched){var ue=$.target,be=document.body;S&&!GR(a,S)&&(e.scrollWhenOutside||(S=null)),ue&&ue.parentNode===be?ue=D():(ue=I(ue),ue||(ue=D())),ue&&ue!==S&&(S=ue),h&&(Xh(_),_=S0(P)),S&&(Xh(x),x=S0(L))}}function P(){re(h),Xh(_),_=S0(P)}function L(){S&&(re(S),Xh(x),x=S0(L))}function re($){var ue=QR($),be,me;a.x<ue.left+e.margin.left?be=Math.floor(Math.max(-1,(a.x-ue.left)/e.margin.left-1)*e.maxSpeed.left):a.x>ue.right-e.margin.right?be=Math.ceil(Math.min(1,(a.x-ue.right)/e.margin.right+1)*e.maxSpeed.right):be=0,a.y<ue.top+e.margin.top?me=Math.floor(Math.max(-1,(a.y-ue.top)/e.margin.top-1)*e.maxSpeed.top):a.y>ue.bottom-e.margin.bottom?me=Math.ceil(Math.min(1,(a.y-ue.bottom)/e.margin.bottom+1)*e.maxSpeed.bottom):me=0,e.syncMove()&&p.dispatch($,{pageX:a.pageX+be,pageY:a.pageY+me,clientX:a.x+be,clientY:a.y+me}),setTimeout(function(){me&&oe($,me),be&&G($,be)})}function oe($,ue){$===window?window.scrollTo($.pageXOffset,$.pageYOffset+ue):$.scrollTop+=ue}function G($,ue){$===window?window.scrollTo($.pageXOffset+ue,$.pageYOffset):$.scrollLeft+=ue}}function pee(n,i){return new mee(n,i)}function GR(n,i,e){return e?n.y>e.top&&n.y<e.bottom&&n.x>e.left&&n.x<e.right:lee(n,i)}var XR=pee;var uee=(()=>{class n{constructor(){this.currentDrag=new He}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),hee=(()=>{class n{constructor(){this.elementRef=f(Zt)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=ft({type:n,selectors:[["","mwlDraggableScrollContainer",""]]})}}return n})();function fee(n,i,e){e&&e.split(" ").forEach(t=>n.addClass(i.nativeElement,t))}function gee(n,i,e){e&&e.split(" ").forEach(t=>n.removeClass(i.nativeElement,t))}var KR=(()=>{class n{constructor(){this.dragAxis={x:!0,y:!0},this.dragSnapGrid={},this.ghostDragEnabled=!0,this.showOriginalElementWhileDragging=!1,this.dragCursor="",this.autoScroll={margin:20},this.dragPointerDown=new ve,this.dragStart=new ve,this.ghostElementCreated=new ve,this.dragging=new ve,this.dragEnd=new ve,this.pointerDown$=new He,this.pointerMove$=new He,this.pointerUp$=new He,this.eventListenerSubscriptions={},this.destroy$=new He,this.timeLongPress={timerBegin:0,timerEnd:0},this.element=f(Zt),this.renderer=f(Si),this.draggableHelper=f(uee),this.zone=f(Vi),this.vcr=f(oo),this.scrollContainer=f(hee,{optional:!0}),this.document=f(Xi)}ngOnInit(){this.checkEventListeners();let e=this.pointerDown$.pipe(ai(()=>this.canDrag()),ic(t=>{t.event.stopPropagation&&!this.scrollContainer&&t.event.stopPropagation();let o=this.renderer.createElement("style");this.renderer.setAttribute(o,"type","text/css"),this.renderer.appendChild(o,this.renderer.createText(`
body * {
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
}
`)),requestAnimationFrame(()=>{this.document.head.appendChild(o)});let r=this.getScrollPosition(),a=new Dr(x=>{let b=this.scrollContainer?this.scrollContainer.elementRef.nativeElement:"window";return this.renderer.listen(b,"scroll",M=>x.next(M))}).pipe(pi(r),Lt(()=>this.getScrollPosition())),c=new He,p=new Hd;this.dragPointerDown.observers.length>0&&this.zone.run(()=>{this.dragPointerDown.next({x:0,y:0})});let u=Hn(this.pointerUp$,this.pointerDown$,p,this.destroy$).pipe(Dl()),h=Pr([this.pointerMove$,a]).pipe(Lt(([x,b])=>({currentDrag$:c,transformX:x.clientX-t.clientX,transformY:x.clientY-t.clientY,clientX:x.clientX,clientY:x.clientY,scrollLeft:b.left,scrollTop:b.top,target:x.event.target})),Lt(x=>(this.dragSnapGrid.x&&(x.transformX=Math.round(x.transformX/this.dragSnapGrid.x)*this.dragSnapGrid.x),this.dragSnapGrid.y&&(x.transformY=Math.round(x.transformY/this.dragSnapGrid.y)*this.dragSnapGrid.y),x)),Lt(x=>(this.dragAxis.x||(x.transformX=0),this.dragAxis.y||(x.transformY=0),x)),Lt(x=>{let b=x.scrollLeft-r.left,M=x.scrollTop-r.top;return it(K({},x),{x:x.transformX+b,y:x.transformY+M})}),ai(({x,y:b,transformX:M,transformY:w})=>!this.validateDrag||this.validateDrag({x,y:b,transform:{x:M,y:w}})),tt(u),Dl()),_=h.pipe(Ao(1),Dl()),S=h.pipe(xO(1),Dl());return _.subscribe(({clientX:x,clientY:b,x:M,y:w})=>{if(this.dragStart.observers.length>0&&this.zone.run(()=>{this.dragStart.next({cancelDrag$:p})}),this.scroller=XR([this.scrollContainer?this.scrollContainer.elementRef.nativeElement:this.document.defaultView],it(K({},this.autoScroll),{autoScroll(){return!0}})),fee(this.renderer,this.element,this.dragActiveClass),this.ghostDragEnabled){let y=this.element.nativeElement.getBoundingClientRect(),E=this.element.nativeElement.cloneNode(!0);if(this.showOriginalElementWhileDragging||this.renderer.setStyle(this.element.nativeElement,"visibility","hidden"),this.ghostElementAppendTo?this.ghostElementAppendTo.appendChild(E):this.element.nativeElement.parentNode.insertBefore(E,this.element.nativeElement.nextSibling),this.ghostElement=E,this.document.body.style.cursor=this.dragCursor,this.setElementStyles(E,{position:"fixed",top:`${y.top}px`,left:`${y.left}px`,width:`${y.width}px`,height:`${y.height}px`,cursor:this.dragCursor,margin:"0",willChange:"transform",pointerEvents:"none"}),this.ghostElementTemplate){let I=this.vcr.createEmbeddedView(this.ghostElementTemplate);E.innerHTML="",I.rootNodes.filter(D=>D instanceof Node).forEach(D=>{E.appendChild(D)}),S.subscribe(()=>{this.vcr.remove(this.vcr.indexOf(I))})}this.ghostElementCreated.observers.length>0&&this.zone.run(()=>{this.ghostElementCreated.emit({clientX:x-M,clientY:b-w,element:E})}),S.subscribe(()=>{E.parentElement.removeChild(E),this.ghostElement=null,this.renderer.setStyle(this.element.nativeElement,"visibility","")})}this.draggableHelper.currentDrag.next(c)}),S.pipe(ic(x=>{let b=p.pipe(_O(),Ao(1),Lt(M=>it(K({},x),{dragCancelled:M>0})));return p.complete(),b})).subscribe(({x,y:b,dragCancelled:M})=>{this.scroller.destroy(),this.dragEnd.observers.length>0&&this.zone.run(()=>{this.dragEnd.next({x,y:b,dragCancelled:M})}),gee(this.renderer,this.element,this.dragActiveClass),c.complete()}),Hn(u,S).pipe(Ao(1)).subscribe(()=>{requestAnimationFrame(()=>{this.document.head.removeChild(o)})}),h}),Dl());Hn(e.pipe(Ao(1),Lt(t=>[,t])),e.pipe(Yv())).pipe(ai(([t,o])=>t?t.x!==o.x||t.y!==o.y:!0),Lt(([t,o])=>o)).subscribe(({x:t,y:o,currentDrag$:r,clientX:a,clientY:c,transformX:p,transformY:u,target:h})=>{this.dragging.observers.length>0&&this.zone.run(()=>{this.dragging.next({x:t,y:o})}),requestAnimationFrame(()=>{if(this.ghostElement){let _=`translate3d(${p}px, ${u}px, 0px)`;this.setElementStyles(this.ghostElement,{transform:_,"-webkit-transform":_,"-ms-transform":_,"-moz-transform":_,"-o-transform":_})}}),r.next({clientX:a,clientY:c,dropData:this.dropData,target:h})})}ngOnChanges(e){e.dragAxis&&this.checkEventListeners()}ngOnDestroy(){this.unsubscribeEventListeners(),this.pointerDown$.complete(),this.pointerMove$.complete(),this.pointerUp$.complete(),this.destroy$.next()}checkEventListeners(){let e=this.canDrag(),t=Object.keys(this.eventListenerSubscriptions).length>0;e&&!t?this.zone.runOutsideAngular(()=>{this.eventListenerSubscriptions.mousedown=this.renderer.listen(this.element.nativeElement,"mousedown",o=>{this.onMouseDown(o)}),this.eventListenerSubscriptions.mouseup=this.renderer.listen("document","mouseup",o=>{this.onMouseUp(o)}),this.eventListenerSubscriptions.touchstart=this.renderer.listen(this.element.nativeElement,"touchstart",o=>{this.onTouchStart(o)}),this.eventListenerSubscriptions.touchend=this.renderer.listen("document","touchend",o=>{this.onTouchEnd(o)}),this.eventListenerSubscriptions.touchcancel=this.renderer.listen("document","touchcancel",o=>{this.onTouchEnd(o)}),this.eventListenerSubscriptions.mouseenter=this.renderer.listen(this.element.nativeElement,"mouseenter",()=>{this.onMouseEnter()}),this.eventListenerSubscriptions.mouseleave=this.renderer.listen(this.element.nativeElement,"mouseleave",()=>{this.onMouseLeave()})}):!e&&t&&this.unsubscribeEventListeners()}onMouseDown(e){e.button===0&&(this.eventListenerSubscriptions.mousemove||(this.eventListenerSubscriptions.mousemove=this.renderer.listen("document","mousemove",t=>{this.pointerMove$.next({event:t,clientX:t.clientX,clientY:t.clientY})})),this.pointerDown$.next({event:e,clientX:e.clientX,clientY:e.clientY}))}onMouseUp(e){e.button===0&&(this.eventListenerSubscriptions.mousemove&&(this.eventListenerSubscriptions.mousemove(),delete this.eventListenerSubscriptions.mousemove),this.pointerUp$.next({event:e,clientX:e.clientX,clientY:e.clientY}))}onTouchStart(e){let t,o,r;if(this.touchStartLongPress&&(this.timeLongPress.timerBegin=Date.now(),o=!1,r=this.hasScrollbar(),t=this.getScrollPosition()),!this.eventListenerSubscriptions.touchmove){let a=sr(this.document,"contextmenu").subscribe(p=>{p.preventDefault()}),c=sr(this.document,"touchmove",{passive:!1}).subscribe(p=>{this.touchStartLongPress&&!o&&r&&(o=this.shouldBeginDrag(e,p,t)),(!this.touchStartLongPress||!r||o)&&(p.preventDefault(),this.pointerMove$.next({event:p,clientX:p.targetTouches[0].clientX,clientY:p.targetTouches[0].clientY}))});this.eventListenerSubscriptions.touchmove=()=>{a.unsubscribe(),c.unsubscribe()}}this.pointerDown$.next({event:e,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY})}onTouchEnd(e){this.eventListenerSubscriptions.touchmove&&(this.eventListenerSubscriptions.touchmove(),delete this.eventListenerSubscriptions.touchmove,this.touchStartLongPress&&this.enableScroll()),this.pointerUp$.next({event:e,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY})}onMouseEnter(){this.setCursor(this.dragCursor)}onMouseLeave(){this.setCursor("")}canDrag(){return this.dragAxis.x||this.dragAxis.y}setCursor(e){this.eventListenerSubscriptions.mousemove||this.renderer.setStyle(this.element.nativeElement,"cursor",e)}unsubscribeEventListeners(){Object.keys(this.eventListenerSubscriptions).forEach(e=>{this.eventListenerSubscriptions[e](),delete this.eventListenerSubscriptions[e]})}setElementStyles(e,t){Object.keys(t).forEach(o=>{this.renderer.setStyle(e,o,t[o])})}getScrollElement(){return this.scrollContainer?this.scrollContainer.elementRef.nativeElement:this.document.body}getScrollPosition(){return this.scrollContainer?{top:this.scrollContainer.elementRef.nativeElement.scrollTop,left:this.scrollContainer.elementRef.nativeElement.scrollLeft}:{top:window.pageYOffset||this.document.documentElement.scrollTop,left:window.pageXOffset||this.document.documentElement.scrollLeft}}shouldBeginDrag(e,t,o){let r=this.getScrollPosition(),a={top:Math.abs(r.top-o.top),left:Math.abs(r.left-o.left)},c=Math.abs(t.targetTouches[0].clientX-e.touches[0].clientX)-a.left,p=Math.abs(t.targetTouches[0].clientY-e.touches[0].clientY)-a.top,u=c+p,h=this.touchStartLongPress;return(u>h.delta||a.top>0||a.left>0)&&(this.timeLongPress.timerBegin=Date.now()),this.timeLongPress.timerEnd=Date.now(),this.timeLongPress.timerEnd-this.timeLongPress.timerBegin>=h.delay?(this.disableScroll(),!0):!1}enableScroll(){this.scrollContainer&&this.renderer.setStyle(this.scrollContainer.elementRef.nativeElement,"overflow",""),this.renderer.setStyle(this.document.body,"overflow","")}disableScroll(){this.scrollContainer&&this.renderer.setStyle(this.scrollContainer.elementRef.nativeElement,"overflow","hidden"),this.renderer.setStyle(this.document.body,"overflow","hidden")}hasScrollbar(){let e=this.getScrollElement(),t=e.scrollWidth>e.clientWidth,o=e.scrollHeight>e.clientHeight;return t||o}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=ft({type:n,selectors:[["","mwlDraggable",""]],inputs:{dropData:"dropData",dragAxis:"dragAxis",dragSnapGrid:"dragSnapGrid",ghostDragEnabled:"ghostDragEnabled",showOriginalElementWhileDragging:"showOriginalElementWhileDragging",validateDrag:"validateDrag",dragCursor:"dragCursor",dragActiveClass:"dragActiveClass",ghostElementAppendTo:"ghostElementAppendTo",ghostElementTemplate:"ghostElementTemplate",touchStartLongPress:"touchStartLongPress",autoScroll:"autoScroll"},outputs:{dragPointerDown:"dragPointerDown",dragStart:"dragStart",ghostElementCreated:"ghostElementCreated",dragging:"dragging",dragEnd:"dragEnd"},features:[bn]})}}return n})();var Bb=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=Ht({type:n})}static{this.\u0275inj=$t({})}}return n})();var M0=class{constructor(i){this.rawFile=i;let e=i instanceof HTMLInputElement?i.value:i;this[`_createFrom${typeof e=="string"?"FakePath":"Object"}`](e)}_createFromFakePath(i){this.lastModifiedDate=void 0,this.size=void 0,this.type=`like/${i.slice(i.lastIndexOf(".")+1).toLowerCase()}`,this.name=i.slice(i.lastIndexOf("/")+i.lastIndexOf("\\")+2)}_createFromObject(i){this.size=i.size,this.type=i.type,this.name=i.name}},BD=class{constructor(i,e,t){this.url="/",this.headers=[],this.withCredentials=!0,this.formData=[],this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.uploader=i,this.some=e,this.options=t,this.file=new M0(e),this._file=e,i.options&&(this.method=i.options.method||"POST",this.alias=i.options.itemAlias||"file"),this.url=i.options.url}upload(){try{this.uploader.uploadItem(this)}catch{this.uploader._onCompleteItem(this,"",0,{}),this.uploader._onErrorItem(this,"",0,{})}}cancel(){this.uploader.cancelItem(this)}remove(){this.uploader.removeFromQueue(this)}onBeforeUpload(){}onBuildForm(i){return{form:i}}onProgress(i){return{progress:i}}onSuccess(i,e,t){return{response:i,status:e,headers:t}}onError(i,e,t){return{response:i,status:e,headers:t}}onCancel(i,e,t){return{response:i,status:e,headers:t}}onComplete(i,e,t){return{response:i,status:e,headers:t}}_onBeforeUpload(){this.isReady=!0,this.isUploading=!0,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.onBeforeUpload()}_onBuildForm(i){this.onBuildForm(i)}_onProgress(i){this.progress=i,this.onProgress(i)}_onSuccess(i,e,t){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!0,this.isCancel=!1,this.isError=!1,this.progress=100,this.index=void 0,this.onSuccess(i,e,t)}_onError(i,e,t){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!1,this.isCancel=!1,this.isError=!0,this.progress=0,this.index=void 0,this.onError(i,e,t)}_onCancel(i,e,t){this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!0,this.isError=!1,this.progress=0,this.index=void 0,this.onCancel(i,e,t)}_onComplete(i,e,t){this.onComplete(i,e,t),this.uploader.options.removeAfterUpload&&this.remove()}_prepareToUploading(){this.index=this.index||++this.uploader._nextIndex,this.isReady=!0}},vee=(()=>{class n{static getMimeClass(e){let t="application";return e?.type&&this.mime_psd.indexOf(e.type)!==-1||e?.type?.match("image.*")?t="image":e?.type?.match("video.*")?t="video":e?.type?.match("audio.*")?t="audio":e?.type==="application/pdf"?t="pdf":e?.type&&this.mime_compress.indexOf(e.type)!==-1?t="compress":e?.type&&this.mime_doc.indexOf(e.type)!==-1?t="doc":e?.type&&this.mime_xsl.indexOf(e.type)!==-1?t="xls":e?.type&&this.mime_ppt.indexOf(e.type)!==-1&&(t="ppt"),t==="application"&&e?.name&&(t=this.fileTypeDetection(e.name)),t}static fileTypeDetection(e){let t={jpg:"image",jpeg:"image",tif:"image",psd:"image",bmp:"image",png:"image",nef:"image",tiff:"image",cr2:"image",dwg:"image",cdr:"image",ai:"image",indd:"image",pin:"image",cdp:"image",skp:"image",stp:"image","3dm":"image",mp3:"audio",wav:"audio",wma:"audio",mod:"audio",m4a:"audio",compress:"compress",zip:"compress",rar:"compress","7z":"compress",lz:"compress",z01:"compress",bz2:"compress",gz:"compress",pdf:"pdf",xls:"xls",xlsx:"xls",ods:"xls",mp4:"video",avi:"video",wmv:"video",mpg:"video",mts:"video",flv:"video","3gp":"video",vob:"video",m4v:"video",mpeg:"video",m2ts:"video",mov:"video",doc:"doc",docx:"doc",eps:"doc",txt:"doc",odt:"doc",rtf:"doc",ppt:"ppt",pptx:"ppt",pps:"ppt",ppsx:"ppt",odp:"ppt"},o=e.split(".");if(o.length<2)return"application";let r=o[o.length-1].toLowerCase();return t[r]===void 0?"application":t[r]}}return n.mime_doc=["application/msword","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-word.document.macroEnabled.12","application/vnd.ms-word.template.macroEnabled.12"],n.mime_xsl=["application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.ms-excel.sheet.macroEnabled.12","application/vnd.ms-excel.template.macroEnabled.12","application/vnd.ms-excel.addin.macroEnabled.12","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],n.mime_ppt=["application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.ms-powerpoint.addin.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],n.mime_psd=["image/photoshop","image/x-photoshop","image/psd","application/photoshop","application/psd","zz-application/zz-winassoc-psd"],n.mime_compress=["application/x-gtar","application/x-gcompress","application/compress","application/x-tar","application/x-rar-compressed","application/octet-stream","application/x-zip-compressed","application/zip-compressed","application/x-7z-compressed","application/gzip","application/x-bzip2"],n})();function Cee(n){return File&&n instanceof File}var $a=class{constructor(i){this.isUploading=!1,this.queue=[],this.progress=0,this._nextIndex=0,this.options={autoUpload:!1,isHTML5:!0,filters:[],removeAfterUpload:!1,disableMultipart:!1,formatDataFunction:e=>e._file,formatDataFunctionIsAsync:!1,url:""},this.setOptions(i),this.response=new ve}setOptions(i){this.options=Object.assign(this.options,i),this.authToken=this.options.authToken,this.authTokenHeader=this.options.authTokenHeader||"Authorization",this.autoUpload=this.options.autoUpload,this.options.filters?.unshift({name:"queueLimit",fn:this._queueLimitFilter}),this.options.maxFileSize&&this.options.filters?.unshift({name:"fileSize",fn:this._fileSizeFilter}),this.options.allowedFileType&&this.options.filters?.unshift({name:"fileType",fn:this._fileTypeFilter}),this.options.allowedMimeType&&this.options.filters?.unshift({name:"mimeType",fn:this._mimeTypeFilter});for(let e=0;e<this.queue.length;e++)this.queue[e].url=this.options.url}addToQueue(i,e,t){let o=e,r=[];for(let u of i)r.push(u);let a=this._getFilters(t),c=this.queue.length,p=[];r.map(u=>{o||(o=this.options);let h=new M0(u);if(this._isValidFile(h,a,o)){let _=new BD(this,u,o);p.push(_),this.queue.push(_),this._onAfterAddingFile(_)}else if(this._failFilterIndex){let _=a[this._failFilterIndex];this._onWhenAddingFileFailed(h,_,o)}}),this.queue.length!==c&&(this._onAfterAddingAll(p),this.progress=this._getTotalProgress()),this._render(),this.options.autoUpload&&this.uploadAll()}removeFromQueue(i){let e=this.getIndexOfItem(i),t=this.queue[e];t.isUploading&&t.cancel(),this.queue.splice(e,1),this.progress=this._getTotalProgress()}clearQueue(){for(;this.queue.length;)this.queue[0].remove();this.progress=0}uploadItem(i){let e=this.getIndexOfItem(i),t=this.queue[e],o=this.options.isHTML5?"_xhrTransport":"_iframeTransport";t._prepareToUploading(),!this.isUploading&&(this.isUploading=!0,this[o](t))}cancelItem(i){let e=this.getIndexOfItem(i),t=this.queue[e],o=this.options.isHTML5?t._xhr:t._form;t&&t.isUploading&&o.abort()}uploadAll(){let i=this.getNotUploadedItems().filter(e=>!e.isUploading);i.length&&(i.map(e=>e._prepareToUploading()),i[0].upload())}cancelAll(){this.getNotUploadedItems().map(e=>e.cancel())}isFile(i){return Cee(i)}isFileLikeObject(i){return i instanceof M0}getIndexOfItem(i){return typeof i=="number"?i:this.queue.indexOf(i)}getNotUploadedItems(){return this.queue.filter(i=>!i.isUploaded)}getReadyItems(){return this.queue.filter(i=>i.isReady&&!i.isUploading).sort((i,e)=>i.index-e.index)}onAfterAddingAll(i){return{fileItems:i}}onBuildItemForm(i,e){return{fileItem:i,form:e}}onAfterAddingFile(i){return{fileItem:i}}onWhenAddingFileFailed(i,e,t){return{item:i,filter:e,options:t}}onBeforeUploadItem(i){return{fileItem:i}}onProgressItem(i,e){return{fileItem:i,progress:e}}onProgressAll(i){return{progress:i}}onSuccessItem(i,e,t,o){return{item:i,response:e,status:t,headers:o}}onErrorItem(i,e,t,o){return{item:i,response:e,status:t,headers:o}}onCancelItem(i,e,t,o){return{item:i,response:e,status:t,headers:o}}onCompleteItem(i,e,t,o){return{item:i,response:e,status:t,headers:o}}onCompleteAll(){}_mimeTypeFilter(i){return!(i?.type&&this.options.allowedMimeType&&this.options.allowedMimeType?.indexOf(i.type)===-1)}_fileSizeFilter(i){return!(this.options.maxFileSize&&i.size>this.options.maxFileSize)}_fileTypeFilter(i){return!(this.options.allowedFileType&&this.options.allowedFileType.indexOf(vee.getMimeClass(i))===-1)}_onErrorItem(i,e,t,o){i._onError(e,t,o),this.onErrorItem(i,e,t,o)}_onCompleteItem(i,e,t,o){i._onComplete(e,t,o),this.onCompleteItem(i,e,t,o);let r=this.getReadyItems()[0];if(this.isUploading=!1,r){r.upload();return}this.onCompleteAll(),this.progress=this._getTotalProgress(),this._render()}_headersGetter(i){return e=>e?i[e.toLowerCase()]||void 0:i}_xhrTransport(i){let e=this,t=i._xhr=new XMLHttpRequest,o;if(this._onBeforeUploadItem(i),typeof i._file.size!="number")throw new TypeError("The file specified is no longer valid");if(this.options.disableMultipart)this.options.formatDataFunction&&(o=this.options.formatDataFunction(i));else{o=new FormData,this._onBuildItemForm(i,o);let r=()=>o.append(i.alias,i._file,i.file.name);this.options.parametersBeforeFiles||r(),this.options.additionalParameter!==void 0&&Object.keys(this.options.additionalParameter).forEach(a=>{let c=this.options.additionalParameter?.[a];typeof c=="string"&&c.indexOf("{{file_name}}")>=0&&i.file?.name&&(c=c.replace("{{file_name}}",i.file.name)),o.append(a,c)}),r&&this.options.parametersBeforeFiles&&r()}if(t.upload.onprogress=r=>{let a=Math.round(r.lengthComputable?r.loaded*100/r.total:0);this._onProgressItem(i,a)},t.onload=()=>{let r=this._parseHeaders(t.getAllResponseHeaders()),a=this._transformResponse(t.response,r),p=`_on${this._isSuccessCode(t.status)?"Success":"Error"}Item`;this[p](i,a,t.status,r),this._onCompleteItem(i,a,t.status,r)},t.onerror=()=>{let r=this._parseHeaders(t.getAllResponseHeaders()),a=this._transformResponse(t.response,r);this._onErrorItem(i,a,t.status,r),this._onCompleteItem(i,a,t.status,r)},t.onabort=()=>{let r=this._parseHeaders(t.getAllResponseHeaders()),a=this._transformResponse(t.response,r);this._onCancelItem(i,a,t.status,r),this._onCompleteItem(i,a,t.status,r)},i.method&&i.url&&t.open(i.method,i.url,!0),t.withCredentials=i.withCredentials,this.options.headers)for(let r of this.options.headers)t.setRequestHeader(r.name,r.value);if(i.headers.length)for(let r of i.headers)t.setRequestHeader(r.name,r.value);this.authToken&&this.authTokenHeader&&t.setRequestHeader(this.authTokenHeader,this.authToken),t.onreadystatechange=function(){t.readyState==XMLHttpRequest.DONE&&e.response.emit(t.responseText)},this.options.formatDataFunctionIsAsync?o.then(r=>t.send(JSON.stringify(r))):t.send(o),this._render()}_getTotalProgress(i=0){if(this.options.removeAfterUpload)return i;let e=this.getNotUploadedItems().length,t=e?this.queue.length-e:this.queue.length,o=100/this.queue.length,r=i*o/100;return Math.round(t*o+r)}_getFilters(i){if(!i)return this.options?.filters||[];if(Array.isArray(i))return i;if(typeof i=="string"){let e=i.match(/[^\s,]+/g);return this.options?.filters||[].filter(t=>e?.indexOf(t.name)!==-1)}return this.options?.filters||[]}_render(){}_queueLimitFilter(){return this.options.queueLimit===void 0||this.queue.length<this.options.queueLimit}_isValidFile(i,e,t){return this._failFilterIndex=-1,e.length?e.every(o=>(this._failFilterIndex&&this._failFilterIndex++,o.fn.call(this,i,t))):!0}_isSuccessCode(i){return i>=200&&i<300||i===304}_transformResponse(i,e){return i}_parseHeaders(i){let e={},t,o,r;return i&&i.split(`
`).map(a=>{r=a.indexOf(":"),t=a.slice(0,r).trim().toLowerCase(),o=a.slice(r+1).trim(),t&&(e[t]=e[t]?e[t]+", "+o:o)}),e}_onWhenAddingFileFailed(i,e,t){this.onWhenAddingFileFailed(i,e,t)}_onAfterAddingFile(i){this.onAfterAddingFile(i)}_onAfterAddingAll(i){this.onAfterAddingAll(i)}_onBeforeUploadItem(i){i._onBeforeUpload(),this.onBeforeUploadItem(i)}_onBuildItemForm(i,e){i._onBuildForm(e),this.onBuildItemForm(i,e)}_onProgressItem(i,e){let t=this._getTotalProgress(e);this.progress=t,i._onProgress(e),this.onProgressItem(i,e),this.onProgressAll(t),this._render()}_onSuccessItem(i,e,t,o){i._onSuccess(e,t,o),this.onSuccessItem(i,e,t,o)}_onCancelItem(i,e,t,o){i._onCancel(e,t,o),this.onCancelItem(i,e,t,o)}};var Ac=(()=>{class n{constructor(e){this.onFileSelected=new ve,this.element=e}getOptions(){return this.uploader?.options}getFilters(){return""}isEmptyAfterSelection(){return!!this.element.nativeElement.attributes.multiple}onChange(){let e=this.element.nativeElement.files,t=this.getOptions(),o=this.getFilters();this.uploader?.addToQueue(e,t,o),this.onFileSelected.emit(e),this.isEmptyAfterSelection()&&(this.element.nativeElement.value="")}}return n.\u0275fac=function(e){return new(e||n)(ot(Zt))},n.\u0275dir=ft({type:n,selectors:[["","ng2FileSelect",""]],hostBindings:function(e,t){e&1&&g("change",function(){return t.onChange()})},inputs:{uploader:"uploader"},outputs:{onFileSelected:"onFileSelected"},standalone:!1}),n})(),sl=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=Ht({type:n}),n.\u0275inj=$t({imports:[ne]}),n})();var du=class{visible;error;clear;constructor(i,e,t=!1){this.visible=i,this.error=e,this.clear=t}},no=(()=>{class n{state=new an(new du(!1));constructor(){}setError(e){this.state.next(new du(!1,e.error))}clear(){this.state.next(new du(!1,null,!0))}activate(){this.state.next(new du(!0))}deactivate(){this.state.next(new du(!1))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function bee(n,i){n&1&&(s(0,"div",1),R(1,"mat-spinner",3),l())}function xee(n,i){if(n&1){let e=z();s(0,"div",2)(1,"div",4)(2,"mat-icon"),d(3,"error_outline"),l()(),s(4,"div"),d(5),l(),s(6,"div")(7,"button",5),g("click",function(){k(e);let o=v(2);return T(o.refresh())}),s(8,"mat-icon"),d(9,"refresh"),l()(),s(10,"button",6)(11,"mat-icon"),d(12,"home"),l()()()()}if(n&2){let e,t=v(2);m(5),ee("Error occurred: ",(e=t.error())==null?null:e.message)}}function yee(n,i){if(n&1&&(s(0,"div",0),A(1,bee,2,0,"div",1),A(2,xee,13,1,"div",2),l()),n&2){let e=v();m(),O(e.visible()&&!e.error()?1:-1),m(),O(e.error()?2:-1)}}var xm=(()=>{class n{progressService=f(no);router=f(ht);visible=ae(!1);error=ae(null);routerSubscription;ngOnInit(){this.progressService.state.subscribe(e=>{this.visible.set(e.visible),e.error&&!this.error()&&this.error.set(e.error),e.clear&&this.error.set(null)}),this.routerSubscription=this.router.events.subscribe(()=>{this.progressService.clear()})}refresh(){this.router.navigateByUrl(this.router.url)}ngOnDestroy(){this.routerSubscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-progress"]],decls:1,vars:1,consts:[[1,"overlay"],[1,"loading-spinner"],[1,"error-state"],["color","primary"],[1,"error-icon"],["mat-button","","matTooltip","Refresh page","matTooltipClass","custom-tooltip",3,"click"],["mat-button","","routerLink","/","matTooltip","Go to home","matTooltipClass","custom-tooltip"]],template:function(t,o){t&1&&A(0,yee,3,2,"div",0),t&2&&O(o.visible()||o.error()?0:-1)},dependencies:[ne,pn,li,ie,de,W,pe,wt,It,vn],styles:[".overlay[_ngcontent-%COMP%]{position:fixed;width:100%;height:100%;inset:0;background-color:color-mix(in srgb,var(--mat-sys-shadow) 50%,transparent);z-index:2000}.loading-spinner[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.error-state[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{text-align:center}.error-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px}"],changeDetection:0})}return n})();var zb=(()=>{class n{document;router=f(ht);controllerService=f(Je);progressService=f(no);constructor(e){this.document=e}ngOnInit(){this.progressService.activate(),setTimeout(()=>{let e;parseInt(this.document.location.port,10)?e=parseInt(this.document.location.port,10):this.document.location.protocol=="https:"?e=443:e=80,this.controllerService.getLocalController(this.document.location.hostname,e).then(t=>{this.router.navigate(["/controller",t.id,"projects"]),this.progressService.deactivate()})},100)}static \u0275fac=function(t){return new(t||n)(ot(Xi))};static \u0275cmp=F({type:n,selectors:[["app-bundled-controller-finder"]],decls:1,vars:0,template:function(t,o){t&1&&R(0,"app-progress")},dependencies:[xm],encapsulation:2,changeDetection:0})}return n})();var See=["mat-menu-item",""],wee=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],Mee=["mat-icon, [matMenuItemIcon]","*"];function kee(n,i){n&1&&(ei(),s(0,"svg",2),R(1,"polygon",3),l())}var Tee=["*"];function Eee(n,i){if(n&1){let e=z();vo(0,"div",0),Jv("click",function(){k(e);let o=v();return T(o.closed.emit("click"))})("animationstart",function(o){k(e);let r=v();return T(r._onAnimationStart(o.animationName))})("animationend",function(o){k(e);let r=v();return T(r._onAnimationDone(o.animationName))})("animationcancel",function(o){k(e);let r=v();return T(r._onAnimationDone(o.animationName))}),vo(1,"div",1),on(2),wo()()}if(n&2){let e=v();er(e._classList),Be("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),Wo("id",e.panelId),qt("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null)}}var jD=new cn("MAT_MENU_PANEL"),Ze=(()=>{class n{_elementRef=f(Zt);_document=f(Xi);_focusMonitor=f(Aa);_parentMenu=f(jD,{optional:!0});_changeDetectorRef=f(Q);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new He;_focused=new He;_highlighted=!1;_triggersSubmenu=!1;constructor(){f(cr).load(ia),this._parentMenu?.addItem?.(this)}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){let e=this._elementRef.nativeElement.cloneNode(!0),t=e.querySelectorAll("mat-icon, .material-icons");for(let o=0;o<t.length;o++)t[o].remove();return e.textContent?.trim()||""}_setHighlighted(e){this._highlighted=e,this._changeDetectorRef.markForCheck()}_setTriggersSubmenu(e){this._triggersSubmenu=e,this._changeDetectorRef.markForCheck()}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(t,o){t&1&&g("click",function(a){return o._checkDisabled(a)})("mouseenter",function(){return o._handleMouseEnter()}),t&2&&(qt("role",o.role)("tabindex",o._getTabIndex())("aria-disabled",o.disabled)("disabled",o.disabled||null),Be("mat-mdc-menu-item-highlighted",o._highlighted)("mat-mdc-menu-item-submenu-trigger",o._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",Ct],disableRipple:[2,"disableRipple","disableRipple",Ct]},exportAs:["matMenuItem"],attrs:See,ngContentSelectors:Mee,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(t,o){t&1&&(ii(wee),on(0),s(1,"span",0),on(2,1),l(),R(3,"div",1),A(4,kee,2,0,":svg:svg",2)),t&2&&(m(3),C("matRippleDisabled",o.disableRipple||o.disabled)("matRippleTrigger",o._getHostElement()),m(),O(o._triggersSubmenu?4:-1))},dependencies:[Us],encapsulation:2,changeDetection:0})}return n})();var JR=new cn("MatMenuContent"),e8=(()=>{class n{_template=f(Oo);_appRef=f(TO);_injector=f(Jo);_viewContainerRef=f(oo);_document=f(Xi);_changeDetectorRef=f(Q);_portal;_outlet;_attached=new He;constructor(){}attach(e={}){this._portal||(this._portal=new pd(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new e4(this._document.createElement("div"),this._appRef,this._injector));let t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next()}detach(){this._portal?.isAttached&&this._portal.detach()}ngOnDestroy(){this.detach(),this._outlet?.dispose()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["ng-template","matMenuContent",""]],features:[fn([{provide:JR,useExisting:n}])]})}return n})(),Dee=new cn("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),zD="_mat-menu-enter",jb="_mat-menu-exit",Qn=(()=>{class n{_elementRef=f(Zt);_changeDetectorRef=f(Q);_injector=f(Jo);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=qo();_allItems;_directDescendantItems=new Il;_classList={};_panelAnimationState="void";_animationDone=new He;_isAnimating=ae(!1);parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger=!1;hasBackdrop;set panelClass(e){let t=this._previousPanelClass,o=K({},this._classList);t&&t.length&&t.split(" ").forEach(r=>{o[r]=!1}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(r=>{o[r]=!0}),this._elementRef.nativeElement.className=""),this._classList=o}_previousPanelClass;get classList(){return this.panelClass}set classList(e){this.panelClass=e}closed=new ve;close=this.closed;panelId=f(Mo).getId("mat-menu-panel-");constructor(){let e=f(Dee);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new Gd(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(pi(this._directDescendantItems),Un(e=>Hn(...e.map(t=>t._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{let t=this._keyManager;if(this._panelAnimationState==="enter"&&t.activeItem?._hasFocus()){let o=e.toArray(),r=Math.max(0,Math.min(o.length-1,t.activeItemIndex||0));o[r]&&!o[r].disabled?t.setActiveItem(r):t.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(pi(this._directDescendantItems),Un(t=>Hn(...t.map(o=>o._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,o=this._keyManager;switch(t){case 27:fa(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(t===38||t===40)&&o.setFocusOrigin("keyboard"),o.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=Xa(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let o=this._keyManager;o.setFocusOrigin(e).setFirstItemActive(),!o.activeItem&&t&&t.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=it(K({},this._classList),{"mat-menu-before":e==="before","mat-menu-after":e==="after","mat-menu-above":t==="above","mat-menu-below":t==="below"}),this._changeDetectorRef.markForCheck()}_onAnimationDone(e){let t=e===jb;(t||e===zD)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(!1))}_onAnimationStart(e){(e===zD||e===jb)&&this._isAnimating.set(!0)}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(this._keyManager.activeItemIndex===0){let t=this._resolvePanel();t&&(t.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(jb),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?zD:jb)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(pi(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(t=>t._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-menu"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,JR,5)(r,Ze,5)(r,Ze,4),t&2){let a;mt(a=pt())&&(o.lazyContent=a.first),mt(a=pt())&&(o._allItems=a),mt(a=pt())&&(o.items=a)}},viewQuery:function(t,o){if(t&1&&xn(Oo,5),t&2){let r;mt(r=pt())&&(o.templateRef=r.first)}},hostVars:3,hostBindings:function(t,o){t&2&&qt("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",Ct],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:Ct(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[fn([{provide:jD,useExisting:n}])],ngContentSelectors:Tee,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(t,o){t&1&&(ii(),ju(0,Eee,3,12,"ng-template"))},styles:[`mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{border-top-color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}
`],encapsulation:2,changeDetection:0})}return n})(),Pee=new cn("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let n=f(Jo);return()=>pC(n)}});var Kh=new WeakMap,Iee=(()=>{class n{_canHaveBackdrop;_element=f(Zt);_viewContainerRef=f(oo);_menuItemInstance=f(Ze,{optional:!0,self:!0});_dir=f(Ka,{optional:!0});_focusMonitor=f(Aa);_ngZone=f(Vi);_injector=f(Jo);_scrollStrategy=f(Pee);_changeDetectorRef=f(Q);_animationsDisabled=qo();_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=So.EMPTY;_menuCloseSubscription=So.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_openedBy=void 0;get _menu(){return this._menuInternal}set _menu(e){e!==this._menuInternal&&(this._menuInternal=e,this._menuCloseSubscription.unsubscribe(),e&&(this._parentMaterialMenu,this._menuCloseSubscription=e.close.subscribe(t=>{this._destroyMenu(t),(t==="click"||t==="tab")&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(t)})),this._menuItemInstance?._setTriggersSubmenu(this._triggersSubmenu()))}_menuInternal=null;constructor(e){this._canHaveBackdrop=e;let t=f(jD,{optional:!0});this._parentMaterialMenu=t instanceof Qn?t:void 0}ngOnDestroy(){this._menu&&this._ownsMenu(this._menu)&&Kh.delete(this._menu),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this._menu)}_closeMenu(){this._menu?.close.emit()}_openMenu(e){if(this._triggerIsAriaDisabled())return;let t=this._menu;if(this._menuOpen||!t)return;this._pendingRemoval?.unsubscribe();let o=Kh.get(t);Kh.set(t,this),o&&o!==this&&o._closeMenu();let r=this._createOverlay(t),a=r.getConfig(),c=a.positionStrategy;this._setPosition(t,c),this._canHaveBackdrop?a.hasBackdrop=t.hasBackdrop==null?!this._triggersSubmenu():t.hasBackdrop:a.hasBackdrop=t.hasBackdrop??!1,r.hasAttached()||(r.attach(this._getPortal(t)),t.lazyContent?.attach(this.menuData)),this._closingActionsSubscription=this._menuClosingActions().subscribe(()=>this._closeMenu()),t.parentMenu=this._triggersSubmenu()?this._parentMaterialMenu:void 0,t.direction=this.dir,e&&t.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0),t instanceof Qn&&(t._setIsOpen(!0),t._directDescendantItems.changes.pipe(tt(t.close)).subscribe(()=>{c.withLockedPosition(!1).reapplyLastPosition(),c.withLockedPosition(!0)}))}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._element,e,t):this._element.nativeElement.focus(t)}_destroyMenu(e){let t=this._overlayRef,o=this._menu;!t||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),o instanceof Qn&&this._ownsMenu(o)?(this._pendingRemoval=o._animationDone.pipe(Ao(1)).subscribe(()=>{t.detach(),Kh.has(o)||o.lazyContent?.detach()}),o._setIsOpen(!1)):(t.detach(),o?.lazyContent?.detach()),o&&this._ownsMenu(o)&&Kh.delete(o),this.restoreFocus&&(e==="keydown"||!this._openedBy||!this._triggersSubmenu())&&this.focus(this._openedBy),this._openedBy=void 0,this._setIsMenuOpen(!1))}_setIsMenuOpen(e){e!==this._menuOpen&&(this._menuOpen=e,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this._triggersSubmenu()&&this._menuItemInstance._setHighlighted(e),this._changeDetectorRef.markForCheck())}_createOverlay(e){if(!this._overlayRef){let t=this._getOverlayConfig(e);this._subscribeToPositions(e,t.positionStrategy),this._overlayRef=fC(this._injector,t),this._overlayRef.keydownEvents().subscribe(o=>{this._menu instanceof Qn&&this._menu._handleKeydown(o)})}return this._overlayRef}_getOverlayConfig(e){return new uC({positionStrategy:hC(this._injector,this._getOverlayOrigin()).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:e.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:e.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir||"ltr",disableAnimations:this._animationsDisabled})}_subscribeToPositions(e,t){e.setPositionClasses&&t.positionChanges.subscribe(o=>{this._ngZone.run(()=>{let r=o.connectionPair.overlayX==="start"?"after":"before",a=o.connectionPair.overlayY==="top"?"below":"above";e.setPositionClasses(r,a)})})}_setPosition(e,t){let[o,r]=e.xPosition==="before"?["end","start"]:["start","end"],[a,c]=e.yPosition==="above"?["bottom","top"]:["top","bottom"],[p,u]=[a,c],[h,_]=[o,r],S=0;if(this._triggersSubmenu()){if(_=o=e.xPosition==="before"?"start":"end",r=h=o==="end"?"start":"end",this._parentMaterialMenu){if(this._parentInnerPadding==null){let x=this._parentMaterialMenu.items.first;this._parentInnerPadding=x?x._getHostElement().offsetTop:0}S=a==="bottom"?this._parentInnerPadding:-this._parentInnerPadding}}else e.overlapTrigger||(p=a==="top"?"bottom":"top",u=c==="top"?"bottom":"top");t.withPositions([{originX:o,originY:p,overlayX:h,overlayY:a,offsetY:S},{originX:r,originY:p,overlayX:_,overlayY:a,offsetY:S},{originX:o,originY:u,overlayX:h,overlayY:c,offsetY:-S},{originX:r,originY:u,overlayX:_,overlayY:c,offsetY:-S}])}_menuClosingActions(){let e=this._getOutsideClickStream(this._overlayRef),t=this._overlayRef.detachments(),o=this._parentMaterialMenu?this._parentMaterialMenu.closed:Nn(),r=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(ai(a=>this._menuOpen&&a!==this._menuItemInstance)):Nn();return Hn(e,o,r,t)}_getPortal(e){return(!this._portal||this._portal.templateRef!==e.templateRef)&&(this._portal=new pd(e.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(e){return Kh.get(e)===this}_triggerIsAriaDisabled(){return Ct(this._element.nativeElement.getAttribute("aria-disabled"))}static \u0275fac=function(t){MO()};static \u0275dir=ft({type:n})}return n})(),Fn=(()=>{class n extends Iee{_cleanupTouchstart;_hoverSubscription=So.EMPTY;get _deprecatedMatMenuTriggerFor(){return this.menu}set _deprecatedMatMenuTriggerFor(e){this.menu=e}get menu(){return this._menu}set menu(e){this._menu=e}menuData;restoreFocus=!0;menuOpened=new ve;onMenuOpen=this.menuOpened;menuClosed=new ve;onMenuClose=this.menuClosed;constructor(){super(!0);let e=f(Si);this._cleanupTouchstart=e.listen(this._element.nativeElement,"touchstart",t=>{dC(t)||(this._openedBy="touch")},{passive:!0})}triggersSubmenu(){return super._triggersSubmenu()}toggleMenu(){return this.menuOpen?this.closeMenu():this.openMenu()}openMenu(){this._openMenu(!0)}closeMenu(){this._closeMenu()}updatePosition(){this._overlayRef?.updatePosition()}ngAfterContentInit(){this._handleHover()}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTouchstart(),this._hoverSubscription.unsubscribe()}_getOverlayOrigin(){return this._element}_getOutsideClickStream(e){return e.backdropClick()}_handleMousedown(e){cC(e)||(this._openedBy=e.button===0?"mouse":void 0,this.triggersSubmenu()&&e.preventDefault())}_handleKeydown(e){let t=e.keyCode;(t===13||t===32)&&(this._openedBy="keyboard"),this.triggersSubmenu()&&(t===39&&this.dir==="ltr"||t===37&&this.dir==="rtl")&&(this._openedBy="keyboard",this.openMenu())}_handleClick(e){this.triggersSubmenu()?(e.stopPropagation(),this.openMenu()):this.toggleMenu()}_handleHover(){this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().subscribe(e=>{e===this._menuItemInstance&&!e.disabled&&this._parentMaterialMenu?._panelAnimationState!=="void"&&(this._openedBy="mouse",this._openMenu(!1))}))}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(t,o){t&1&&g("click",function(a){return o._handleClick(a)})("mousedown",function(a){return o._handleMousedown(a)})("keydown",function(a){return o._handleKeydown(a)}),t&2&&qt("aria-haspopup",o.menu?"menu":null)("aria-expanded",o.menuOpen)("aria-controls",o.menuOpen?o.menu==null?null:o.menu.panelId:null)},inputs:{_deprecatedMatMenuTriggerFor:[0,"mat-menu-trigger-for","_deprecatedMatMenuTriggerFor"],menu:[0,"matMenuTriggerFor","menu"],menuData:[0,"matMenuTriggerData","menuData"],restoreFocus:[0,"matMenuTriggerRestoreFocus","restoreFocus"]},outputs:{menuOpened:"menuOpened",onMenuOpen:"onMenuOpen",menuClosed:"menuClosed",onMenuClose:"onMenuClose"},exportAs:["matMenuTrigger"],features:[si]})}return n})();var Ge=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[mc,Qu,hi,md]})}return n})();var Aee=[[["caption"]],[["colgroup"],["col"]],"*"],Oee=["caption","colgroup, col","*"];function Nee(n,i){n&1&&on(0,2)}function Fee(n,i){n&1&&(s(0,"thead",0),ro(1,1),l(),s(2,"tbody",2),ro(3,3)(4,4),l(),s(5,"tfoot",0),ro(6,5),l())}function Ree(n,i){n&1&&ro(0,1)(1,3)(2,4)(3,5)}var Sn=(()=>{class n extends JE{stickyCssClass="mat-mdc-table-sticky";needsPositionStickyOnElement=!1;static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275cmp=F({type:n,selectors:[["mat-table"],["table","mat-table",""]],hostAttrs:[1,"mat-mdc-table","mdc-data-table__table"],hostVars:2,hostBindings:function(t,o){t&2&&Be("mat-table-fixed-layout",o.fixedLayout)},exportAs:["matTable"],features:[fn([{provide:JE,useExisting:n},{provide:Vl,useExisting:n},{provide:h0,useValue:null}]),si],ngContentSelectors:Oee,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["role","rowgroup",1,"mdc-data-table__content"],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,o){t&1&&(ii(Aee),on(0),on(1,1),A(2,Nee,1,0),A(3,Fee,7,0)(4,Ree,4,0)),t&2&&(m(2),O(o._isServer?2:-1),m(),O(o._isNativeHtmlTable?3:4))},dependencies:[KE,XE,ZE,YE],styles:[`.mat-mdc-table-sticky{position:sticky !important}mat-table{display:block}mat-header-row{min-height:var(--mat-table-header-container-height, 56px)}mat-row{min-height:var(--mat-table-row-item-container-height, 52px)}mat-footer-row{min-height:var(--mat-table-footer-container-height, 52px)}mat-row,mat-header-row,mat-footer-row{display:flex;border-width:0;border-bottom-width:1px;border-style:solid;align-items:center;box-sizing:border-box}mat-cell:first-of-type,mat-header-cell:first-of-type,mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] mat-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}mat-cell:last-of-type,mat-header-cell:last-of-type,mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] mat-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}mat-cell,mat-header-cell,mat-footer-cell{flex:1;display:flex;align-items:center;overflow:hidden;word-wrap:break-word;min-height:inherit}.mat-mdc-table{min-width:100%;border:0;border-spacing:0;table-layout:auto;white-space:normal;background-color:var(--mat-table-background-color, var(--mat-sys-surface))}.mat-table-fixed-layout{table-layout:fixed}.mdc-data-table__cell{box-sizing:border-box;overflow:hidden;text-align:start;text-overflow:ellipsis}.mdc-data-table__cell,.mdc-data-table__header-cell{padding:0 16px}.mat-mdc-header-row{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mat-table-header-container-height, 56px);color:var(--mat-table-header-headline-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-table-header-headline-font, var(--mat-sys-title-small-font, Roboto, sans-serif));line-height:var(--mat-table-header-headline-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-table-header-headline-size, var(--mat-sys-title-small-size, 14px));font-weight:var(--mat-table-header-headline-weight, var(--mat-sys-title-small-weight, 500))}.mat-mdc-row{height:var(--mat-table-row-item-container-height, 52px);color:var(--mat-table-row-item-label-text-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)))}.mat-mdc-row,.mdc-data-table__content{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-table-row-item-label-text-font, var(--mat-sys-body-medium-font, Roboto, sans-serif));line-height:var(--mat-table-row-item-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-table-row-item-label-text-size, var(--mat-sys-body-medium-size, 14px));font-weight:var(--mat-table-row-item-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-footer-row{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mat-table-footer-container-height, 52px);color:var(--mat-table-row-item-label-text-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-table-footer-supporting-text-font, var(--mat-sys-body-medium-font, Roboto, sans-serif));line-height:var(--mat-table-footer-supporting-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-table-footer-supporting-text-size, var(--mat-sys-body-medium-size, 14px));font-weight:var(--mat-table-footer-supporting-text-weight, var(--mat-sys-body-medium-weight));letter-spacing:var(--mat-table-footer-supporting-text-tracking, var(--mat-sys-body-medium-tracking))}.mat-mdc-header-cell{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, 0.12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid;letter-spacing:var(--mat-table-header-headline-tracking, var(--mat-sys-title-small-tracking));font-weight:inherit;line-height:inherit;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;outline:none;text-align:start}.mdc-data-table__row:last-child>.mat-mdc-header-cell{border-bottom:none}.mat-mdc-cell{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, 0.12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid;letter-spacing:var(--mat-table-row-item-label-text-tracking, var(--mat-sys-body-medium-tracking));line-height:inherit}.mdc-data-table__row:last-child>.mat-mdc-cell{border-bottom:none}.mat-mdc-footer-cell{letter-spacing:var(--mat-table-row-item-label-text-tracking, var(--mat-sys-body-medium-tracking))}mat-row.mat-mdc-row,mat-header-row.mat-mdc-header-row,mat-footer-row.mat-mdc-footer-row{border-bottom:none}.mat-mdc-table tbody,.mat-mdc-table tfoot,.mat-mdc-table thead,.mat-mdc-cell,.mat-mdc-footer-cell,.mat-mdc-header-row,.mat-mdc-row,.mat-mdc-footer-row,.mat-mdc-table .mat-mdc-header-cell{background:inherit}.mat-mdc-table mat-header-row.mat-mdc-header-row,.mat-mdc-table mat-row.mat-mdc-row,.mat-mdc-table mat-footer-row.mat-mdc-footer-cell{height:unset}mat-header-cell.mat-mdc-header-cell,mat-cell.mat-mdc-cell,mat-footer-cell.mat-mdc-footer-cell{align-self:stretch}
`],encapsulation:2})}return n})(),wn=(()=>{class n extends hb{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matCellDef",""]],features:[fn([{provide:hb,useExisting:n}]),si]})}return n})(),Mn=(()=>{class n extends fb{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matHeaderCellDef",""]],features:[fn([{provide:fb,useExisting:n}]),si]})}return n})();var kn=(()=>{class n extends Cm{get name(){return this._name}set name(e){this._setNameInput(e)}_updateColumnCssClassName(){super._updateColumnCssClassName(),this._columnCssClassName.push(`mat-column-${this.cssClassFriendlyName}`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matColumnDef",""]],inputs:{name:[0,"matColumnDef","name"]},features:[fn([{provide:Cm,useExisting:n}]),si]})}return n})(),Tn=(()=>{class n extends $6{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["mat-header-cell"],["th","mat-header-cell",""]],hostAttrs:["role","columnheader",1,"mat-mdc-header-cell","mdc-data-table__header-cell"],features:[si]})}return n})();var En=(()=>{class n extends H6{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["mat-cell"],["td","mat-cell",""]],hostAttrs:[1,"mat-mdc-cell","mdc-data-table__cell"],features:[si]})}return n})();var Dn=(()=>{class n extends f0{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matHeaderRowDef",""]],inputs:{columns:[0,"matHeaderRowDef","columns"],sticky:[2,"matHeaderRowDefSticky","sticky",Ct]},features:[fn([{provide:f0,useExisting:n}]),si]})}return n})();var Pn=(()=>{class n extends gb{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matRowDef",""]],inputs:{columns:[0,"matRowDefColumns","columns"],when:[0,"matRowDefWhen","when"]},features:[fn([{provide:gb,useExisting:n}]),si]})}return n})(),In=(()=>{class n extends qE{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275cmp=F({type:n,selectors:[["mat-header-row"],["tr","mat-header-row",""]],hostAttrs:["role","row",1,"mat-mdc-header-row","mdc-data-table__header-row"],exportAs:["matHeaderRow"],features:[fn([{provide:qE,useExisting:n}]),si],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,o){t&1&&ro(0,0)},dependencies:[nu],encapsulation:2})}return n})();var An=(()=>{class n extends QE{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275cmp=F({type:n,selectors:[["mat-row"],["tr","mat-row",""]],hostAttrs:["role","row",1,"mat-mdc-row","mdc-data-table__row"],exportAs:["matRow"],features:[fn([{provide:QE,useExisting:n}]),si],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,o){t&1&&ro(0,0)},dependencies:[nu],encapsulation:2})}return n})();var hn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[_b,hi]})}return n})(),Lee=9007199254740991,pr=class extends cd{_data;_renderData=new an([]);_filter=new an("");_internalPageChanges=new He;_renderChangesSubscription=null;filteredData;get data(){return this._data.value}set data(i){i=Array.isArray(i)?i:[],this._data.next(i),this._renderChangesSubscription||this._filterData(i)}get filter(){return this._filter.value}set filter(i){this._filter.next(i),this._renderChangesSubscription||this._filterData(this.data)}get sort(){return this._sort}set sort(i){this._sort=i,this._updateChangeSubscription()}_sort;get paginator(){return this._paginator}set paginator(i){this._paginator=i,this._updateChangeSubscription()}_paginator;sortingDataAccessor=(i,e)=>{let t=i[e];if(WO(t)){let o=Number(t);return o<Lee?o:t}return t};sortData=(i,e)=>{let t=e.active,o=e.direction;return!t||o==""?i:i.sort((r,a)=>{let c=this.sortingDataAccessor(r,t),p=this.sortingDataAccessor(a,t),u=typeof c,h=typeof p;u!==h&&(u==="number"&&(c+=""),h==="number"&&(p+=""));let _=0;return c!=null&&p!=null?c>p?_=1:c<p&&(_=-1):c!=null?_=1:p!=null&&(_=-1),_*(o=="asc"?1:-1)})};filterPredicate=(i,e)=>{let t=e.trim().toLowerCase();return Object.values(i).some(o=>`${o}`.toLowerCase().includes(t))};constructor(i=[]){super(),this._data=new an(i),this._updateChangeSubscription()}_updateChangeSubscription(){let i=this._sort?Hn(this._sort.sortChange,this._sort.initialized):Nn(null),e=this._paginator?Hn(this._paginator.page,this._internalPageChanges,this._paginator.initialized):Nn(null),t=this._data,o=Pr([t,this._filter]).pipe(Lt(([c])=>this._filterData(c))),r=Pr([o,i]).pipe(Lt(([c])=>this._orderData(c))),a=Pr([r,e]).pipe(Lt(([c])=>this._pageData(c)));this._renderChangesSubscription?.unsubscribe(),this._renderChangesSubscription=a.subscribe(c=>this._renderData.next(c))}_filterData(i){return this.filteredData=this.filter==null||this.filter===""?i:i.filter(e=>this.filterPredicate(e,this.filter)),this.paginator&&this._updatePaginator(this.filteredData.length),this.filteredData}_orderData(i){return this.sort?this.sortData(i.slice(),this.sort):i}_pageData(i){if(!this.paginator)return i;let e=this.paginator.pageIndex*this.paginator.pageSize;return i.slice(e,e+this.paginator.pageSize)}_updatePaginator(i){Promise.resolve().then(()=>{let e=this.paginator;if(e&&(e.length=i,e.pageIndex>0)){let t=Math.ceil(e.length/e.pageSize)-1||0,o=Math.min(e.pageIndex,t);o!==e.pageIndex&&(e.pageIndex=o,this._internalPageChanges.next())}})}connect(){return this._renderChangesSubscription||this._updateChangeSubscription(),this._renderData}disconnect(){this._renderChangesSubscription?.unsubscribe(),this._renderChangesSubscription=null}};var Vee=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(t,o){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}
`],encapsulation:2,changeDetection:0})}return n})(),Bee={passive:!0},t8=(()=>{class n{_platform=f($s);_ngZone=f(Vi);_renderer=f(sd).createRenderer(null,null);_styleLoader=f(cr);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return Lu;this._styleLoader.load(Vee);let t=Al(e),o=this._monitoredElements.get(t);if(o)return o.subject;let r=new He,a="cdk-text-field-autofilled",c=u=>{u.animationName==="cdk-text-field-autofill-start"&&!t.classList.contains(a)?(t.classList.add(a),this._ngZone.run(()=>r.next({target:u.target,isAutofilled:!0}))):u.animationName==="cdk-text-field-autofill-end"&&t.classList.contains(a)&&(t.classList.remove(a),this._ngZone.run(()=>r.next({target:u.target,isAutofilled:!1})))},p=this._ngZone.runOutsideAngular(()=>(t.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(t,"animationstart",c,Bee)));return this._monitoredElements.set(t,{subject:r,unlisten:p}),r}stopMonitoring(e){let t=Al(e),o=this._monitoredElements.get(t);o&&(o.unlisten(),o.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}ngOnDestroy(){this._monitoredElements.forEach((e,t)=>this.stopMonitoring(t))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var n8=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({})}return n})();var i8=new cn("MAT_INPUT_VALUE_ACCESSOR");var zee=["button","checkbox","file","hidden","image","radio","range","reset","submit"],jee=new cn("MAT_INPUT_CONFIG"),Ee=(()=>{class n{_elementRef=f(Zt);_platform=f($s);ngControl=f(_C,{optional:!0,self:!0});_autofillMonitor=f(t8);_ngZone=f(Vi);_formField=f(Zu,{optional:!0});_renderer=f(Si);_uid=f(Mo).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder=null;_errorStateTracker;_config=f(jee,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer=!1;_isNativeSelect=!1;_isTextarea=!1;_isInFormField=!1;focused=!1;stateChanges=new He;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=wC(e),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(e){this._id=e||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(Ue.required)??!1}set required(e){this._required=wC(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&mk().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(e){e!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(e):this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=wC(e)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>mk().has(e));constructor(){let e=f(Gn,{optional:!0}),t=f(Rt,{optional:!0}),o=f(fd),r=f(i8,{optional:!0,self:!0}),a=this._elementRef.nativeElement,c=a.nodeName.toLowerCase();r?kO(r.value)?this._signalBasedValueAccessor=r:this._inputValueAccessor=r:this._inputValueAccessor=a,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(a,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new TC(o,this.ngControl,t,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=c==="select",this._isTextarea=c==="textarea",this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=a.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&ha(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){if(e!==this.focused){if(!this._isNativeSelect&&e&&this.disabled&&this.disabledInteractive){let t=this._elementRef.nativeElement;t.type==="number"?(t.type="text",t.setSelectionRange(0,0),t.type="number"):t.setSelectionRange(0,0)}this.focused=e,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let t=this._elementRef.nativeElement;this._previousPlaceholder=e,e?t.setAttribute("placeholder",e):t.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){zee.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}_iOSKeyupListener=e=>{let t=e.target;!t.value&&t.selectionStart===0&&t.selectionEnd===0&&(t.setSelectionRange(1,1),t.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(t,o){t&1&&g("focus",function(){return o._focusChanged(!0)})("blur",function(){return o._focusChanged(!1)})("input",function(){return o._onInput()}),t&2&&(Wo("id",o.id)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),qt("name",o.name||null)("readonly",o._getReadonlyAttribute())("aria-disabled",o.disabled&&o.disabledInteractive?"true":null)("aria-invalid",o.empty&&o.required?null:o.errorState)("aria-required",o.required)("id",o.id),Be("mat-input-server",o._isServer)("mat-mdc-form-field-textarea-control",o._isInFormField&&o._isTextarea)("mat-mdc-form-field-input-control",o._isInFormField)("mat-mdc-input-disabled-interactive",o.disabledInteractive)("mdc-text-field__input",o._isInFormField)("mat-mdc-native-select-inline",o._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",Ct]},exportAs:["matInput"],features:[fn([{provide:kC,useExisting:n}]),bn]})}return n})(),Se=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[we,we,n8,hi]})}return n})();var Sm=(()=>{class n{data;dialogRef=f(Ie);templateName=ae("");constructor(e){this.data=e,this.templateName.set(e.templateName)}onNoClick(){this.dialogRef.close(!1)}onYesClick(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-delete-confirmation-dialog"]],decls:9,vars:1,consts:[["mat-dialog-title",""],[1,"mat-mdc-dialog-content"],["mat-dialog-actions",""],["mat-button","",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1,"Delete template"),l(),s(2,"div",1),d(3),l(),s(4,"div",2)(5,"button",3),g("click",function(){return o.onNoClick()}),d(6,"No, cancel"),l(),s(7,"button",4),g("click",function(){return o.onYesClick()}),d(8,"Yes, delete!"),l()()),t&2&&(m(3),ee("Are you sure you want to delete template ",o.templateName(),"?"))},dependencies:[_e,Ne,Fe,W,pe],encapsulation:2,changeDetection:0})}return n})();var $ee=(n,i)=>i.compute_id;function Hee(n,i){if(n&1&&(s(0,"button",3)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/projects")}}function Uee(n,i){if(n&1){let e=z();s(0,"button",13),g("click",function(){k(e);let o=v();return T(o.openAddDialog())}),s(1,"mat-icon"),d(2,"add_circle_outline"),l()()}}function Gee(n,i){n&1&&(s(0,"div",10),d(1,"Loading..."),l())}function Wee(n,i){n&1&&(s(0,"div",11)(1,"mat-icon",14),d(2,"cloud_off"),l(),s(3,"p"),d(4,"No computes found. Click + to add one."),l()())}function qee(n,i){if(n&1&&(s(0,"span",22)(1,"mat-icon",23),d(2,"memory"),l(),d(3),l(),s(4,"span",22)(5,"mat-icon",23),d(6,"storage"),l(),d(7),l(),s(8,"span",22)(9,"mat-icon",23),d(10,"disc_full"),l(),d(11),l()),n&2){let e=v().$implicit,t=v(2);m(3),ee(" ",t.formatPercent(e.cpu_usage_percent)," "),m(4),ee(" ",t.formatPercent(e.memory_usage_percent)," "),m(4),ee(" ",t.formatPercent(e.disk_usage_percent)," ")}}function Qee(n,i){n&1&&(s(0,"span",21),d(1,"Offline"),l())}function Xee(n,i){if(n&1){let e=z();s(0,"button",24),g("click",function(o){return o.stopPropagation()}),s(1,"mat-icon"),d(2,"more_vert"),l()(),s(3,"mat-menu",25,0)(5,"button",26),g("click",function(){k(e);let o=v().$implicit,r=v(2);return T(r.openEditDialog(o))}),s(6,"mat-icon"),d(7,"edit"),l(),s(8,"span"),d(9,"Edit"),l()(),s(10,"button",26),g("click",function(){k(e);let o=v().$implicit,r=v(2);return T(r.connectCompute(o))}),s(11,"mat-icon"),d(12,"link"),l(),s(13,"span"),d(14,"Connect"),l()(),s(15,"button",26),g("click",function(){k(e);let o=v().$implicit,r=v(2);return T(r.deleteCompute(o))}),s(16,"mat-icon"),d(17,"delete"),l(),s(18,"span"),d(19,"Delete"),l()()()}if(n&2){let e=Pe(4);C("matMenuTriggerFor",e)}}function Kee(n,i){if(n&1&&(s(0,"div",15)(1,"mat-icon",16),d(2),l(),s(3,"div",17)(4,"span",18),d(5),l(),s(6,"span",19),d(7),l()(),s(8,"div",20),A(9,qee,12,3)(10,Qee,2,0,"span",21),l(),A(11,Xee,20,1),l()),n&2){let e=i.$implicit,t=v(2);m(),nn("color",t.getStatusColor(e)),C("matTooltip",e.connected?"Connected":"Disconnected"),m(),ee(" ",t.getStatusIcon(e)," "),m(3),j(e.name||e.compute_id),m(2),j(t.formatHost(e)),m(2),O(e.connected?9:10),m(2),O(e.compute_id!=="local"?11:-1)}}function Yee(n,i){if(n&1&&(s(0,"nav",12),Y(1,Kee,12,8,"div",15,$ee),l()),n&2){let e=v();m(),Z(e.computes())}}var Zee=(n,i)=>i.key;function Jee(n,i){if(n&1&&(s(0,"mat-option",6),d(1),l()),n&2){let e=i.$implicit;C("value",e.key),m(),j(e.name)}}function ete(n,i){n&1&&(s(0,"mat-error"),d(1,"You must select a protocol"),l())}function tte(n,i){n&1&&(s(0,"mat-error"),d(1,"You must enter a host"),l())}function nte(n,i){n&1&&(s(0,"mat-error"),d(1,"You must enter a port"),l())}function ite(n,i){n&1&&(s(0,"mat-error"),d(1,"Port must be between 1 and 65535"),l())}var r8=(()=>{class n{route=f(lt);controllerService=f(Je);computeService=f(ko);notificationService=f(Ws);toasterService=f(te);dialog=f(nt);cd=f(Q);controller;_computes=ae([]);computes=Jt(()=>[...this._computes()].sort((t,o)=>t.compute_id==="local"?-1:o.compute_id==="local"?1:(t.name||"").localeCompare(o.name||"")));displayedColumns=["status","name","host","connected","cpu","memory","disk","actions"];loading=ae(!0);subscription=new So;ngOnInit(){this.loadControllerAndComputes()}ngOnDestroy(){this.subscription.unsubscribe()}loadControllerAndComputes(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{if(this.controller=t,this.cd.markForCheck(),this.notificationService.hasCachedData()){let o=this.notificationService.getCachedComputes();this._computes.set(o),this.loading.set(!1),this.cd.markForCheck()}else this.loadComputes();this.subscription.add(this.notificationService.computeNotificationEmitter.subscribe(o=>{this.handleComputeNotification(o)})),this.subscription.add(this.notificationService.computeCacheUpdated.subscribe(o=>{this._computes.set(o),this.loading.set(!1),this.cd.markForCheck()}))},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.loading.set(!1),this.cd.markForCheck()})}handleComputeNotification(e){switch(e.action){case"compute.created":this._computes.update(t=>[...t,e.event]),this.toasterService.success(`Compute "${e.event.name}" added`);break;case"compute.updated":this._computes.update(t=>t.map(o=>o.compute_id===e.event.compute_id?e.event:o));break;case"compute.deleted":this._computes.update(t=>t.filter(o=>o.compute_id!==e.event.compute_id)),this.toasterService.success(`Compute "${e.event.name}" deleted`);break}this.cd.markForCheck()}loadComputes(){this.loading.set(!0),this.computeService.getComputes(this.controller).subscribe({next:e=>{this.notificationService.setInitialComputes(e),this._computes.set(e),this.loading.set(!1),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load computes";this.loading.set(!1),this.toasterService.error(t),this.cd.markForCheck()}})}openAddDialog(){this.dialog.open(o8,{panelClass:["base-dialog-panel","simple-dialog-panel"],autoFocus:!1,disableClose:!0,data:{controller:this.controller}}).afterClosed().subscribe(t=>{t&&this.computeService.createCompute(this.controller,t).subscribe({next:()=>{this.toasterService.success("Compute added successfully"),this.loadComputes()},error:o=>{let r=o.error?.message||o.message||"Failed to add compute";this.toasterService.error(r),this.cd.markForCheck()}})})}openEditDialog(e){this.computeService.getCompute(this.controller,e.compute_id).subscribe({next:t=>{this.dialog.open(o8,{panelClass:["base-dialog-panel","simple-dialog-panel"],autoFocus:!1,disableClose:!0,data:{controller:this.controller,compute:t}}).afterClosed().subscribe(r=>{r&&this.computeService.updateCompute(this.controller,e.compute_id,r).subscribe({next:()=>{this.toasterService.success("Compute updated successfully"),this.loadComputes()},error:a=>{let c=a.error?.message||a.message||"Failed to update compute";this.toasterService.error(c),this.cd.markForCheck()}})})},error:t=>{let o=t.error?.message||t.message||"Failed to load compute details";this.toasterService.error(o),this.cd.markForCheck()}})}deleteCompute(e){this.dialog.open(Sm,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],autoFocus:!1,disableClose:!0,data:{templateName:e.name||e.compute_id}}).afterClosed().subscribe(o=>{o&&this.computeService.deleteCompute(this.controller,e.compute_id).subscribe({next:()=>{this.toasterService.success("Compute deleted successfully"),this.loadComputes()},error:r=>{let a=r.error?.message||r.message||"Failed to delete compute";this.toasterService.error(a),this.cd.markForCheck()}})})}connectCompute(e){this.computeService.connectCompute(this.controller,e.compute_id).subscribe({next:()=>{this.toasterService.success("Connection request sent"),this.computeService.getCompute(this.controller,e.compute_id).subscribe({next:t=>{let o=this.computes().map(r=>r.compute_id===t.compute_id?t:r);this._computes.set(o),this.cd.markForCheck()},error:()=>{this.loadComputes()}})},error:t=>{let o=t.error?.message||t.message||"Failed to connect compute";this.toasterService.error(o),this.cd.markForCheck()}})}getStatusIcon(e){return e.connected?"check_circle":"cancel"}getStatusColor(e){return e.connected?"var(--mat-sys-primary)":"var(--mat-sys-error)"}formatPercent(e){return e!=null?`${e.toFixed(1)}%`:"--"}formatHost(e){return`${e.host}:${e.port}`}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-computes"]],decls:15,vars:5,consts:[["menu","matMenu"],[1,"computes"],[1,"computes__header"],["mat-icon-button","",1,"computes__back-btn",3,"routerLink"],[1,"computes__title"],["matTooltip","Add Compute","matTooltipClass","custom-tooltip","mat-icon-button","",1,"computes__add-btn"],[1,"computes__content"],[1,"computes__info"],[1,"computes__info-icon"],[1,"computes__info-text"],[1,"computes__loading"],[1,"computes__empty"],[1,"computes__list"],["matTooltip","Add Compute","matTooltipClass","custom-tooltip","mat-icon-button","",1,"computes__add-btn",3,"click"],[1,"computes__empty-icon"],[1,"computes__list-item"],[1,"computes__list-icon",3,"matTooltip"],[1,"computes__list-info"],[1,"computes__list-name"],[1,"computes__list-host"],[1,"computes__list-stats"],[1,"computes__stat","computes__stat--offline"],[1,"computes__stat"],[1,"computes__stat-icon"],["mat-icon-button","",1,"computes__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,Hee,3,1,"button",3),s(3,"h1",4),d(4,"Computes"),l(),A(5,Uee,3,0,"button",5),l(),s(6,"main",6)(7,"div",7)(8,"mat-icon",8),d(9,"info"),l(),s(10,"p",9),d(11," Once configured and connected, the backend maintains the connection to Compute nodes automatically. This page is used to add/delete/update node configurations and view node status. "),l()(),A(12,Gee,2,0,"div",10),A(13,Wee,5,0,"div",11),A(14,Yee,3,0,"nav",12),l()()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(7),O(o.loading()?12:-1),m(),O(!o.loading()&&!o.computes().length?13:-1),m(),O(!o.loading()&&o.computes().length?14:-1))},dependencies:[ne,dt,vn,W,je,ie,de,Ge,Qn,Ze,Fn,hn,wt,It,_e,we,Se,vt,Dt],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.computes__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.computes__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.computes__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.computes__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.computes__add-btn[_ngcontent-%COMP%]{margin-left:auto;color:var(--mat-sys-primary)}.computes__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.computes__info[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px;margin-bottom:20px;background:var(--mat-sys-primary-container);border-radius:12px;border-left:4px solid var(--mat-sys-primary);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both}.computes__info-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary-container);flex-shrink:0;font-size:20px;width:20px;height:20px}.computes__info-text[_ngcontent-%COMP%]{margin:0;font-size:14px;color:var(--mat-sys-on-primary-container);line-height:1.5}.computes__loading[_ngcontent-%COMP%], .computes__empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:200px;color:var(--mat-sys-on-surface-variant);background:var(--mat-sys-surface);border-radius:16px;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.computes__empty-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;margin-bottom:16px;color:var(--mat-sys-on-surface-variant)}.computes__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.computes__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer}.computes__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.computes__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.computes__list-icon[_ngcontent-%COMP%]{flex-shrink:0}.computes__list-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.computes__list-name[_ngcontent-%COMP%]{font-size:16px;font-weight:500;color:var(--mat-sys-on-surface);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.computes__list-host[_ngcontent-%COMP%]{font-size:13px;color:var(--mat-sys-on-surface-variant)}.computes__list-stats[_ngcontent-%COMP%]{display:flex;gap:16px;flex-shrink:0}.computes__stat[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:13px;color:var(--mat-sys-on-surface)}.computes__stat--offline[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);font-style:italic}.computes__stat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;color:var(--mat-sys-on-surface-variant)}.computes__menu-btn[_ngcontent-%COMP%]{flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.computes__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.computes__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.computes__title[_ngcontent-%COMP%]{font-size:24px}.computes__content[_ngcontent-%COMP%]{padding:0 16px 16px}.computes__list-item[_ngcontent-%COMP%]{padding:14px 16px}.computes__list-stats[_ngcontent-%COMP%]{display:none}}"],changeDetection:0})}return n})(),o8=(()=>{class n{dialogRef=f(Ie);data=f(gt);protocols=[{key:"http",name:"HTTP"},{key:"https",name:"HTTPS"}];computeForm=new gr({name:new Ye(""),protocol:new Ye("http",[Ue.required]),host:new Ye("",[Ue.required]),port:new Ye(3080,[Ue.required,Ue.min(1),Ue.max(65535)]),user:new Ye("gns3"),password:new Ye("gns3")});isEditMode=!1;constructor(){this.data.compute&&(this.isEditMode=!0,this.computeForm.patchValue({name:this.data.compute.name,protocol:this.data.compute.protocol,host:this.data.compute.host,port:this.data.compute.port,user:this.data.compute.user,password:""}))}onSaveClick(){if(!this.computeForm.valid)return;let e=this.computeForm.value,t={protocol:e.protocol,host:e.host,port:e.port,user:e.user||void 0,name:e.name||void 0};e.password&&e.password.trim()!==""&&(t.password=e.password),this.dialogRef.close(t)}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-compute-dialog"]],decls:39,vars:8,consts:[["mat-dialog-title",""],[3,"formGroup"],["mat-dialog-content",""],["appearance","fill",1,"full-width-field"],["matInput","","tabindex","1","formControlName","name","placeholder","My Compute"],["formControlName","protocol"],[3,"value"],["matInput","","tabindex","1","formControlName","host","placeholder","192.168.1.100"],["matInput","","type","number","tabindex","1","formControlName","port","placeholder","3080"],["matInput","","tabindex","1","formControlName","user","placeholder","gns3"],["matInput","","type","password","tabindex","1","formControlName","password","placeholder","gns3"],["mat-dialog-actions","","align","end"],["mat-button","","tabindex","-1","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click","disabled"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"form",1)(3,"div",2)(4,"mat-form-field",3)(5,"mat-label"),d(6,"Name (optional)"),l(),R(7,"input",4),l(),s(8,"mat-form-field",3)(9,"mat-label"),d(10,"Protocol"),l(),s(11,"mat-select",5),Y(12,Jee,2,2,"mat-option",6,Zee),l(),A(14,ete,2,0,"mat-error"),l(),s(15,"mat-form-field",3)(16,"mat-label"),d(17,"Host"),l(),R(18,"input",7),A(19,tte,2,0,"mat-error"),l(),s(20,"mat-form-field",3)(21,"mat-label"),d(22,"Port"),l(),R(23,"input",8),A(24,nte,2,0,"mat-error"),A(25,ite,2,0,"mat-error"),l(),s(26,"mat-form-field",3)(27,"mat-label"),d(28,"User"),l(),R(29,"input",9),l(),s(30,"mat-form-field",3)(31,"mat-label"),d(32,"Password"),l(),R(33,"input",10),l()(),s(34,"div",11)(35,"button",12),g("click",function(){return o.onCancelClick()}),d(36,"Cancel"),l(),s(37,"button",13),g("click",function(){return o.onSaveClick()}),d(38),l()()()),t&2&&(m(),j(o.isEditMode?"Edit Compute":"Add Compute"),m(),C("formGroup",o.computeForm),m(10),Z(o.protocols),m(2),O(o.computeForm.get("protocol").hasError("required")?14:-1),m(5),O(o.computeForm.get("host").hasError("required")?19:-1),m(5),O(o.computeForm.get("port").hasError("required")?24:-1),m(),O(o.computeForm.get("port").hasError("min")||o.computeForm.get("port").hasError("max")?25:-1),m(12),C("disabled",o.computeForm.invalid),m(),ee(" ",o.isEditMode?"Update":"Add"," "))},dependencies:[ne,Dt,at,Ft,_r,Pt,rt,Rt,zt,_e,Ne,Fe,bt,W,pe,we,Me,et,fi,Se,Ee,vt,At,_t],encapsulation:2,changeDetection:0})}return n})();var ote=["*"];var rte=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],ate=["[mat-card-avatar], [matCardAvatar]",`mat-card-title, mat-card-subtitle,
[mat-card-title], [mat-card-subtitle],
[matCardTitle], [matCardSubtitle]`,"*"],ste=new cn("MAT_CARD_CONFIG"),On=(()=>{class n{appearance;constructor(){let e=f(ste,{optional:!0});this.appearance=e?.appearance||"raised"}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:8,hostBindings:function(t,o){t&2&&Be("mat-mdc-card-outlined",o.appearance==="outlined")("mdc-card--outlined",o.appearance==="outlined")("mat-mdc-card-filled",o.appearance==="filled")("mdc-card--filled",o.appearance==="filled")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:ote,decls:1,vars:0,template:function(t,o){t&1&&(ii(),on(0))},styles:[`.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-elevated-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mat-card-outlined-container-color, var(--mat-sys-surface));border-radius:var(--mat-card-outlined-container-shape, var(--mat-sys-corner-medium));border-width:var(--mat-card-outlined-outline-width, 1px);border-color:var(--mat-card-outlined-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mat-card-outlined-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mat-mdc-card-filled{background-color:var(--mat-card-filled-container-color, var(--mat-sys-surface-container-highest));border-radius:var(--mat-card-filled-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-filled-container-elevation, var(--mat-sys-level0))}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}
`],encapsulation:2,changeDetection:0})}return n})(),Oc=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-mdc-card-title"]})}return n})();var ll=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["mat-card-content"]],hostAttrs:[1,"mat-mdc-card-content"]})}return n})();var $b=(()=>{class n{align="start";static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["mat-card-actions"]],hostAttrs:[1,"mat-mdc-card-actions","mdc-card__actions"],hostVars:2,hostBindings:function(t,o){t&2&&Be("mat-mdc-card-actions-align-end",o.align==="end")},inputs:{align:"align"},exportAs:["matCardActions"]})}return n})(),Nc=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-card-header"]],hostAttrs:[1,"mat-mdc-card-header"],ngContentSelectors:ate,decls:4,vars:0,consts:[[1,"mat-mdc-card-header-text"]],template:function(t,o){t&1&&(ii(rte),on(0),vo(1,"div",0),on(2,1),wo(),on(3,2))},encapsulation:2,changeDetection:0})}return n})();var Mt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[hi]})}return n})();var wm=(()=>{class n{dataChange=new an([]);constructor(){}get data(){return this.dataChange.value}addController(e){let t=this.data.slice();t.push(e),this.dataChange.next(t)}addControllers(e){this.dataChange.next(e)}remove(e){let t=this.data.indexOf(e);t>=0&&(this.data.splice(t,1),this.dataChange.next(this.data.slice()))}find(e){return this.data.find(t=>t.name===e)}findById(e){return this.data.find(t=>t.id===e)}findIndex(e){return this.data.findIndex(t=>t.name===e)}findIndexById(e){return this.data.findIndex(t=>t.id===e)}update(e){let t=this.findIndexById(e.id);t>=0&&(this.data[t]=e,this.dataChange.next(this.data.slice()))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var a8=(n,i)=>i.key;function lte(n,i){n&1&&(s(0,"mat-error"),d(1,"You must enter a value"),l())}function cte(n,i){if(n&1&&(s(0,"mat-option",9),d(1),l()),n&2){let e=i.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}function dte(n,i){if(n&1&&(s(0,"mat-option",9),d(1),l()),n&2){let e=i.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}var Hb=(()=>{class n{controllerService=f(Je);controllerDatabase=f(wm);route=f(lt);router=f(ht);toasterService=f(te);cdr=f(Q);controllerOptionsVisibility=ae(!1);controllerIp;controllerPort;projectId;protocols=[{key:"http:",name:"HTTP"},{key:"https:",name:"HTTPS"}];locations=[{key:"local",name:"Local"},{key:"remote",name:"Remote"}];controllerForm=new gr({name:new Ye("",[Ue.required]),location:new Ye(""),protocol:new Ye("http:")});constructor(){}async ngOnInit(){this.controllerService.isServiceInitialized&&this.getControllers(),this.controllerService.serviceInitialized.subscribe(async e=>{e&&this.getControllers()})}async getControllers(){this.controllerIp=this.route.snapshot.paramMap.get("controller_ip"),this.controllerPort=+this.route.snapshot.paramMap.get("controller_port"),this.projectId=this.route.snapshot.paramMap.get("project_id");try{let t=(await this.controllerService.findAll()).filter(o=>o.host===this.controllerIp&&o.port===this.controllerPort)[0];t?this.router.navigate(["/controller",t.id,"project",this.projectId]):(this.controllerOptionsVisibility.set(!0),this.cdr.markForCheck())}catch(e){let t=e.error?.message||e.message||"Failed to load controllers";this.toasterService.error(t),this.cdr.markForCheck()}}createController(){if(!this.controllerForm.get("name").hasError&&!this.controllerForm.get("location").hasError&&!this.controllerForm.get("protocol").hasError){this.toasterService.error("Please use correct values");return}let e=new y4;e.host=this.controllerIp,e.port=this.controllerPort,e.name=this.controllerForm.get("name").value,e.location=this.controllerForm.get("location").value,e.protocol=this.controllerForm.get("protocol").value,this.controllerService.create(e).then(t=>{this.router.navigate(["/controller",t.id,"project",this.projectId])},t=>{let o=t.error?.message||t.message||"Failed to create controller";this.toasterService.error(o),this.cdr.markForCheck()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-direct-link"]],decls:22,vars:3,consts:[[1,"content",3,"hidden"],[1,"default-header"],[1,"row"],[1,"col"],[1,"default-content"],[1,"matCard"],[3,"formGroup"],["matInput","","tabindex","1","formControlName","name","placeholder","Name"],["placeholder","Location","formControlName","location"],[3,"value"],["placeholder","Protocol","formControlName","protocol"],[1,"buttons-bar"],["mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"Add new controller"),l()()(),s(5,"div",4)(6,"mat-card",5)(7,"form",6)(8,"mat-form-field"),R(9,"input",7),A(10,lte,2,0,"mat-error"),l(),s(11,"mat-form-field")(12,"mat-select",8),Y(13,cte,2,2,"mat-option",9,a8),l()(),s(15,"mat-form-field")(16,"mat-select",10),Y(17,dte,2,2,"mat-option",9,a8),l()()()(),s(19,"div",11)(20,"button",12),g("click",function(){return o.createController()}),d(21,"Add controller"),l()()()()),t&2&&(C("hidden",!o.controllerOptionsVisibility()),m(7),C("formGroup",o.controllerForm),m(3),O(o.controllerForm.get("name").hasError("required")?10:-1),m(3),Z(o.locations),m(4),Z(o.protocols))},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,dt,Mt,On,we,Me,fi,Se,Ee,vt,At,_t,Fo,W,pe],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var $D=new cn("CdkAccordion"),s8=(()=>{class n{_stateChanges=new He;_openCloseAllActions=new He;id=f(Mo).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",Ct]},exportAs:["cdkAccordion"],features:[fn([{provide:$D,useExisting:n}]),bn]})}return n})(),l8=(()=>{class n{accordion=f($D,{optional:!0,skipSelf:!0});_changeDetectorRef=f(Q);_expansionDispatcher=f(Yu);_openCloseAllSubscription=So.EMPTY;closed=new ve;opened=new ve;destroyed=new ve;expandedChange=new ve;id=f(Mo).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let t=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,t)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}_expanded=!1;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=ae(!1);_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e)})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",Ct],disabled:[2,"disabled","disabled",Ct]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[fn([{provide:$D,useValue:void 0}])]})}return n})(),Ub=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({})}return n})();var mte=["body"],pte=["bodyWrapper"],ute=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],hte=["mat-expansion-panel-header","*","mat-action-row"];function fte(n,i){}var gte=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],_te=["mat-panel-title","mat-panel-description","*"];function vte(n,i){n&1&&(vo(0,"span",1),ei(),vo(1,"svg",2),bs(2,"path",3),wo()())}var HD=new cn("MAT_ACCORDION"),c8=new cn("MAT_EXPANSION_PANEL"),Cte=(()=>{class n{_template=f(Oo);_expansionPanel=f(c8,{optional:!0});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),d8=new cn("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),kd=(()=>{class n extends l8{_viewContainerRef=f(oo);_animationsDisabled=qo();_document=f(Xi);_ngZone=f(Vi);_elementRef=f(Zt);_renderer=f(Si);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_togglePosition;afterExpand=new ve;afterCollapse=new ve;_inputChanges=new He;accordion=f(HD,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=f(Mo).getId("mat-expansion-panel-header-");constructor(){super();let e=f(d8,{optional:!0});this._expansionDispatcher=f(Yu),e&&(this.hideToggle=e.hideToggle)}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":!1}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(pi(null),ai(()=>this.expanded&&!this._portal),Ao(1)).subscribe(()=>{this._portal=new pd(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){let e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return!1}_transitionEndListener=({target:e,propertyName:t})=>{e===this._bodyWrapper?.nativeElement&&t==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,Cte,5),t&2){let a;mt(a=pt())&&(o._lazyContent=a.first)}},viewQuery:function(t,o){if(t&1&&xn(mte,5)(pte,5),t&2){let r;mt(r=pt())&&(o._body=r.first),mt(r=pt())&&(o._bodyWrapper=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(t,o){t&2&&Be("mat-expanded",o.expanded)("mat-expansion-panel-spacing",o._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",Ct],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[fn([{provide:HD,useValue:void 0},{provide:c8,useExisting:n}]),si,bn],ngContentSelectors:hte,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,o){t&1&&(ii(ute),on(0),s(1,"div",2,0)(3,"div",3,1)(5,"div",4),on(6,1),xe(7,fte,0,0,"ng-template",5),l(),on(8,2),l()()),t&2&&(m(),qt("inert",o.expanded?null:""),m(2),C("id",o.id),qt("aria-labelledby",o._headerId),m(4),C("cdkPortalOutlet",o._portal))},dependencies:[Gu],styles:[`.mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel{position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:var(--mat-expansion-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}@media print{.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-content{font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}
`],encapsulation:2,changeDetection:0})}return n})();var Td=(()=>{class n{panel=f(kd,{host:!0});_element=f(Zt);_focusMonitor=f(Aa);_changeDetectorRef=f(Q);_parentChangeSubscription=So.EMPTY;constructor(){f(cr).load(ia);let e=this.panel,t=f(d8,{optional:!0}),o=f(new sc("tabindex"),{optional:!0}),r=e.accordion?e.accordion._stateChanges.pipe(ai(a=>!!(a.hideToggle||a.togglePosition))):Lu;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=Hn(e.opened,e.closed,r,e._inputChanges.pipe(ai(a=>!!(a.hideToggle||a.disabled||a.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),e.closed.pipe(ai(()=>e._containsFocus())).subscribe(()=>this._focusMonitor.focusVia(this._element,"program")),t&&(this.expandedHeight=t.expandedHeight,this.collapsedHeight=t.collapsedHeight)}expandedHeight;collapsedHeight;tabIndex=0;get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){let e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}_keydown(e){switch(e.keyCode){case 32:case 13:fa(e)||(e.preventDefault(),this._toggle());break;default:this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e);return}}focus(e,t){e?this._focusMonitor.focusVia(this._element,e,t):this._element.nativeElement.focus(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(e=>{e&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:13,hostBindings:function(t,o){t&1&&g("click",function(){return o._toggle()})("keydown",function(a){return o._keydown(a)}),t&2&&(qt("id",o.panel._headerId)("tabindex",o.disabled?-1:o.tabIndex)("aria-controls",o._getPanelId())("aria-expanded",o._isExpanded())("aria-disabled",o.panel.disabled),nn("height",o._getHeaderHeight()),Be("mat-expanded",o._isExpanded())("mat-expansion-toggle-indicator-after",o._getTogglePosition()==="after")("mat-expansion-toggle-indicator-before",o._getTogglePosition()==="before"))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight",tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:No(e)]},ngContentSelectors:_te,decls:5,vars:3,consts:[[1,"mat-content"],[1,"mat-expansion-indicator"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 -960 960 960","aria-hidden","true","focusable","false"],["d","M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"]],template:function(t,o){t&1&&(ii(gte),vo(0,"span",0),on(1),on(2,1),on(3,2),wo(),A(4,vte,3,0,"span",1)),t&2&&(Be("mat-content-hide-toggle",!o._showToggle()),m(4),O(o._showToggle()?4:-1))},styles:[`.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header::before{border-radius:inherit}.mat-expansion-panel-header{height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}
`],encapsulation:2,changeDetection:0})}return n})(),Gb=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["mat-panel-description"]],hostAttrs:[1,"mat-expansion-panel-header-description"]})}return n})(),Mm=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]})}return n})(),km=(()=>{class n extends s8{_keyManager;_ownHeaders=new Il;_headers;hideToggle=!1;displayMode="default";togglePosition="after";ngAfterContentInit(){this._headers.changes.pipe(pi(this._headers)).subscribe(e=>{this._ownHeaders.reset(e.filter(t=>t.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new Gd(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(e){this._keyManager.onKeydown(e)}_handleHeaderFocus(e){this._keyManager.updateActiveItem(e)}ngOnDestroy(){super.ngOnDestroy(),this._keyManager?.destroy(),this._ownHeaders.destroy()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["mat-accordion"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,Td,5),t&2){let a;mt(a=pt())&&(o._headers=a)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(t,o){t&2&&Be("mat-accordion-multi",o.multi)},inputs:{hideToggle:[2,"hideToggle","hideToggle",Ct],displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[fn([{provide:HD,useExisting:n}]),si]})}return n})(),cl=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[Ub,Wu,hi]})}return n})();var qb=(()=>{class n{httpClient=f(js);sanitizer=f(fr);toasterService=f(te);cd=f(Q);thirdpartylicenses=ae("");releasenotes=ae("");ngOnInit(){this.httpClient.get(window.location.href+"/3rdpartylicenses.txt",{responseType:"text"}).subscribe({next:e=>{let t=e.replace(new RegExp(`
`,"g"),"<br />");this.thirdpartylicenses.set(this.sanitizer.bypassSecurityTrustHtml(t))},error:e=>{if(e.status===404)this.thirdpartylicenses.set("Download Solar-PuTTY");else{let t=e.error?.message||e.message||"Failed to load third party licenses";this.toasterService.error(t)}this.cd.markForCheck()}}),this.httpClient.get("ReleaseNotes.txt",{responseType:"text"}).subscribe({next:e=>{let t=e.replace(new RegExp(`
`,"g"),"<br />");this.releasenotes.set(this.sanitizer.bypassSecurityTrustHtml(t))},error:e=>{let t=e.error?.message||e.message||"Failed to load release notes";this.toasterService.error(t),this.cd.markForCheck()}})}goToDocumentation(){window.location.href="https://docs.gns3.com/docs/"}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-help"]],decls:39,vars:2,consts:[[1,"help"],[1,"help__header"],[1,"help__title"],[1,"help__content"],[1,"help__card"],["href","https://downloads.solarwinds.com/solarwinds/GNS3/Solar-PuTTY/Solar-PuTTY-Optional.exe",1,"help__link"],[3,"innerHTML"],["mat-button","","color","primary",1,"help__doc-button",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1)(2,"h1",2),d(3,"Help"),l()(),s(4,"main",3)(5,"section",4)(6,"mat-accordion")(7,"mat-expansion-panel")(8,"mat-expansion-panel-header")(9,"mat-panel-title"),d(10," Useful shortcuts "),l()(),s(11,"mat-list")(12,"mat-list-item"),d(13," ctrl + + to zoom in "),l(),s(14,"mat-list-item"),d(15," ctrl + - to zoom out "),l(),s(16,"mat-list-item"),d(17," ctrl + 0 to reset zoom "),l(),s(18,"mat-list-item"),d(19," ctrl + h to hide toolbar "),l(),s(20,"mat-list-item"),d(21," ctrl + a to select all items on map "),l(),s(22,"mat-list-item"),d(23," ctrl + shift + a to deselect all items on map "),l(),s(24,"mat-list-item"),d(25," ctrl + shift + s to go to preferences "),l()()(),s(26,"mat-expansion-panel")(27,"mat-expansion-panel-header")(28,"mat-panel-title"),d(29," Third party components "),l()(),s(30,"a",5),R(31,"div",6),l()(),s(32,"mat-expansion-panel")(33,"mat-expansion-panel-header")(34,"mat-panel-title"),d(35," Release notes "),l()(),R(36,"div",6),l()()(),s(37,"button",7),g("click",function(){return o.goToDocumentation()}),d(38," Go to documentation "),l()()()),t&2&&(m(31),C("innerHTML",o.thirdpartylicenses(),vp),m(5),C("innerHTML",o.releasenotes(),vp))},dependencies:[W,pe,cl,km,kd,Td,Mm,Zi,F4,Wd],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.help__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.help__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.help__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.help__card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none;border-bottom:1px solid var(--mat-sys-outline-variant)}.mat-expansion-panel[_ngcontent-%COMP%]:first-of-type{border-top:none}.mat-expansion-panel-header[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface)}.mat-expansion-panel-header-title[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface)}.help__doc-button[_ngcontent-%COMP%]{display:block;width:100%;margin-top:20px;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}.help__link[_ngcontent-%COMP%]{color:var(--mat-sys-primary);text-decoration:none;font-size:14px;font-weight:400}.help__link[_ngcontent-%COMP%]:hover{text-decoration:underline}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.help__header[_ngcontent-%COMP%]{padding:24px 16px 12px}.help__title[_ngcontent-%COMP%]{font-size:24px}.help__content[_ngcontent-%COMP%]{padding:0 16px 16px}.help__doc-button[_ngcontent-%COMP%]{height:44px;font-size:15px}}"],changeDetection:0})}return n})();var Qb=(()=>{class n{constructor(){}isWindows(){return navigator.platform.indexOf("Win")>-1}isLinux(){return navigator.platform.indexOf("Linux")>-1}isDarwin(){return navigator.platform.indexOf("Mac")>-1}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Xb=(()=>{class n{platformService;constructor(e){this.platformService=e}get(){return this.platformService.isWindows()?this.getForWindows():this.platformService.isDarwin()?this.getForDarwin():this.getForLinux()}getForWindows(){let e=[{name:"Wireshark",locations:["C:\\Program Files\\Wireshark\\Wireshark.exe"],type:"web",resource:"https://1.na.dl.wireshark.org/win64/all-versions/Wireshark-win64-2.6.3.exe",binary:"Wireshark.exe",sudo:!0,installation_arguments:[],installed:!1,installer:!0}],t={name:"SolarPuTTY",locations:["SolarPuTTY.exe","external\\SolarPuTTY.exe"],type:"web",resource:"",binary:"SolarPuTTY.exe",sudo:!1,installation_arguments:["--only-ask"],installed:!1,installer:!1};return wi.solarputty_download_url&&(t.resource=wi.solarputty_download_url,e.push(t)),e}getForLinux(){return[]}getForDarwin(){return[]}static \u0275fac=function(t){return new(t||n)(ge(Qb))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Kb=(()=>{class n{externalSoftwareDefinition;constructor(e){this.externalSoftwareDefinition=e}list(){return this.externalSoftwareDefinition.get().map(t=>(t.installed=!1,t))}static \u0275fac=function(t){return new(t||n)(ge(Xb))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var yte=(n,i)=>({hidden:n,lightTheme:i}),Ste=/<a href="(.*)">(.*)<\/a><br\/>(.*)<br\/>\s*<button><a .*>(.*)<\/a>\s*<\/button>/i,Yb=(()=>{class n{httpClient=f(js);themeService=f(ci);location=f(iC);isVisible=ae(!1);isLightThemeEnabled=ae(!1);adUrl=ae("https://try.solarwinds.com/gns3-free-toolset-giveaway?CMP=LEC-HAD-GNS3-SW_NA_X_NP_X_X_EN_STSGA_SW-ST-20200901_ST_OF1_TRY-NWSLTR");adBody=ae("Network Config Generator makes it easy configure network devices, including VLANs without opening the CLI");buttonLabel=ae("Check it out!");hide(){this.isVisible.set(!1)}ngOnInit(){this.location.path().includes("nodes")||(this.httpClient.get("https://servedbyadbutler.com/adserve/;ID=165803;size=0x0;setID=371476;type=json;").subscribe(e=>{if(e?.placements?.placement_1?.body)try{let t=e.placements.placement_1.body.replace(/(\r\n|\n|\r)/gm,""),o=Ste.exec(t);this.adUrl.set(o[1].trim()),this.adBody.set(o[3].trim()),this.buttonLabel.set(o[4].trim())}catch{}this.isVisible.set(!0)},e=>{}),this.themeService.getActualTheme()==="light"?this.isLightThemeEnabled.set(!0):this.isLightThemeEnabled.set(!1),this.themeService.themeChanged.subscribe(()=>{this.themeService.getActualTheme()==="light"?this.isLightThemeEnabled.set(!0):this.isLightThemeEnabled.set(!1)}))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-adbutler"]],decls:10,vars:8,consts:[[1,"ad",3,"ngClass"],[1,"adInnerContainer"],[1,"adBody"],["target","_blank",3,"href"],[1,"close-button",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"span",2)(3,"a",3),d(4),l()(),s(5,"button")(6,"a",3),d(7),l()()(),s(8,"mat-icon",4),g("click",function(){return o.hide()}),d(9,"close"),l()()),t&2&&(C("ngClass",zs(5,yte,!o.isVisible(),o.isLightThemeEnabled())),m(3),C("href",o.adUrl(),Ia),m(),j(o.adBody()),m(2),C("href",o.adUrl(),Ia),m(),j(o.buttonLabel()))},dependencies:[ne,Yi,ie,de],styles:[".ad[_ngcontent-%COMP%]{position:fixed;left:0;right:0;bottom:0;background-color:var(--mat-sys-primary-container);padding-top:10px;padding-bottom:10px;font-size:12px;font-weight:700;opacity:.8}.adInnerContainer[_ngcontent-%COMP%]{margin:auto;text-align:center}.adBody[_ngcontent-%COMP%]{padding-right:16px}.close-button[_ngcontent-%COMP%]{position:absolute;top:15px;right:15px;color:var(--mat-sys-on-surface)}.lightTheme[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface)}.hidden[_ngcontent-%COMP%]{visibility:hidden}button[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary);margin-top:2px;border:none;outline:none;color:var(--mat-sys-on-primary);font-weight:700;font-size:11px;padding:5px 15px;border-radius:6px}button[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}a[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface)}"],changeDetection:0})}return n})();function wte(n,i){if(n&1&&(Le(0),d(1),Ve()),n&2){let e=v();m(),j(e.buttonText())}}var Zb=(()=>{class n{software;installedChanged=new ve;disabled=ae(!1);readyToInstall=ae(!0);buttonText=ae("");constructor(){}ngOnInit(){this.updateButton()}ngOnChanges(){this.updateButton()}install(){this.disabled.set(!0),this.buttonText.set("Not supported")}updateButton(){this.disabled.set(this.software.installed),this.software.installed?this.buttonText.set("Installed"):this.buttonText.set("Install")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-install-software"]],inputs:{software:"software"},outputs:{installedChanged:"installedChanged"},features:[bn],decls:2,vars:2,consts:[["mat-button","","color","primary",3,"click","disabled"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.install()}),A(1,wte,2,1,"ng-container"),l()),t&2&&(C("disabled",o.disabled()),m(),O(o.readyToInstall()?1:-1))},dependencies:[ne,W,pe],encapsulation:2,changeDetection:0})}return n})();function Mte(n,i){n&1&&(s(0,"mat-header-cell"),d(1," Name "),l())}function kte(n,i){if(n&1&&(Le(0),d(1),Ve()),n&2){let e=v().$implicit;m(),ee(" ",e.name," ")}}function Tte(n,i){n&1&&(Le(0),R(1,"app-adbutler",13),Ve())}function Ete(n,i){if(n&1&&(s(0,"mat-cell"),A(1,kte,2,1,"ng-container"),A(2,Tte,2,0,"ng-container"),l()),n&2){let e=i.$implicit;m(),O(e.type!=="adbutler"?1:-1),m(),O(e.type==="adbutler"?2:-1)}}function Dte(n,i){n&1&&R(0,"mat-header-cell")}function Pte(n,i){if(n&1){let e=z();s(0,"app-install-software",16),g("installedChanged",function(o){k(e);let r=v(2);return T(r.onInstalled(o))}),l()}if(n&2){let e=v().$implicit;C("software",e)}}function Ite(n,i){if(n&1&&(s(0,"mat-cell",14),A(1,Pte,1,1,"app-install-software",15),l()),n&2){let e=i.$implicit;m(),O(e.type!=="adbutler"?1:-1)}}function Ate(n,i){n&1&&R(0,"mat-header-row")}function Ote(n,i){n&1&&R(0,"mat-row")}var Jb=(()=>{class n{dataSource=ae(null);displayedColumns=ae(["name","actions"]);installedSoftwareService=f(Kb);changeDetectorRef=f(Q);constructor(){}ngOnInit(){this.dataSource.set(new UD(this.installedSoftwareService))}onInstalled(e){this.dataSource()?.refresh(),this.changeDetectorRef.detectChanges()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-installed-software"]],decls:16,vars:3,consts:[["table",""],[1,"content"],[1,"default-header"],[1,"default-content"],[1,"container","mat-elevation-z8"],[3,"dataSource"],["matColumnDef","name"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","actions"],["style","text-align: right",4,"matCellDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],["theme","dark"],[2,"text-align","right"],[3,"software"],[3,"installedChanged","software"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"div",2)(2,"h1"),d(3,"Installed software"),l()(),s(4,"div",3)(5,"div",4)(6,"mat-table",5,0),Le(8,6),xe(9,Mte,2,0,"mat-header-cell",7)(10,Ete,3,2,"mat-cell",8),Ve(),Le(11,9),xe(12,Dte,1,0,"mat-header-cell",7)(13,Ite,2,1,"mat-cell",10),Ve(),xe(14,Ate,1,0,"mat-header-row",11)(15,Ote,1,0,"mat-row",12),l()()()()),t&2&&(m(6),C("dataSource",o.dataSource()),m(8),C("matHeaderRowDef",o.displayedColumns()),m(),C("matRowDefColumns",o.displayedColumns()))},dependencies:[ne,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,Yb,Zb],encapsulation:2,changeDetection:0})}return n})(),UD=class extends cd{installedSoftwareService;installed=new an([]);constructor(i){super(),this.installedSoftwareService=i}connect(){return this.refresh(),this.installed}disconnect(){}refresh(){let i=this.installedSoftwareService.list();i.push({type:"adbutler"}),this.installed.next(i)}};var Nte=["input"],Fte=["label"],Rte=["*"],GD={color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1},Lte=new cn("mat-checkbox-default-options",{providedIn:"root",factory:()=>GD}),ba=(function(n){return n[n.Init=0]="Init",n[n.Checked=1]="Checked",n[n.Unchecked=2]="Unchecked",n[n.Indeterminate=3]="Indeterminate",n})(ba||{}),WD=class{source;checked},Gt=(()=>{class n{_elementRef=f(Zt);_changeDetectorRef=f(Q);_ngZone=f(Vi);_animationsDisabled=qo();_options=f(Lte,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let t=new WD;return t.source=this,t.checked=e,t}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return`${this.id||this._uniqueId}-input`}required=!1;labelPosition="after";name=null;change=new ve;indeterminateChange=new ve;value;disableRipple=!1;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=ba.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){f(cr).load(ia);let e=f(new sc("tabindex"),{optional:!0});this._options=this._options||GD,this.color=this._options.color||GD.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=f(Mo).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??!1}ngOnChanges(e){e.required&&this._validatorChangeFn()}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate)}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}_checked=!1;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}_disabled=!1;get indeterminate(){return this._indeterminate()}set indeterminate(e){let t=e!=this._indeterminate();this._indeterminate.set(e),t&&(e?this._transitionCheckState(ba.Indeterminate):this._transitionCheckState(this.checked?ba.Checked:ba.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=ae(!1);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(e){this.checked=!!e}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorChangeFn=e}_transitionCheckState(e){let t=this._currentCheckState,o=this._getAnimationTargetElement();if(!(t===e||!o)&&(this._currentAnimationClass&&o.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(t,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){o.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{o.classList.remove(r)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(!1),this.indeterminateChange.emit(!1)}),this._checked=!this._checked,this._transitionCheckState(this._checked?ba.Checked:ba.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate)}_onInteractionEvent(e){e.stopPropagation()}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}_getAnimationClassForCheckStateTransition(e,t){if(this._animationsDisabled)return"";switch(e){case ba.Init:if(t===ba.Checked)return this._animationClasses.uncheckedToChecked;if(t==ba.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case ba.Unchecked:return t===ba.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case ba.Checked:return t===ba.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case ba.Indeterminate:return t===ba.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let t=this._inputElement;t&&(t.nativeElement.indeterminate=e)}_onInputClick(){this._handleInputClick()}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus()}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,o){if(t&1&&xn(Nte,5)(Fte,5),t&2){let r;mt(r=pt())&&(o._inputElement=r.first),mt(r=pt())&&(o._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(t,o){t&2&&(Wo("id",o.id),qt("tabindex",null)("aria-label",null)("aria-labelledby",null),er(o.color?"mat-"+o.color:"mat-accent"),Be("_mat-animation-noopable",o._animationsDisabled)("mdc-checkbox--disabled",o.disabled)("mat-mdc-checkbox-disabled",o.disabled)("mat-mdc-checkbox-checked",o.checked)("mat-mdc-checkbox-disabled-interactive",o.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",Ct],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",Ct],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",Ct],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:No(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",Ct],checked:[2,"checked","checked",Ct],disabled:[2,"disabled","disabled",Ct],indeterminate:[2,"indeterminate","indeterminate",Ct]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[fn([{provide:ud,useExisting:ad(()=>n),multi:!0},{provide:gC,useExisting:n,multi:!0}]),bn],ngContentSelectors:Rte,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],["aria-hidden","true",1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],["aria-hidden","true",1,"mdc-checkbox__ripple"],["aria-hidden","true",1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","","aria-hidden","true",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(t,o){if(t&1&&(ii(),s(0,"div",3),g("click",function(a){return o._preventBubblingFromLabel(a)}),s(1,"div",4,0)(3,"div",5),g("click",function(){return o._onTouchTargetClick()}),l(),s(4,"input",6,1),g("blur",function(){return o._onBlur()})("click",function(){return o._onInputClick()})("change",function(a){return o._onInteractionEvent(a)}),l(),R(6,"div",7),s(7,"div",8),ei(),s(8,"svg",9),R(9,"path",10),l(),Ir(),R(10,"div",11),l(),R(11,"div",12),l(),s(12,"label",13,2),on(14),l()()),t&2){let r=Pe(2);C("labelPosition",o.labelPosition),m(4),Be("mdc-checkbox--selected",o.checked),C("checked",o.checked)("indeterminate",o.indeterminate)("disabled",o.disabled&&!o.disabledInteractive)("id",o.inputId)("required",o.required)("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex),qt("aria-label",o.ariaLabel||null)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby)("aria-checked",o.indeterminate?"mixed":null)("aria-controls",o.ariaControls)("aria-disabled",o.disabled&&o.disabledInteractive?!0:null)("aria-expanded",o.ariaExpanded)("aria-owns",o.ariaOwns)("name",o.name)("value",o.value),m(7),C("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),C("for",o.inputId)}},dependencies:[Us,Ju],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus-visible~.mat-focus-indicator::before{content:""}
`],encapsulation:2,changeDetection:0})}return n})(),Ot=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[Gt,hi]})}return n})();var dl=(()=>{class n{httpController;controller_id="";constructor(e){this.httpController=e}login(e,t,o){let r=new zO().set("username",t).set("password",o),a={headers:new aC().set("Content-Type","application/x-www-form-urlencoded")};return this.httpController.post(e,"/access/users/login",r,a)}getLoggedUser(e){return this.httpController.get(e,"/access/users/me").toPromise()}async getLoggedUserRefToken(e,t){return await this.httpController.post(e,"/access/users/authenticate",{username:t.username,password:t.password}).toPromise()}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ex=(()=>{class n{httpController;constructor(e){this.httpController=e}get(e){return this.httpController.get(e,"/version")}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Tm=(()=>{class n{notificationService;currentController=null;constructor(e){this.notificationService=e}establishConnection(e){this.currentController&&this.currentController.id===e.id||(this.currentController&&this.disconnect(),this.notificationService.connectToComputeNotifications(e),this.currentController=e)}disconnect(){this.notificationService.disconnect(),this.currentController=null}getCurrentController(){return this.currentController}isConnectedTo(e){return this.currentController&&this.currentController.id===e.id}static \u0275fac=function(t){return new(t||n)(ge(Ws))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Vte=["usernameInput"];function Bte(n,i){n&1&&R(0,"mat-icon",3)}function zte(n,i){n&1&&R(0,"mat-icon",4)}function jte(n,i){n&1&&R(0,"mat-icon",9)}function $te(n,i){n&1&&R(0,"mat-icon",10)}function Hte(n,i){if(n&1&&(s(0,"div",12)(1,"mat-icon",32),d(2,"storage"),l(),s(3,"div",33)(4,"span",34),d(5),l(),s(6,"span",35),d(7),l()()()),n&2){let e=v();m(5),j(e.controllerName),m(2),j(e.controllerAddress)}}function Ute(n,i){n&1&&(s(0,"mat-error"),d(1," Username is required "),l())}function Gte(n,i){n&1&&(s(0,"mat-error"),d(1," Password is required "),l())}function Wte(n,i){n&1&&(s(0,"div",19)(1,"mat-icon",36),d(2,"warning"),l(),s(3,"span"),d(4,"Caps Lock is on"),l()())}function qte(n,i){n&1&&R(0,"mat-progress-spinner",24)}function Qte(n,i){n&1&&(s(0,"span"),d(1,"Login"),l())}function Xte(n,i){n&1&&R(0,"mat-icon",29)}function Kte(n,i){n&1&&R(0,"mat-icon",30)}var tx=(()=>{class n{loginService=f(dl);controllerService=f(Je);controllerDatabase=f(wm);route=f(lt);router=f(ht);toasterService=f(te);versionService=f(ex);themeService=f(ci);connectionManager=f(Tm);cd=f(Q);controller;returnUrl=ae("");usernameInput;version=ae("");isLoading=ae(!1);hidePassword=ae(!0);isCapsLockOn=ae(!1);isRememberMeChecked=ae(!1);currentYear=new Date().getFullYear();isLightThemeEnabled=Jt(()=>this.themeService.getActualTheme()==="light");loginForm=new vC({username:new cc("",{nonNullable:!0,validators:[Ue.required]}),password:new cc("",{nonNullable:!0,validators:[Ue.required]})});constructor(){}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.returnUrl.set(this.route.snapshot.queryParams.returnUrl||"/"),this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,t.authToken&&this.router.navigate(["/controller",this.controller.id,"projects"]),this.versionService.get(this.controller).subscribe({next:o=>{this.version.set(o.version)},error:o=>{let r=o.error?.message||o.message||"Failed to load version";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()}),this.loadRememberMeData(),setTimeout(()=>{this.usernameInput&&this.usernameInput.nativeElement.focus()},100)}loadRememberMeData(){let e=localStorage.getItem("isRememberMe");if(e)try{let t=JSON.parse(e);t.isRememberMe&&(this.loginForm.controls.username.setValue(t.username),this.isRememberMeChecked.set(!0))}catch(t){console.error("Failed to parse remember me data",t)}}togglePasswordVisibility(){this.hidePassword.update(e=>!e)}onCapsLock(e){this.isCapsLockOn.set(e.getModifierState&&e.getModifierState("CapsLock"))}login(){if(this.loginForm.invalid){this.toasterService.error("Please enter username and password");return}let e=this.loginForm.value.username,t=this.loginForm.value.password;this.isLoading.set(!0),this.loginService.login(this.controller,e,t).subscribe({next:async o=>{let r=this.controller;r.authToken=o.access_token,o.refresh_token&&localStorage.setItem(`refresh_token_${r.id}`,o.refresh_token),r.username=e,r.password=t,r.tokenExpired=!1,await this.controllerService.update(r),this.connectionManager.establishConnection(r),this.handleRememberMe(e),this.isLoading.set(!1),this.cd.markForCheck(),this.returnUrl().length<=1?this.router.navigate(["/controller",this.controller.id,"projects"]):this.router.navigateByUrl(this.returnUrl())},error:o=>{this.isLoading.set(!1);let r=o.error?.message||o.message||"Authentication failed";this.toasterService.error(r),this.cd.markForCheck()}})}handleRememberMe(e){if(this.isRememberMeChecked()){let t={username:e,isRememberMe:!0};localStorage.setItem("isRememberMe",JSON.stringify(t))}else localStorage.removeItem("isRememberMe")}onRememberMeChange(e){this.isRememberMeChecked.set(e)}get controllerName(){return this.controller?.name||""}get controllerAddress(){return this.controller?`${this.controller.host}:${this.controller.port}`:""}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-login"]],viewQuery:function(t,o){if(t&1&&xn(Vte,5),t&2){let r;mt(r=pt())&&(o.usernameInput=r.first)}},decls:46,vars:19,consts:[["usernameInput",""],[1,"login-wrapper"],["routerLink","/controllers",1,"login-back-btn"],["svgIcon","gns3",1,"login-back-btn__icon"],["svgIcon","gns3black",1,"login-back-btn__icon"],[1,"login-card"],[1,"login-card__mat-card"],[1,"login-card__header"],[1,"login-card__logo"],["svgIcon","gns3",1,"login-card__icon"],["svgIcon","gns3black",1,"login-card__icon"],[1,"login-card__title"],[1,"login-card__controller-info"],[1,"login-card__form",3,"ngSubmit","formGroup"],[1,"login-card__form-field"],["matPrefix","",1,"login-card__field-icon"],["matInput","","formControlName","username","placeholder","Username"],["matInput","","formControlName","password","placeholder","Password",3,"keyup","type"],["matSuffix","",1,"login-card__visibility-icon",3,"click"],[1,"login-card__caps-lock-warning"],[1,"login-card__checkbox"],["color","primary",3,"change","checked"],[1,"login-card__actions"],["type","submit","mat-raised-button","","color","primary",1,"login-card__submit-btn",3,"disabled"],["diameter","20","mode","indeterminate",1,"login-card__spinner"],[1,"login-card__social"],["href","https://github.com/GNS3","target","_blank","rel","noopener noreferrer","matTooltip","GitHub",1,"login-card__social-link"],["svgIcon","github",1,"login-card__social-icon"],["href","https://www.gns3.com/","target","_blank","rel","noopener noreferrer","matTooltip","Website",1,"login-card__social-link"],["svgIcon","gns3",1,"login-card__social-icon"],["svgIcon","gns3black",1,"login-card__social-icon"],[1,"login-card__footer"],[1,"login-card__controller-icon"],[1,"login-card__controller-details"],[1,"login-card__controller-name"],[1,"login-card__controller-address"],[1,"login-card__warning-icon"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"a",2),A(2,Bte,1,0,"mat-icon",3),A(3,zte,1,0,"mat-icon",4),l(),s(4,"div",5)(5,"mat-card",6)(6,"div",7)(7,"div",8),A(8,jte,1,0,"mat-icon",9),A(9,$te,1,0,"mat-icon",10),s(10,"div",11)(11,"h1"),d(12,"GNS3"),l(),s(13,"h6"),d(14),l()()()(),A(15,Hte,8,2,"div",12),s(16,"form",13),g("ngSubmit",function(){return o.login()}),s(17,"mat-form-field",14)(18,"mat-icon",15),d(19,"person"),l(),R(20,"input",16,0),A(22,Ute,2,0,"mat-error"),l(),s(23,"mat-form-field",14)(24,"mat-icon",15),d(25,"lock"),l(),s(26,"input",17),g("keyup",function(a){return o.onCapsLock(a)}),l(),s(27,"mat-icon",18),g("click",function(){return o.togglePasswordVisibility()}),d(28),l(),A(29,Gte,2,0,"mat-error"),l(),A(30,Wte,5,0,"div",19),s(31,"div",20)(32,"mat-checkbox",21),g("change",function(a){return o.onRememberMeChange(a.checked)}),d(33," Remember me "),l()(),s(34,"div",22)(35,"button",23),A(36,qte,1,0,"mat-progress-spinner",24)(37,Qte,2,0,"span"),l()()()(),s(38,"div",25)(39,"a",26),R(40,"mat-icon",27),l(),s(41,"a",28),A(42,Xte,1,0,"mat-icon",29),A(43,Kte,1,0,"mat-icon",30),l()(),s(44,"div",31),d(45),l()()()),t&2&&(m(2),O(o.isLightThemeEnabled()?-1:2),m(),O(o.isLightThemeEnabled()?3:-1),m(5),O(o.isLightThemeEnabled()?-1:8),m(),O(o.isLightThemeEnabled()?9:-1),m(5),ee("v",o.version()),m(),O(o.controllerName?15:-1),m(),C("formGroup",o.loginForm),m(6),O(o.loginForm.controls.username.hasError("required")?22:-1),m(4),C("type",o.hidePassword()?"password":"text"),m(2),ee(" ",o.hidePassword()?"visibility_off":"visibility"," "),m(),O(o.loginForm.controls.password.hasError("required")?29:-1),m(),O(o.isCapsLockOn()?30:-1),m(2),C("checked",o.isRememberMeChecked()),m(3),C("disabled",o.isLoading()),m(),O(o.isLoading()?36:37),m(6),O(o.isLightThemeEnabled()?-1:42),m(),O(o.isLightThemeEnabled()?43:-1),m(2),ui("GNS3 Web-UI \xA92018-",o.currentYear," v",o.version()))},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,dt,vn,Mt,On,we,Me,fi,Gs,Mi,Se,Ee,Ot,Gt,W,pe,ie,de,pn,li],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100vh;background:var(--mat-sys-background)}.login-back-btn[_ngcontent-%COMP%]{position:fixed;top:24px;left:24px;display:flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:12px;background:var(--mat-sys-surface);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent);transition:all .2s cubic-bezier(.4,0,.2,1);text-decoration:none;z-index:100;animation:_ngcontent-%COMP%_fadeIn .3s ease-out}.login-back-btn[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container);box-shadow:0 6px 16px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent);transform:translateY(-2px)}.login-back-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.login-back-btn__icon[_ngcontent-%COMP%]{font-size:28px;width:28px;height:28px;color:var(--mat-sys-on-surface);display:flex;align-items:center;justify-content:center;line-height:1;overflow:visible}.login-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:100vh;padding:20px;background:linear-gradient(135deg,var(--mat-sys-primary-container) 0%,var(--mat-sys-background) 100%)}.login-card[_ngcontent-%COMP%]{width:100%;max-width:480px;animation:_ngcontent-%COMP%_slideInUp .4s cubic-bezier(.4,0,.2,1)}.login-card__mat-card[_ngcontent-%COMP%]{padding:32px;border-radius:16px;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);background:var(--mat-sys-surface);transition:box-shadow .3s cubic-bezier(.4,0,.2,1)}.login-card__mat-card[_ngcontent-%COMP%]:hover{box-shadow:0 12px 40px color-mix(in srgb,var(--mat-sys-shadow) 25%,transparent),0 4px 12px color-mix(in srgb,var(--mat-sys-shadow) 12%,transparent)}.login-card__header[_ngcontent-%COMP%]{margin-bottom:24px}.login-card__logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:16px;padding:16px 0}.login-card__icon[_ngcontent-%COMP%]{height:72px;width:72px;font-size:72px;display:flex;align-items:center;justify-content:center;line-height:1;overflow:visible}.login-card__title[_ngcontent-%COMP%]{text-align:left}.login-card__title[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:36px;font-weight:500;margin:0;color:var(--mat-sys-on-surface);line-height:1.2}.login-card__title[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-size:14px;font-weight:400;margin:4px 0 0;color:var(--mat-sys-on-surface-variant);opacity:.8}.login-card__controller-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 16px;margin-bottom:24px;border-radius:12px;background:color-mix(in srgb,var(--mat-sys-primary) 8%,transparent);border:1px solid color-mix(in srgb,var(--mat-sys-primary) 20%,transparent);animation:_ngcontent-%COMP%_fadeIn .3s ease-in}.login-card__controller-icon[_ngcontent-%COMP%]{font-size:24px;width:24px;height:24px;color:var(--mat-sys-primary)}.login-card__controller-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;flex:1}.login-card__controller-name[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface)}.login-card__controller-address[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.8}.login-card__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.login-card__form-field[_ngcontent-%COMP%]{width:100%}.login-card__form-field[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant)}.login-card__field-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;margin-right:8px}.login-card__visibility-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;cursor:pointer;color:var(--mat-sys-on-surface-variant);transition:color .2s ease,transform .2s ease}.login-card__visibility-icon[_ngcontent-%COMP%]:hover{color:var(--mat-sys-primary);transform:scale(1.1)}.login-card__visibility-icon[_ngcontent-%COMP%]:active{transform:scale(.95)}.login-card__caps-lock-warning[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;margin-top:-8px;border-radius:8px;background:color-mix(in srgb,var(--mat-sys-error) 10%,transparent);color:var(--mat-sys-error);font-size:13px;animation:_ngcontent-%COMP%_shake .4s cubic-bezier(.4,0,.2,1)}.login-card__warning-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.login-card__checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:8px}.login-card__actions[_ngcontent-%COMP%]{margin-top:16px}.login-card__submit-btn[_ngcontent-%COMP%]{width:100%;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1);position:relative}.login-card__submit-btn[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.login-card__submit-btn[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.login-card__submit-btn[disabled][_ngcontent-%COMP%]{opacity:.6}.login-card__spinner[_ngcontent-%COMP%]{display:inline-flex;margin:0 auto;--mat-progress-spinner-indeterminate-circle-size: 20px}@keyframes _ngcontent-%COMP%_slideInUp{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_shake{0%,to{transform:translate(0)}25%{transform:translate(-4px)}75%{transform:translate(4px)}}@media(max-width:600px){.login-back-btn[_ngcontent-%COMP%]{top:16px;left:16px;width:40px;height:40px}.login-back-btn__icon[_ngcontent-%COMP%]{font-size:24px;width:24px;height:24px}.login-wrapper[_ngcontent-%COMP%]{padding:16px}.login-card__mat-card[_ngcontent-%COMP%]{padding:24px}.login-card__icon[_ngcontent-%COMP%]{height:56px;width:56px;font-size:56px}.login-card__title[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:28px}.login-card__submit-btn[_ngcontent-%COMP%]{height:44px;font-size:15px}}.login-card__social[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:24px}.login-card__social-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:var(--mat-sys-on-surface-variant);background-color:var(--mat-sys-surface-container);transition:all .2s cubic-bezier(.4,0,.2,1);text-decoration:none}.login-card__social-link[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);color:var(--mat-sys-primary);transform:translateY(-2px);box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.login-card__social-link[_ngcontent-%COMP%]:active{transform:translateY(0)}.login-card__social-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;display:flex;align-items:center;justify-content:center;line-height:1;overflow:visible}.login-card__footer[_ngcontent-%COMP%]{text-align:center;margin-top:24px;font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.7}"],changeDetection:0})}return n})();var m8=(()=>{class n{constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-page-not-found"]],decls:7,vars:0,consts:[[1,"content"],[1,"default-header"],["mat-button","","routerLink","/controllers"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1),R(2,"br"),s(3,"h1"),d(4,"404 Page not found"),l(),s(5,"button",2),d(6,"Navigate to homepage"),l()()())},dependencies:[vn],styles:["div[_ngcontent-%COMP%]{text-align:center}"],changeDetection:0})}return n})();var nx=(()=>{class n{route=f(lt);controllerId=ae("");ngOnInit(){this.controllerId.set(this.route.snapshot.paramMap.get("controller_id")??"")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-built-in-preferences"]],decls:21,vars:4,consts:[[1,"builtin-prefs"],[1,"builtin-prefs__header"],["mat-icon-button","",1,"builtin-prefs__back-btn",3,"routerLink"],[1,"builtin-prefs__title"],[1,"builtin-prefs__content"],[1,"builtin-prefs__nav-list"],["mat-list-item","",1,"builtin-prefs__nav-item",3,"routerLink"],[1,"builtin-prefs__nav-icon"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1)(2,"button",2)(3,"mat-icon"),d(4,"arrow_back"),l()(),s(5,"h1",3),d(6,"Built-in templates"),l()(),s(7,"main",4)(8,"nav",5)(9,"a",6)(10,"mat-icon",7),d(11,"device_hub"),l(),d(12," Ethernet hub templates "),l(),s(13,"a",6)(14,"mat-icon",7),d(15,"settings_ethernet"),l(),d(16," Ethernet switch templates "),l(),s(17,"a",6)(18,"mat-icon",7),d(19,"cloud"),l(),d(20," Cloud node templates "),l()()()()),t&2&&(m(2),C("routerLink","/controller/"+o.controllerId()+"/preferences"),m(7),C("routerLink","/controller/"+o.controllerId()+"/preferences/builtin/ethernet-hubs"),m(4),C("routerLink","/controller/"+o.controllerId()+"/preferences/builtin/ethernet-switches"),m(4),C("routerLink","/controller/"+o.controllerId()+"/preferences/builtin/cloud-nodes"))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Wd],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.builtin-prefs__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.builtin-prefs__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.builtin-prefs__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.builtin-prefs__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.builtin-prefs__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.builtin-prefs__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.builtin-prefs__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.builtin-prefs__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.builtin-prefs__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.builtin-prefs__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.builtin-prefs__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.builtin-prefs__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.builtin-prefs__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.builtin-prefs__title[_ngcontent-%COMP%]{font-size:24px}.builtin-prefs__content[_ngcontent-%COMP%]{padding:0 16px 16px}.builtin-prefs__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}}"],changeDetection:0})}return n})();var Yte=["input"],Zte=["formField"],Jte=["*"],ix=class{source;value;constructor(i,e){this.source=i,this.value=e}},ene={provide:ud,useExisting:ad(()=>xo),multi:!0},p8=new cn("MatRadioGroup"),tne=new cn("mat-radio-default-options",{providedIn:"root",factory:()=>({color:"accent",disabledInteractive:!1})}),xo=(()=>{class n{_changeDetector=f(Q);_value=null;_name=f(Mo).getId("mat-radio-group-");_selected=null;_isInitialized=!1;_labelPosition="after";_disabled=!1;_required=!1;_buttonChanges;_controlValueAccessorChangeFn=()=>{};onTouched=()=>{};change=new ve;_radios;color;get name(){return this._name}set name(e){this._name=e,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(e){this._labelPosition=e==="before"?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(e){this._selected=e,this.value=e?e.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markRadiosForCheck()}get required(){return this._required}set required(e){this._required=e,this._markRadiosForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markRadiosForCheck()}_disabledInteractive=!1;constructor(){}ngAfterContentInit(){this._isInitialized=!0,this._buttonChanges=this._radios.changes.subscribe(()=>{this.selected&&!this._radios.find(e=>e===this.selected)&&(this._selected=null)})}ngOnDestroy(){this._buttonChanges?.unsubscribe()}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(e=>{e.name=this.name,e._markForCheck()})}_updateSelectedRadioFromValue(){let e=this._selected!==null&&this._selected.value===this._value;this._radios&&!e&&(this._selected=null,this._radios.forEach(t=>{t.checked=this.value===t.value,t.checked&&(this._selected=t)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new ix(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(e=>e._markForCheck())}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetector.markForCheck()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,ho,5),t&2){let a;mt(a=pt())&&(o._radios=a)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:[2,"disabled","disabled",Ct],required:[2,"required","required",Ct],disabledInteractive:[2,"disabledInteractive","disabledInteractive",Ct]},outputs:{change:"change"},exportAs:["matRadioGroup"],features:[fn([ene,{provide:p8,useExisting:n}])]})}return n})(),ho=(()=>{class n{_elementRef=f(Zt);_changeDetector=f(Q);_focusMonitor=f(Aa);_radioDispatcher=f(Yu);_defaultOptions=f(tne,{optional:!0});_ngZone=f(Vi);_renderer=f(Si);_uniqueId=f(Mo).getId("mat-radio-");_cleanupClick;id=this._uniqueId;name;ariaLabel;ariaLabelledby;ariaDescribedby;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked!==e&&(this._checked=e,e&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!e&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),e&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this.radioGroup!==null&&(this.checked||(this.checked=this.radioGroup.value===e),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(e){this._labelPosition=e}_labelPosition;get disabled(){return this._disabled||this.radioGroup!==null&&this.radioGroup.disabled}set disabled(e){this._setDisabled(e)}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(e){e!==this._required&&this._changeDetector.markForCheck(),this._required=e}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._defaultOptions&&this._defaultOptions.color||"accent"}set color(e){this._color=e}_color;get disabledInteractive(){return this._disabledInteractive||this.radioGroup!==null&&this.radioGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new ve;radioGroup;get inputId(){return`${this.id||this._uniqueId}-input`}_checked=!1;_disabled=!1;_required=!1;_value=null;_removeUniqueSelectionListener=()=>{};_previousTabIndex;_inputElement;_rippleTrigger;_noopAnimations=qo();_injector=f(Jo);constructor(){f(cr).load(ia);let e=f(p8,{optional:!0}),t=f(new sc("tabindex"),{optional:!0});this.radioGroup=e,this._disabledInteractive=this._defaultOptions?.disabledInteractive??!1,t&&(this.tabIndex=No(t,0))}focus(e,t){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name),this._removeUniqueSelectionListener=this._radioDispatcher.listen((e,t)=>{e!==this.id&&t===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{!e&&this.radioGroup&&this.radioGroup._touch()}),this._ngZone.runOutsideAngular(()=>{this._cleanupClick=this._renderer.listen(this._inputElement.nativeElement,"click",this._onInputClick)})}ngOnDestroy(){this._cleanupClick?.(),this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new ix(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputInteraction(e){if(e.stopPropagation(),!this.checked&&!this.disabled){let t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}}_onTouchTargetClick(e){this._onInputInteraction(e),(!this.disabled||this.disabledInteractive)&&this._inputElement?.nativeElement.focus()}_setDisabled(e){this._disabled!==e&&(this._disabled=e,this._changeDetector.markForCheck())}_onInputClick=e=>{this.disabled&&this.disabledInteractive&&e.preventDefault()};_updateTabIndex(){let e=this.radioGroup,t;if(!e||!e.selected||this.disabled?t=this.tabIndex:t=e.selected===this?this.tabIndex:-1,t!==this._previousTabIndex){let o=this._inputElement?.nativeElement;o&&(o.setAttribute("tabindex",t+""),this._previousTabIndex=t,Xa(()=>{queueMicrotask(()=>{e&&e.selected&&e.selected!==this&&document.activeElement===o&&(e.selected?._inputElement.nativeElement.focus(),document.activeElement===o&&this._inputElement.nativeElement.blur())})},{injector:this._injector}))}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-radio-button"]],viewQuery:function(t,o){if(t&1&&xn(Yte,5)(Zte,7,Zt),t&2){let r;mt(r=pt())&&(o._inputElement=r.first),mt(r=pt())&&(o._rippleTrigger=r.first)}},hostAttrs:[1,"mat-mdc-radio-button"],hostVars:19,hostBindings:function(t,o){t&1&&g("focus",function(){return o._inputElement.nativeElement.focus()}),t&2&&(qt("id",o.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),Be("mat-primary",o.color==="primary")("mat-accent",o.color==="accent")("mat-warn",o.color==="warn")("mat-mdc-radio-checked",o.checked)("mat-mdc-radio-disabled",o.disabled)("mat-mdc-radio-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable",o._noopAnimations))},inputs:{id:"id",name:"name",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],disableRipple:[2,"disableRipple","disableRipple",Ct],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:No(e)],checked:[2,"checked","checked",Ct],value:"value",labelPosition:"labelPosition",disabled:[2,"disabled","disabled",Ct],required:[2,"required","required",Ct],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",Ct]},outputs:{change:"change"},exportAs:["matRadioButton"],ngContentSelectors:Jte,decls:13,vars:17,consts:[["formField",""],["input",""],["mat-internal-form-field","",3,"labelPosition"],[1,"mdc-radio"],["aria-hidden","true",1,"mat-mdc-radio-touch-target",3,"click"],["type","radio","aria-invalid","false",1,"mdc-radio__native-control",3,"change","id","checked","disabled","required"],["aria-hidden","true",1,"mdc-radio__background"],[1,"mdc-radio__outer-circle"],[1,"mdc-radio__inner-circle"],["mat-ripple","","aria-hidden","true",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mdc-label",3,"for"]],template:function(t,o){t&1&&(ii(),s(0,"div",2,0)(2,"div",3)(3,"div",4),g("click",function(a){return o._onTouchTargetClick(a)}),l(),s(4,"input",5,1),g("change",function(a){return o._onInputInteraction(a)}),l(),s(6,"div",6),R(7,"div",7)(8,"div",8),l(),s(9,"div",9),R(10,"div",10),l()(),s(11,"label",11),on(12),l()()),t&2&&(C("labelPosition",o.labelPosition),m(2),Be("mdc-radio--disabled",o.disabled),m(2),C("id",o.inputId)("checked",o.checked)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),qt("name",o.name)("value",o.value)("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(5),C("matRippleTrigger",o._rippleTrigger.nativeElement)("matRippleDisabled",o._isRippleDisabled())("matRippleCentered",!0),m(2),C("for",o.inputId))},dependencies:[Us,Ju],styles:[`.mat-mdc-radio-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color;padding:calc((var(--mat-radio-state-layer-size, 40px) - 20px)/2)}.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:not([disabled])~.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-unselected-hover-icon-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-selected-hover-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__inner-circle{background-color:var(--mat-radio-selected-hover-icon-color, var(--mat-sys-primary, currentColor))}.mat-mdc-radio-button .mdc-radio:active>.mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-unselected-pressed-icon-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button .mdc-radio:active>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-selected-pressed-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio:active>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__inner-circle{background-color:var(--mat-radio-selected-pressed-icon-color, var(--mat-sys-primary, currentColor))}.mat-mdc-radio-button .mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mat-mdc-radio-button .mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);width:var(--mat-radio-state-layer-size, 40px);height:var(--mat-radio-state-layer-size, 40px);top:calc(-1*(var(--mat-radio-state-layer-size, 40px) - 20px)/2);left:calc(-1*(var(--mat-radio-state-layer-size, 40px) - 20px)/2)}.mat-mdc-radio-button .mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-radio-button .mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0);border-radius:50%;transition:transform 90ms cubic-bezier(0.4, 0, 0.6, 1),background-color 90ms cubic-bezier(0.4, 0, 0.6, 1)}@media(forced-colors: active){.mat-mdc-radio-button .mdc-radio__inner-circle{background-color:CanvasText !important}}.mat-mdc-radio-button .mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;top:0;right:0;left:0;cursor:inherit;z-index:1;width:var(--mat-radio-state-layer-size, 40px);height:var(--mat-radio-state-layer-size, 40px)}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background,.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 90ms cubic-bezier(0, 0, 0.2, 1),transform 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__outer-circle{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__inner-circle{transition:transform 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 1),transform 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-disabled-unselected-icon-color, var(--mat-sys-on-surface));opacity:var(--mat-radio-disabled-unselected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background{cursor:default}.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-disabled-selected-icon-color, var(--mat-sys-on-surface));opacity:var(--mat-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__inner-circle{background-color:var(--mat-radio-disabled-selected-icon-color, var(--mat-sys-on-surface, currentColor));opacity:var(--mat-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-unselected-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-radio-button .mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-selected-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__inner-circle{background-color:var(--mat-radio-selected-icon-color, var(--mat-sys-primary, currentColor))}.mat-mdc-radio-button .mdc-radio__native-control:enabled:focus:checked+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-selected-focus-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio__native-control:enabled:focus:checked+.mdc-radio__background>.mdc-radio__inner-circle{background-color:var(--mat-radio-selected-focus-icon-color, var(--mat-sys-primary, currentColor))}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__inner-circle{transform:scale(0.5);transition:transform 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled{pointer-events:auto}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-disabled-unselected-icon-color, var(--mat-sys-on-surface));opacity:var(--mat-radio-disabled-unselected-icon-opacity, 0.38)}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled:hover .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control:checked:focus+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-disabled-selected-icon-color, var(--mat-sys-on-surface));opacity:var(--mat-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled:hover .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control:checked:focus+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control+.mdc-radio__background>.mdc-radio__inner-circle{background-color:var(--mat-radio-disabled-selected-icon-color, var(--mat-sys-on-surface, currentColor));opacity:var(--mat-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button label{cursor:pointer}.mat-mdc-radio-button label:empty{display:none}.mat-mdc-radio-button .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element,.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color, var(--mat-sys-primary))}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mat-ripple-element,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button .mat-internal-form-field{color:var(--mat-radio-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-radio-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-radio-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-radio-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-radio-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-radio-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple>.mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button .mdc-radio>.mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mat-radio-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button.cdk-focused .mat-focus-indicator::before{content:""}.mat-mdc-radio-disabled{cursor:default;pointer-events:none}.mat-mdc-radio-disabled.mat-mdc-radio-disabled-interactive{pointer-events:auto}.mat-mdc-radio-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-radio-touch-target-size, 48px);width:var(--mat-radio-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-radio-touch-target-display, block)}[dir=rtl] .mat-mdc-radio-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}
`],encapsulation:2,changeDetection:0})}return n})(),io=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[mc,ho,hi]})}return n})();var ox,nne=new Uint8Array(16);function QD(){if(!ox&&(ox=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!ox))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ox(nne)}var u8=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ine(n){return typeof n=="string"&&u8.test(n)}var h8=ine;var ca=[];for(rx=0;rx<256;++rx)ca.push((rx+256).toString(16).substr(1));var rx;function one(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(ca[n[i+0]]+ca[n[i+1]]+ca[n[i+2]]+ca[n[i+3]]+"-"+ca[n[i+4]]+ca[n[i+5]]+"-"+ca[n[i+6]]+ca[n[i+7]]+"-"+ca[n[i+8]]+ca[n[i+9]]+"-"+ca[n[i+10]]+ca[n[i+11]]+ca[n[i+12]]+ca[n[i+13]]+ca[n[i+14]]+ca[n[i+15]]).toLowerCase();if(!h8(e))throw TypeError("Stringified UUID is invalid");return e}var f8=one;function rne(n,i,e){n=n||{};var t=n.random||(n.rng||QD)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,i){e=e||0;for(var o=0;o<16;++o)i[e+o]=t[o];return i}return f8(t)}var Ai=rne;var yr=(()=>{class n{httpController;constructor(e){this.httpController=e}getTemplates(e){return this.httpController.get(e,"/templates")}getTemplate(e,t){return this.httpController.get(e,`/templates/${t}`)}addTemplate(e,t){return this.httpController.post(e,"/templates",t)}saveTemplate(e,t){return this.httpController.put(e,`/templates/${t.template_id}`,t)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var xa=(()=>{class n{getQemuTemplate(){return Nn({adapter_type:"e1000",adapters:4,bios_image:"",boot_priority:"c",builtin:!1,category:"guest",cdrom_image:"",compute_id:"local",console_auto_start:!1,console_type:"telnet",aux_type:"none",cpu_throttling:0,cpus:1,maxcpus:1,create_config_disk:!1,custom_adapters:[],default_name_format:"{name}-{0}",first_port_name:"",hda_disk_image:"",hda_disk_interface:"ide",hdb_disk_image:"",hdb_disk_interface:"ide",hdc_disk_image:"",hdc_disk_interface:"ide",hdd_disk_image:"",hdd_disk_interface:"ide",initrd:"",kernel_command_line:"",kernel_image:"",linked_clone:!0,mac_address:"",name:"",on_close:"power_off",options:"-nographic",platform:"",port_name_format:"Ethernet{0}",port_segment_size:0,process_priority:"normal",qemu_path:"",ram:256,symbol:"qemu_guest",template_id:"",template_type:"qemu",usage:"",replicate_network_connection_state:!0,tpm:!1,uefi:!1,tags:[]})}getVpcsTemplate(){return Nn({base_script_file:"vpcs_base_config.txt",builtin:!1,category:"guest",compute_id:"local",console_auto_start:!1,console_type:"telnet",default_name_format:"PC{0}",name:"",symbol:"vpcs_guest",template_id:"",template_type:"vpcs",tags:[]})}getVirtualBoxTemplate(){return Nn({adapter_type:"Intel PRO/1000 MT Desktop (82540EM)",adapters:1,builtin:!1,category:"guest",compute_id:"local",console_auto_start:!1,console_type:"none",custom_adapters:[],default_name_format:"{name}-{0}",first_port_name:"",headless:!1,linked_clone:!1,name:"",on_close:"power_off",port_name_format:"Ethernet{0}",port_segment_size:0,ram:0,symbol:"vbox_guest",template_id:"",template_type:"virtualbox",usage:"",use_any_adapter:!1,vmname:"",tags:[]})}getCloudNodeTemplate(){return Nn({builtin:!1,category:"guest",compute_id:"local",default_name_format:"Cloud{0}",name:"",ports_mapping:[],remote_console_type:"none",symbol:"cloud",template_id:"",template_type:"cloud",tags:[]})}getEthernetHubTemplate(){return Nn({builtin:!1,category:"switch",compute_id:"local",default_name_format:"Hub{0}",name:"",ports_mapping:[],symbol:"hub",template_id:"",template_type:"ethernet_hub",tags:[]})}getEthernetSwitchTemplate(){return Nn({builtin:!1,category:"switch",compute_id:"local",console_type:"telnet",default_name_format:"Switch{0}",name:"",ports_mapping:[],symbol:"ethernet_switch",template_id:"",template_type:"ethernet_switch",tags:[]})}getIosTemplate(){return Nn({auto_delete_disks:!0,builtin:!1,category:"router",compute_id:"local",console_auto_start:!1,console_type:"telnet",aux_type:"none",default_name_format:"R{0}",disk0:0,disk1:0,exec_area:64,idlemax:500,idlepc:"",idlesleep:30,image:"",mac_addr:"",mmap:!0,name:"",nvram:128,platform:"",private_config:"",ram:128,sparsemem:!0,startup_config:"ios_base_startup-config.txt",symbol:"router",system_id:"FTX0945W0MY",template_id:"",template_type:"dynamips",usage:"",tags:[]})}getVmwareTemplate(){return Nn({adapter_type:"e1000",adapters:1,builtin:!1,category:"guest",compute_id:"local",console_auto_start:!1,console_type:"none",custom_adapters:[],default_name_format:"{name}-{0}",first_port_name:"",headless:!1,linked_clone:!1,name:"",on_close:"power_off",port_name_format:"Ethernet{0}",port_segment_size:0,symbol:"vmware_guest",template_id:"",template_type:"vmware",usage:"",use_any_adapter:!1,vmx_path:"",tags:[]})}getDockerTemplate(){return Nn({adapters:1,builtin:!1,category:"guest",compute_id:"vm",console_auto_start:!1,console_http_path:"/",console_http_port:80,console_resolution:"1024x768",console_type:"telnet",aux_type:"none",mac_address:"",custom_adapters:[],default_name_format:"{name}-{0}",environment:"",extra_hosts:"",extra_volumes:[],image:"",memory:0,cpus:0,name:"",start_command:"",symbol:"docker_guest",template_id:"",template_type:"docker",usage:"",tags:[]})}getIouTemplate(){return Nn({builtin:!1,category:"switch",compute_id:"vm",console_auto_start:!1,console_type:"telnet",default_name_format:"IOU{0}",ethernet_adapters:1,l1_keepalives:!1,name:"",nvram:128,path:"",private_config:"",ram:256,serial_adapters:0,startup_config:"iou_l2_base_startup-config.txt",symbol:"multilayer_switch",template_id:"",template_type:"iou",usage:"",use_default_iou_values:!0,tags:[]})}list(){return Nn([])}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function ane(n,i){if(n&1){let e=z();s(0,"button",14),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var ax=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);router=f(ht);toasterService=f(te);templateMocksService=f(xa);formBuilder=f(Vn);computeService=f(ko);cd=f(Q);controller;templateName="";formGroup;isLocalComputerChosen=!0;constructor(){this.formGroup=this.formBuilder.group({templateName:new Ye("",Ue.required)})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}setControllerType(e){e==="local"&&(this.isLocalComputerChosen=!0)}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","builtin","cloud-nodes"])}addTemplate(){if(this.formGroup.invalid)this.toasterService.error("Fill all required fields");else{let e;this.templateMocksService.getCloudNodeTemplate().subscribe({next:t=>{e=t,e.template_id=Ai(),e.name=this.formGroup.get("templateName").value,e.compute_id="local",this.builtInTemplatesService.addTemplate(this.controller,e).subscribe({next:()=>{this.goBack()},error:o=>{let r=o.error?.message||o.message||"Failed to add cloud node template";this.toasterService.error(r),this.cd.markForCheck()}})},error:t=>{let o=t.error?.message||t.message||"Failed to load template";this.toasterService.error(o),this.cd.markForCheck()}})}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-cloud-nodes-add-template"]],decls:20,vars:3,consts:[[1,"cloud-nodes-add"],[1,"cloud-nodes-add__header"],["mat-icon-button","",1,"cloud-nodes-add__back-btn"],[1,"cloud-nodes-add__title"],[1,"cloud-nodes-add__content"],[1,"cloud-nodes-add__form-card"],[1,"cloud-nodes-add__radio-group"],["value","1",1,"cloud-nodes-add__radio",3,"click","checked"],[1,"cloud-nodes-add__form",3,"formGroup"],["appearance","fill",1,"cloud-nodes-add__field"],["formControlName","templateName","matInput","","type","text","placeholder","Template name"],[1,"cloud-nodes-add__actions"],["mat-button","",1,"cloud-nodes-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"cloud-nodes-add__submit-btn",3,"click"],["mat-icon-button","",1,"cloud-nodes-add__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,ane,3,0,"button",2),s(3,"h1",3),d(4,"New cloud node template"),l()(),s(5,"main",4)(6,"section",5)(7,"mat-radio-group",6)(8,"mat-radio-button",7),g("click",function(){return o.setControllerType("local")}),d(9," Run the cloud node locally "),l()(),s(10,"form",8)(11,"mat-form-field",9)(12,"mat-label"),d(13,"Template name"),l(),R(14,"input",10),l()()(),s(15,"div",11)(16,"button",12),g("click",function(){return o.goBack()}),d(17,"Cancel"),l(),s(18,"button",13),g("click",function(){return o.addTemplate()}),d(19," Add template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",o.formGroup))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,dt,ie,de,W,pe,je,Mt,io,xo,ho,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.cloud-nodes-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.cloud-nodes-add__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.cloud-nodes-add__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.cloud-nodes-add__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.cloud-nodes-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.cloud-nodes-add__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.cloud-nodes-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.cloud-nodes-add__radio[_ngcontent-%COMP%]{font-size:16px}.cloud-nodes-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.cloud-nodes-add__field[_ngcontent-%COMP%]{width:100%}.cloud-nodes-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.cloud-nodes-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.cloud-nodes-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.cloud-nodes-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.cloud-nodes-add__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.cloud-nodes-add__title[_ngcontent-%COMP%]{font-size:24px}.cloud-nodes-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.cloud-nodes-add__form-card[_ngcontent-%COMP%]{padding:16px}.cloud-nodes-add__actions[_ngcontent-%COMP%]{flex-direction:column}.cloud-nodes-add__cancel-btn[_ngcontent-%COMP%], .cloud-nodes-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var lne=["*",[["mat-chip-avatar"],["","matChipAvatar",""]],[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],cne=["*","mat-chip-avatar, [matChipAvatar]","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function dne(n,i){n&1&&(s(0,"span",3),on(1,1),l())}function mne(n,i){n&1&&(s(0,"span",6),on(1,2),l())}var pne=`.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mat-chip-outline-width, 1px);border-radius:var(--mat-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mat-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mat-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mat-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mat-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-leading-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-leading-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-leading-action.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--secondary{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--secondary{color:var(--mat-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--secondary{color:var(--mat-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mat-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mat-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mat-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mat-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mat-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mat-chip-with-avatar-avatar-size, 24px);height:var(--mat-chip-with-avatar-avatar-size, 24px);font-size:var(--mat-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-leading-action .mdc-evolution-chip__graphic{padding-left:0}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mat-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mat-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mat-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mat-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mat-chip-container-shape-radius, 8px);height:var(--mat-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mat-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mat-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mat-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mat-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mat-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mat-chip-with-icon-icon-size, 18px);height:var(--mat-chip-with-icon-icon-size, 18px);font-size:var(--mat-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mat-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mat-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mat-chip-with-icon-icon-color: var(--mat-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mat-chip-elevated-container-color: var(--mat-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mat-chip-label-text-color: var(--mat-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mat-chip-outline-width: var(--mat-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mat-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mat-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mat-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mat-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mat-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mat-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mat-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mat-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mat-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mat-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mat-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mat-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mat-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-edit,.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-edit:focus,.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-edit::after,.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-edit:hover::after,.mat-mdc-chip-remove:hover::after{opacity:calc(var(--mat-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)) + var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)))}.mat-mdc-chip-edit:focus::after,.mat-mdc-chip-remove:focus::after{opacity:calc(var(--mat-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)) + var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-edit:focus::after,.mat-mdc-chip.cdk-focused .mat-mdc-chip-remove:focus::after{opacity:calc(var(--mat-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)) + var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-edit:hover::after,.mat-mdc-chip.cdk-focused .mat-mdc-chip-remove:hover::after{opacity:calc(var(--mat-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)) + var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mat-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-edit::before,.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-edit::after,.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-edit .mat-icon,.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus-visible .mat-focus-indicator::before{content:""}.mdc-evolution-chip__icon,.mat-mdc-chip-edit .mat-icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}img.mdc-evolution-chip__icon{min-height:0}
`,une=[[["","matChipEdit",""]],[["mat-chip-avatar"],["","matChipAvatar",""]],[["","matChipEditInput",""]],"*",[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],hne=["[matChipEdit]","mat-chip-avatar, [matChipAvatar]","[matChipEditInput]","*","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function fne(n,i){n&1&&R(0,"span",0)}function gne(n,i){n&1&&(s(0,"span",1),on(1),l())}function _ne(n,i){n&1&&(s(0,"span",3),on(1,1),l())}function vne(n,i){n&1&&on(0,2)}function Cne(n,i){n&1&&R(0,"span",7)}function bne(n,i){if(n&1&&A(0,vne,1,0)(1,Cne,1,0,"span",7),n&2){let e=v();O(e.contentEditInput?0:1)}}function xne(n,i){n&1&&on(0,3)}function yne(n,i){n&1&&(s(0,"span",6),on(1,4),l())}var b8=["*"],Sne=`.mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input::placeholder{opacity:1}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input::-moz-placeholder{opacity:1}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input::-webkit-input-placeholder{opacity:1}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input:-ms-input-placeholder{opacity:1}.mat-mdc-chip-set+input.mat-mdc-chip-input{margin-left:0;margin-right:0}
`,x8=new cn("mat-chips-default-options",{providedIn:"root",factory:()=>({separatorKeyCodes:[13]})}),g8=new cn("MatChipAvatar"),_8=new cn("MatChipTrailingIcon"),v8=new cn("MatChipEdit"),KD=new cn("MatChipRemove"),JD=new cn("MatChip"),y8=(()=>{class n{_elementRef=f(Zt);_parentChip=f(JD);_isPrimary=!0;_isLeading=!1;get disabled(){return this._disabled||this._parentChip?.disabled||!1}set disabled(e){this._disabled=e}_disabled=!1;tabIndex=-1;_allowFocusWhenDisabled=!1;_getDisabledAttribute(){return this.disabled&&!this._allowFocusWhenDisabled?"":null}constructor(){f(cr).load(ia),this._elementRef.nativeElement.nodeName==="BUTTON"&&this._elementRef.nativeElement.setAttribute("type","button")}focus(){this._elementRef.nativeElement.focus()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","matChipContent",""]],hostAttrs:[1,"mat-mdc-chip-action","mdc-evolution-chip__action","mdc-evolution-chip__action--presentational"],hostVars:8,hostBindings:function(t,o){t&2&&(qt("disabled",o._getDisabledAttribute())("aria-disabled",o.disabled),Be("mdc-evolution-chip__action--primary",o._isPrimary)("mdc-evolution-chip__action--secondary",!o._isPrimary)("mdc-evolution-chip__action--trailing",!o._isPrimary&&!o._isLeading))},inputs:{disabled:[2,"disabled","disabled",Ct],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?-1:No(e)],_allowFocusWhenDisabled:"_allowFocusWhenDisabled"}})}return n})(),eP=(()=>{class n extends y8{_getTabindex(){return this.disabled&&!this._allowFocusWhenDisabled?null:this.tabIndex.toString()}_handleClick(e){!this.disabled&&this._isPrimary&&(e.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!this.disabled&&this._isPrimary&&!this._parentChip._isEditing&&(e.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matChipAction",""]],hostVars:3,hostBindings:function(t,o){t&1&&g("click",function(a){return o._handleClick(a)})("keydown",function(a){return o._handleKeydown(a)}),t&2&&(qt("tabindex",o._getTabindex()),Be("mdc-evolution-chip__action--presentational",!1))},features:[si]})}return n})();var mi=(()=>{class n extends eP{_isPrimary=!1;_handleClick(e){this.disabled||(e.stopPropagation(),e.preventDefault(),this._parentChip.remove())}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!this.disabled&&(e.stopPropagation(),e.preventDefault(),this._parentChip.remove())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matChipRemove",""]],hostAttrs:["role","button",1,"mat-mdc-chip-remove","mat-mdc-chip-trailing-icon","mat-focus-indicator","mdc-evolution-chip__icon","mdc-evolution-chip__icon--trailing"],hostVars:1,hostBindings:function(t,o){t&2&&qt("aria-hidden",null)},features:[fn([{provide:KD,useExisting:n}]),si]})}return n})(),Jn=(()=>{class n{_changeDetectorRef=f(Q);_elementRef=f(Zt);_tagName=f(AO);_ngZone=f(Vi);_focusMonitor=f(Aa);_globalRippleOptions=f(b4,{optional:!0});_document=f(Xi);_onFocus=new He;_onBlur=new He;_isBasicChip=!1;role=null;_hasFocusInternal=!1;_pendingFocus=!1;_actionChanges;_animationsDisabled=qo();_allLeadingIcons;_allTrailingIcons;_allEditIcons;_allRemoveIcons;_hasFocus(){return this._hasFocusInternal}id=f(Mo).getId("mat-mdc-chip-");ariaLabel=null;ariaDescription=null;_chipListDisabled=!1;_hadFocusOnRemove=!1;_textElement;get value(){return this._value!==void 0?this._value:this._textElement.textContent.trim()}set value(e){this._value=e}_value;color;removable=!0;highlighted=!1;disableRipple=!1;get disabled(){return this._disabled||this._chipListDisabled}set disabled(e){this._disabled=e}_disabled=!1;removed=new ve;destroyed=new ve;basicChipAttrName="mat-basic-chip";leadingIcon;editIcon;trailingIcon;removeIcon;primaryAction;_rippleLoader=f(x4);_injector=f(Jo);constructor(){let e=f(cr);e.load(ia),e.load(bC),this._monitorFocus(),this._rippleLoader?.configureRipple(this._elementRef.nativeElement,{className:"mat-mdc-chip-ripple",disabled:this._isRippleDisabled()})}ngOnInit(){this._isBasicChip=this._elementRef.nativeElement.hasAttribute(this.basicChipAttrName)||this._tagName.toLowerCase()===this.basicChipAttrName}ngAfterViewInit(){this._textElement=this._elementRef.nativeElement.querySelector(".mat-mdc-chip-action-label"),this._pendingFocus&&(this._pendingFocus=!1,this.focus())}ngAfterContentInit(){this._actionChanges=Hn(this._allLeadingIcons.changes,this._allTrailingIcons.changes,this._allEditIcons.changes,this._allRemoveIcons.changes).subscribe(()=>this._changeDetectorRef.markForCheck())}ngDoCheck(){this._rippleLoader.setDisabled(this._elementRef.nativeElement,this._isRippleDisabled())}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement),this._actionChanges?.unsubscribe(),this.destroyed.emit({chip:this}),this.destroyed.complete()}remove(){this.removable&&(this._hadFocusOnRemove=this._hasFocus(),this.removed.emit({chip:this}))}_isRippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||this._isBasicChip||!this._hasInteractiveActions()||!!this._globalRippleOptions?.disabled}_hasTrailingIcon(){return!!(this.trailingIcon||this.removeIcon)}_handleKeydown(e){(e.keyCode===8&&!e.repeat||e.keyCode===46)&&(e.preventDefault(),this.remove())}focus(){this.disabled||(this.primaryAction?this.primaryAction.focus():this._pendingFocus=!0)}_getSourceAction(e){return this._getActions().find(t=>{let o=t._elementRef.nativeElement;return o===e||o.contains(e)})}_getActions(){let e=[];return this.editIcon&&e.push(this.editIcon),this.primaryAction&&e.push(this.primaryAction),this.removeIcon&&e.push(this.removeIcon),e}_handlePrimaryActionInteraction(){}_hasInteractiveActions(){return this._getActions().length>0}_edit(e){}_monitorFocus(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{let t=e!==null;t!==this._hasFocusInternal&&(this._hasFocusInternal=t,t?this._onFocus.next({chip:this}):(this._changeDetectorRef.markForCheck(),setTimeout(()=>this._ngZone.run(()=>this._onBlur.next({chip:this})))))})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,o,r){if(t&1&&Ki(r,g8,5)(r,v8,5)(r,_8,5)(r,KD,5)(r,g8,5)(r,_8,5)(r,v8,5)(r,KD,5),t&2){let a;mt(a=pt())&&(o.leadingIcon=a.first),mt(a=pt())&&(o.editIcon=a.first),mt(a=pt())&&(o.trailingIcon=a.first),mt(a=pt())&&(o.removeIcon=a.first),mt(a=pt())&&(o._allLeadingIcons=a),mt(a=pt())&&(o._allTrailingIcons=a),mt(a=pt())&&(o._allEditIcons=a),mt(a=pt())&&(o._allRemoveIcons=a)}},viewQuery:function(t,o){if(t&1&&xn(eP,5),t&2){let r;mt(r=pt())&&(o.primaryAction=r.first)}},hostAttrs:[1,"mat-mdc-chip"],hostVars:31,hostBindings:function(t,o){t&1&&g("keydown",function(a){return o._handleKeydown(a)}),t&2&&(Wo("id",o.id),qt("role",o.role)("aria-label",o.ariaLabel),er("mat-"+(o.color||"primary")),Be("mdc-evolution-chip",!o._isBasicChip)("mdc-evolution-chip--disabled",o.disabled)("mdc-evolution-chip--with-trailing-action",o._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",o.leadingIcon)("mdc-evolution-chip--with-primary-icon",o.leadingIcon)("mdc-evolution-chip--with-avatar",o.leadingIcon)("mat-mdc-chip-with-avatar",o.leadingIcon)("mat-mdc-chip-highlighted",o.highlighted)("mat-mdc-chip-disabled",o.disabled)("mat-mdc-basic-chip",o._isBasicChip)("mat-mdc-standard-chip",!o._isBasicChip)("mat-mdc-chip-with-trailing-icon",o._hasTrailingIcon())("_mat-animation-noopable",o._animationsDisabled))},inputs:{role:"role",id:"id",ariaLabel:[0,"aria-label","ariaLabel"],ariaDescription:[0,"aria-description","ariaDescription"],value:"value",color:"color",removable:[2,"removable","removable",Ct],highlighted:[2,"highlighted","highlighted",Ct],disableRipple:[2,"disableRipple","disableRipple",Ct],disabled:[2,"disabled","disabled",Ct]},outputs:{removed:"removed",destroyed:"destroyed"},exportAs:["matChip"],features:[fn([{provide:JD,useExisting:n}])],ngContentSelectors:cne,decls:8,vars:2,consts:[[1,"mat-mdc-chip-focus-overlay"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary"],["matChipContent",""],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],[1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"]],template:function(t,o){t&1&&(ii(lne),R(0,"span",0),s(1,"span",1)(2,"span",2),A(3,dne,2,0,"span",3),s(4,"span",4),on(5),R(6,"span",5),l()()(),A(7,mne,2,0,"span",6)),t&2&&(m(3),O(o.leadingIcon?3:-1),m(4),O(o._hasTrailingIcon()?7:-1))},dependencies:[y8],styles:[`.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mat-chip-outline-width, 1px);border-radius:var(--mat-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mat-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mat-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mat-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mat-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-leading-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-leading-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-leading-action.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--secondary{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--secondary{color:var(--mat-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--secondary{color:var(--mat-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--secondary{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mat-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mat-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mat-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mat-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mat-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mat-chip-with-avatar-avatar-size, 24px);height:var(--mat-chip-with-avatar-avatar-size, 24px);font-size:var(--mat-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-leading-action .mdc-evolution-chip__graphic{padding-left:0}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mat-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mat-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mat-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mat-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mat-chip-container-shape-radius, 8px);height:var(--mat-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mat-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mat-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mat-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mat-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mat-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mat-chip-with-icon-icon-size, 18px);height:var(--mat-chip-with-icon-icon-size, 18px);font-size:var(--mat-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mat-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mat-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mat-chip-with-icon-icon-color: var(--mat-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mat-chip-elevated-container-color: var(--mat-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mat-chip-label-text-color: var(--mat-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mat-chip-outline-width: var(--mat-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mat-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mat-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mat-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mat-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mat-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mat-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mat-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mat-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mat-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mat-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mat-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mat-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mat-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-edit,.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-edit:focus,.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-edit::after,.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-edit:hover::after,.mat-mdc-chip-remove:hover::after{opacity:calc(var(--mat-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)) + var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)))}.mat-mdc-chip-edit:focus::after,.mat-mdc-chip-remove:focus::after{opacity:calc(var(--mat-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)) + var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-edit:focus::after,.mat-mdc-chip.cdk-focused .mat-mdc-chip-remove:focus::after{opacity:calc(var(--mat-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)) + var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-edit:hover::after,.mat-mdc-chip.cdk-focused .mat-mdc-chip-remove:hover::after{opacity:calc(var(--mat-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity)) + var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity)))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mat-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-edit::before,.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-edit::after,.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-edit .mat-icon,.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus-visible .mat-focus-indicator::before{content:""}.mdc-evolution-chip__icon,.mat-mdc-chip-edit .mat-icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}img.mdc-evolution-chip__icon{min-height:0}
`],encapsulation:2,changeDetection:0})}return n})();var XD=(()=>{class n{_elementRef=f(Zt);_document=f(Xi);constructor(){}initialize(e){this.getNativeElement().focus(),this.setValue(e)}getNativeElement(){return this._elementRef.nativeElement}setValue(e){this.getNativeElement().textContent=e,this._moveCursorToEndOfInput()}getValue(){return this.getNativeElement().textContent||""}_moveCursorToEndOfInput(){let e=this._document.createRange();e.selectNodeContents(this.getNativeElement()),e.collapse(!1);let t=window.getSelection();t.removeAllRanges(),t.addRange(e)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["span","matChipEditInput",""]],hostAttrs:["role","textbox","tabindex","-1","contenteditable","true",1,"mat-chip-edit-input"]})}return n})(),wne=(()=>{class n extends Jn{basicChipAttrName="mat-basic-chip-row";_renderer=f(Si);_cleanupMousedown;_editStartPending=!1;editable=!1;edited=new ve;defaultEditInput;contentEditInput;_alreadyFocused=!1;_isEditing=!1;constructor(){super(),this.role="row",this._onBlur.pipe(tt(this.destroyed)).subscribe(()=>{this._isEditing&&!this._editStartPending&&this._onEditFinish(),this._alreadyFocused=!1})}ngAfterViewInit(){super.ngAfterViewInit(),this._cleanupMousedown=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"mousedown",()=>{this._alreadyFocused=this._hasFocus()}))}ngOnDestroy(){super.ngOnDestroy(),this._cleanupMousedown?.()}_hasLeadingActionIcon(){return!this._isEditing&&!!this.editIcon}_hasTrailingIcon(){return!this._isEditing&&super._hasTrailingIcon()}_handleFocus(){!this._isEditing&&!this.disabled&&this.focus()}_handleKeydown(e){e.keyCode===13&&!this.disabled?this._isEditing?(e.preventDefault(),this._onEditFinish()):this.editable&&this._startEditing(e):this._isEditing?e.stopPropagation():super._handleKeydown(e)}_handleClick(e){!this.disabled&&this.editable&&!this._isEditing&&this._alreadyFocused&&(e.preventDefault(),e.stopPropagation(),this._startEditing(e))}_handleDoubleclick(e){!this.disabled&&this.editable&&this._startEditing(e)}_edit(){this._changeDetectorRef.markForCheck(),this._startEditing()}_startEditing(e){if(!this.primaryAction||this.removeIcon&&e&&this._getSourceAction(e.target)===this.removeIcon)return;let t=this.value;this._isEditing=this._editStartPending=!0,Xa(()=>{this._getEditInput().initialize(t),setTimeout(()=>this._ngZone.run(()=>this._editStartPending=!1))},{injector:this._injector})}_onEditFinish(){this._isEditing=this._editStartPending=!1,this.edited.emit({chip:this,value:this._getEditInput().getValue()}),(this._document.activeElement===this._getEditInput().getNativeElement()||this._document.activeElement===this._document.body)&&this.primaryAction.focus()}_isRippleDisabled(){return super._isRippleDisabled()||this._isEditing}_getEditInput(){return this.contentEditInput||this.defaultEditInput}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-chip-row"],["","mat-chip-row",""],["mat-basic-chip-row"],["","mat-basic-chip-row",""]],contentQueries:function(t,o,r){if(t&1&&Ki(r,XD,5),t&2){let a;mt(a=pt())&&(o.contentEditInput=a.first)}},viewQuery:function(t,o){if(t&1&&xn(XD,5),t&2){let r;mt(r=pt())&&(o.defaultEditInput=r.first)}},hostAttrs:[1,"mat-mdc-chip","mat-mdc-chip-row","mdc-evolution-chip"],hostVars:29,hostBindings:function(t,o){t&1&&g("focus",function(){return o._handleFocus()})("click",function(a){return o._hasInteractiveActions()?o._handleClick(a):null})("dblclick",function(a){return o._handleDoubleclick(a)}),t&2&&(Wo("id",o.id),qt("tabindex",o.disabled?null:-1)("aria-label",null)("aria-description",null)("role",o.role),Be("mat-mdc-chip-with-avatar",o.leadingIcon)("mat-mdc-chip-disabled",o.disabled)("mat-mdc-chip-editing",o._isEditing)("mat-mdc-chip-editable",o.editable)("mdc-evolution-chip--disabled",o.disabled)("mdc-evolution-chip--with-leading-action",o._hasLeadingActionIcon())("mdc-evolution-chip--with-trailing-action",o._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",o.leadingIcon)("mdc-evolution-chip--with-primary-icon",o.leadingIcon)("mdc-evolution-chip--with-avatar",o.leadingIcon)("mat-mdc-chip-highlighted",o.highlighted)("mat-mdc-chip-with-trailing-icon",o._hasTrailingIcon()))},inputs:{editable:"editable"},outputs:{edited:"edited"},features:[fn([{provide:Jn,useExisting:n},{provide:JD,useExisting:n}]),si],ngContentSelectors:hne,decls:9,vars:8,consts:[[1,"mat-mdc-chip-focus-overlay"],["role","gridcell",1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--leading"],["role","gridcell","matChipAction","",1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary",3,"disabled"],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],["aria-hidden","true",1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],["role","gridcell",1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"],["matChipEditInput",""]],template:function(t,o){t&1&&(ii(une),A(0,fne,1,0,"span",0),A(1,gne,2,0,"span",1),s(2,"span",2),A(3,_ne,2,0,"span",3),s(4,"span",4),A(5,bne,2,1)(6,xne,1,0),R(7,"span",5),l()(),A(8,yne,2,0,"span",6)),t&2&&(O(o._isEditing?-1:0),m(),O(o._hasLeadingActionIcon()?1:-1),m(),C("disabled",o.disabled),qt("aria-description",o.ariaDescription)("aria-label",o.ariaLabel),m(),O(o.leadingIcon?3:-1),m(2),O(o._isEditing?5:6),m(3),O(o._hasTrailingIcon()?8:-1))},dependencies:[eP,XD],styles:[pne],encapsulation:2,changeDetection:0})}return n})(),tP=(()=>{class n{_elementRef=f(Zt);_changeDetectorRef=f(Q);_dir=f(Ka,{optional:!0});_lastDestroyedFocusedChipIndex=null;_keyManager;_destroyed=new He;_defaultRole="presentation";get chipFocusChanges(){return this._getChipStream(e=>e._onFocus)}get chipDestroyedChanges(){return this._getChipStream(e=>e.destroyed)}get chipRemovedChanges(){return this._getChipStream(e=>e.removed)}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._syncChipsState()}_disabled=!1;get empty(){return!this._chips||this._chips.length===0}get role(){return this._explicitRole?this._explicitRole:this.empty?null:this._defaultRole}tabIndex=0;set role(e){this._explicitRole=e}_explicitRole=null;get focused(){return this._hasFocusedChip()}_chips;_chipActions=new Il;constructor(){}ngAfterViewInit(){this._setUpFocusManagement(),this._trackChipSetChanges(),this._trackDestroyedFocusedChip()}ngOnDestroy(){this._keyManager?.destroy(),this._chipActions.destroy(),this._destroyed.next(),this._destroyed.complete()}_hasFocusedChip(){return this._chips&&this._chips.some(e=>e._hasFocus())}_syncChipsState(){this._chips?.forEach(e=>{e._chipListDisabled=this._disabled,e._changeDetectorRef.markForCheck()})}focus(){}_handleKeydown(e){this._originatesFromChip(e)&&this._keyManager.onKeydown(e)}_isValidIndex(e){return e>=0&&e<this._chips.length}_allowFocusEscape(){let e=this._elementRef.nativeElement.tabIndex;e!==-1&&(this._elementRef.nativeElement.tabIndex=-1,setTimeout(()=>this._elementRef.nativeElement.tabIndex=e))}_getChipStream(e){return this._chips.changes.pipe(pi(null),Un(()=>Hn(...this._chips.map(e))))}_originatesFromChip(e){let t=e.target;for(;t&&t!==this._elementRef.nativeElement;){if(t.classList.contains("mat-mdc-chip"))return!0;t=t.parentElement}return!1}_setUpFocusManagement(){this._chips.changes.pipe(pi(this._chips)).subscribe(e=>{let t=[];e.forEach(o=>o._getActions().forEach(r=>t.push(r))),this._chipActions.reset(t),this._chipActions.notifyOnChanges()}),this._keyManager=new Gd(this._chipActions).withVerticalOrientation().withHorizontalOrientation(this._dir?this._dir.value:"ltr").withHomeAndEnd().skipPredicate(e=>this._skipPredicate(e)),this.chipFocusChanges.pipe(tt(this._destroyed)).subscribe(({chip:e})=>{let t=e._getSourceAction(document.activeElement);t&&this._keyManager.updateActiveItem(t)}),this._dir?.change.pipe(tt(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e))}_skipPredicate(e){return e.disabled}_trackChipSetChanges(){this._chips.changes.pipe(pi(null),tt(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>this._syncChipsState()),this._redirectDestroyedChipFocus()})}_trackDestroyedFocusedChip(){this.chipDestroyedChanges.pipe(tt(this._destroyed)).subscribe(e=>{let o=this._chips.toArray().indexOf(e.chip),r=e.chip._hasFocus(),a=e.chip._hadFocusOnRemove&&this._keyManager.activeItem&&e.chip._getActions().includes(this._keyManager.activeItem),c=r||a;this._isValidIndex(o)&&c&&(this._lastDestroyedFocusedChipIndex=o)})}_redirectDestroyedChipFocus(){if(this._lastDestroyedFocusedChipIndex!=null){if(this._chips.length){let e=Math.min(this._lastDestroyedFocusedChipIndex,this._chips.length-1),t=this._chips.toArray()[e];t.disabled?this._chips.length===1?this.focus():this._keyManager.setPreviousItemActive():t.focus()}else this.focus();this._lastDestroyedFocusedChipIndex=null}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-chip-set"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,Jn,5),t&2){let a;mt(a=pt())&&(o._chips=a)}},hostAttrs:[1,"mat-mdc-chip-set","mdc-evolution-chip-set"],hostVars:1,hostBindings:function(t,o){t&1&&g("keydown",function(a){return o._handleKeydown(a)}),t&2&&qt("role",o.role)},inputs:{disabled:[2,"disabled","disabled",Ct],role:"role",tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:No(e)]},ngContentSelectors:b8,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(t,o){t&1&&(ii(),vo(0,"div",0),on(1),wo())},styles:[`.mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input::placeholder{opacity:1}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input::-moz-placeholder{opacity:1}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input::-webkit-input-placeholder{opacity:1}.mat-mdc-form-field:not(.mat-form-field-hide-placeholder) input.mat-mdc-chip-input:-ms-input-placeholder{opacity:1}.mat-mdc-chip-set+input.mat-mdc-chip-input{margin-left:0;margin-right:0}
`],encapsulation:2,changeDetection:0})}return n})();var YD=class{source;value;constructor(i,e){this.source=i,this.value=e}},vi=(()=>{class n extends tP{ngControl=f(_C,{optional:!0,self:!0});controlType="mat-chip-grid";_chipInput;_defaultRole="grid";_errorStateTracker;_uid=f(Mo).getId("mat-chip-grid-");_ariaDescribedbyIds=[];_onTouched=()=>{};_onChange=()=>{};get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(e){this._disabled=e,this._syncChipsState(),this.stateChanges.next()}get id(){return this._chipInput?this._chipInput.id:this._uid}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this._chips||this._chips.length===0)}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder="";get focused(){return this._chipInput?.focused||this._hasFocusedChip()}get required(){return this._required??this.ngControl?.control?.hasValidator(Ue.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get shouldLabelFloat(){return!this.empty||this.focused}get value(){return this._value}set value(e){this._value=e}_value=[];get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}get chipBlurChanges(){return this._getChipStream(e=>e._onBlur)}change=new ve;valueChange=new ve;_chips=void 0;stateChanges=new He;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}constructor(){super();let e=f(Gn,{optional:!0}),t=f(Rt,{optional:!0}),o=f(fd);this.ngControl&&(this.ngControl.valueAccessor=this),this._errorStateTracker=new TC(o,this.ngControl,t,e,this.stateChanges)}ngAfterContentInit(){this.chipBlurChanges.pipe(tt(this._destroyed)).subscribe(()=>{this._blur(),this.stateChanges.next()}),Hn(this.chipFocusChanges,this._chips.changes).pipe(tt(this._destroyed)).subscribe(()=>this.stateChanges.next())}ngDoCheck(){this.ngControl&&this.updateErrorState()}ngOnDestroy(){super.ngOnDestroy(),this.stateChanges.complete()}registerInput(e){this._chipInput=e,this._chipInput.setDescribedByIds(this._ariaDescribedbyIds),this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(e){!this.disabled&&!this._originatesFromChip(e)&&this.focus()}focus(){if(!(this.disabled||this._chipInput?.focused)){if(!this._chips.length||this._chips.first.disabled){if(!this._chipInput)return;Promise.resolve().then(()=>this._chipInput.focus())}else{let e=this._keyManager.activeItem;e?e.focus():this._keyManager.setFirstItemActive()}this.stateChanges.next()}}get describedByIds(){if(this._chipInput)return this._chipInput.describedByIds||[];let e=this._elementRef.nativeElement.getAttribute("aria-describedby");return e?e.split(" "):[]}setDescribedByIds(e){this._ariaDescribedbyIds=e,this._chipInput?this._chipInput.setDescribedByIds(e):e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}writeValue(e){this._value=e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this.stateChanges.next()}updateErrorState(){this._errorStateTracker.updateErrorState()}_blur(){this.disabled||setTimeout(()=>{this.focused||(this._propagateChanges(),this._markAsTouched())})}_allowFocusEscape(){this._chipInput?.focused||super._allowFocusEscape()}_handleKeydown(e){let t=e.keyCode,o=this._keyManager.activeItem;if(t===9)this._chipInput?.focused&&fa(e,"shiftKey")&&this._chips.length&&!this._chips.last.disabled?(e.preventDefault(),o?this._keyManager.setActiveItem(o):this._focusLastChip()):super._allowFocusEscape();else if(!this._chipInput?.focused)if((t===38||t===40)&&o){let r=this._chipActions.filter(p=>p._isPrimary===o._isPrimary&&!this._skipPredicate(p)),a=r.indexOf(o),c=e.keyCode===38?-1:1;e.preventDefault(),a>-1&&this._isValidIndex(a+c)&&this._keyManager.setActiveItem(r[a+c])}else super._handleKeydown(e);this.stateChanges.next()}_focusLastChip(){this._chips.length&&this._chips.last.focus()}_propagateChanges(){let e=this._chips.length?this._chips.toArray().map(t=>t.value):[];this._value=e,this.change.emit(new YD(this,e)),this.valueChange.emit(e),this._onChange(e),this._changeDetectorRef.markForCheck()}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-chip-grid"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,wne,5),t&2){let a;mt(a=pt())&&(o._chips=a)}},hostAttrs:[1,"mat-mdc-chip-set","mat-mdc-chip-grid","mdc-evolution-chip-set"],hostVars:10,hostBindings:function(t,o){t&1&&g("focus",function(){return o.focus()})("blur",function(){return o._blur()}),t&2&&(qt("role",o.role)("tabindex",o.disabled||o._chips&&o._chips.length===0?-1:o.tabIndex)("aria-disabled",o.disabled.toString())("aria-invalid",o.errorState),Be("mat-mdc-chip-list-disabled",o.disabled)("mat-mdc-chip-list-invalid",o.errorState)("mat-mdc-chip-list-required",o.required))},inputs:{disabled:[2,"disabled","disabled",Ct],placeholder:"placeholder",required:[2,"required","required",Ct],value:"value",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},features:[fn([{provide:kC,useExisting:n}]),si],ngContentSelectors:b8,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(t,o){t&1&&(ii(),vo(0,"div",0),on(1),wo())},styles:[Sne],encapsulation:2,changeDetection:0})}return n})(),Ci=(()=>{class n{_elementRef=f(Zt);focused=!1;get chipGrid(){return this._chipGrid}set chipGrid(e){e&&(this._chipGrid=e,this._chipGrid.registerInput(this))}_chipGrid;addOnBlur=!1;separatorKeyCodes;chipEnd=new ve;placeholder="";id=f(Mo).getId("mat-mdc-chip-list-input-");get disabled(){return this._disabled||this._chipGrid&&this._chipGrid.disabled}set disabled(e){this._disabled=e}_disabled=!1;readonly=!1;disabledInteractive;get empty(){return!this.inputElement.value}inputElement;constructor(){let e=f(x8),t=f(Zu,{optional:!0});this.inputElement=this._elementRef.nativeElement,this.separatorKeyCodes=e.separatorKeyCodes,this.disabledInteractive=e.inputDisabledInteractive??!1,t&&this.inputElement.classList.add("mat-mdc-form-field-input-control")}ngOnChanges(){this._chipGrid.stateChanges.next()}ngOnDestroy(){this.chipEnd.complete()}_keydown(e){this.empty&&e.keyCode===8?(e.repeat||this._chipGrid._focusLastChip(),e.preventDefault()):this._emitChipEnd(e)}_blur(){this.addOnBlur&&this._emitChipEnd(),this.focused=!1,this._chipGrid.focused||this._chipGrid._blur(),this._chipGrid.stateChanges.next()}_focus(){this.focused=!0,this._chipGrid.stateChanges.next()}_emitChipEnd(e){(!e||this._isSeparatorKey(e)&&!e.repeat)&&(this.chipEnd.emit({input:this.inputElement,value:this.inputElement.value,chipInput:this}),e?.preventDefault())}_onInput(){this._chipGrid.stateChanges.next()}focus(){this.inputElement.focus()}clear(){this.inputElement.value=""}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}_isSeparatorKey(e){if(!this.separatorKeyCodes)return!1;for(let t of this.separatorKeyCodes){let o,r;typeof t=="number"?(o=t,r=null):(o=t.keyCode,r=t.modifiers);let a=r?.length?fa(e,...r):!fa(e);if(o===e.keyCode&&a)return!0}return!1}_getReadonlyAttribute(){return this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["input","matChipInputFor",""]],hostAttrs:[1,"mat-mdc-chip-input","mat-mdc-input-element","mdc-text-field__input","mat-input-element"],hostVars:8,hostBindings:function(t,o){t&1&&g("keydown",function(a){return o._keydown(a)})("blur",function(){return o._blur()})("focus",function(){return o._focus()})("input",function(){return o._onInput()}),t&2&&(Wo("id",o.id),qt("disabled",o.disabled&&!o.disabledInteractive?"":null)("placeholder",o.placeholder||null)("aria-invalid",o._chipGrid&&o._chipGrid.ngControl?o._chipGrid.ngControl.invalid:null)("aria-required",o._chipGrid&&o._chipGrid.required||null)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null)("readonly",o._getReadonlyAttribute())("required",o._chipGrid&&o._chipGrid.required||null))},inputs:{chipGrid:[0,"matChipInputFor","chipGrid"],addOnBlur:[2,"matChipInputAddOnBlur","addOnBlur",Ct],separatorKeyCodes:[0,"matChipInputSeparatorKeyCodes","separatorKeyCodes"],placeholder:"placeholder",id:"id",disabled:[2,"disabled","disabled",Ct],readonly:[2,"readonly","readonly",Ct],disabledInteractive:[2,"matChipInputDisabledInteractive","disabledInteractive",Ct]},outputs:{chipEnd:"matChipInputTokenEnd"},exportAs:["matChipInput","matChipInputFor"],features:[bn]})}return n})();var ti=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({providers:[fd,{provide:x8,useValue:{separatorKeyCodes:[13]}}],imports:[mc,hi]})}return n})();var ya=(()=>{class n{getCategoriesForCloudNodes(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getConsoleTypesForCloudNodes(){return["telnet","ssh","vnc","spice","http","https","none"]}getCategoriesForEthernetHubs(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getCategoriesForEthernetSwitches(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getConsoleTypesForEthernetSwitches(){return["telnet","none"]}getPortTypesForEthernetSwitches(){return["access","dot1q","qinq"]}getEtherTypesForEthernetSwitches(){return["0x8100","0x88A8","0x9100","0x9200"]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var zi=(()=>{class n{errorMessages={required:e=>`${e} is required`,portInvalid:"Port must be a non-negative integer",portOutOfRange:(e,t)=>`Port must be between ${e} and ${t}`,numberInvalid:e=>`${e} must be a valid number`,numberOutOfRange:(e,t,o)=>`${e} must be between ${t} and ${o}`,numberTooSmall:(e,t)=>`${e} must be at least ${t}`,formatInvalid:(e,t)=>`${e} must match the format: ${t}`,duplicate:"This entry already exists",mappingFormat:e=>e==="VC"?"Mapping must be in format: port:vpi:vci (e.g., 0:0:100)":"Mapping must be in format: port:vpi (e.g., 0:0)"};required(e,t="Field"){let o=e!=null&&e.trim()!=="";return{isValid:o,errorMessage:o?void 0:this.errorMessages.required(t)}}validatePort(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required("Port")};let t=parseInt(e,10),o=!isNaN(t)&&t>=0&&t===parseFloat(e);return{isValid:o,errorMessage:o?void 0:this.errorMessages.portInvalid}}createIntegerValidator(e,t){return o=>{if(!o||o.trim()==="")return{isValid:!1,errorMessage:`${e} is required`};let r=parseInt(o,10),a=!isNaN(r)&&r>=t&&r===parseFloat(o),c=t===0?"non-negative":`positive (>= ${t})`;return{isValid:a,errorMessage:a?void 0:`${e} must be a ${c} integer`}}}validatePortRange(e,t=0,o=65535){let r=this.validatePort(e);if(!r.isValid)return r;let a=parseInt(e,10),c=a>=t&&a<=o;return{isValid:c,errorMessage:c?void 0:this.errorMessages.portOutOfRange(t,o)}}validatePositiveInteger(e,t="Value"){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required(t)};let o=parseInt(e,10),r=!isNaN(o)&&o>=1&&o===parseFloat(e);return{isValid:r,errorMessage:r?void 0:this.errorMessages.numberTooSmall(t,1)}}validateNumberRange(e,t,o,r="Value"){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required(r)};let a=parseFloat(e),c=!isNaN(a)&&a>=t&&a<=o;return{isValid:c,errorMessage:c?void 0:this.errorMessages.numberOutOfRange(r,t,o)}}validateAtmVcMapping(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required("Mapping")};let o=/^([0-9]*):([0-9]*):([0-9]*)$/.test(e);return{isValid:o,errorMessage:o?void 0:this.errorMessages.mappingFormat("VC")}}validateAtmVpMapping(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required("Mapping")};let t=e.split(":");if(t.length!==2)return{isValid:!1,errorMessage:this.errorMessages.mappingFormat("VP")};let[o,r]=t,a=this.validatePort(o),c=this.validatePort(r),p=a.isValid&&c.isValid;return{isValid:p,errorMessage:p?void 0:this.errorMessages.mappingFormat("VP")}}validateFrameRelayMapping(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required("Mapping")};let t=e.split(":");if(t.length!==2)return{isValid:!1,errorMessage:"Mapping must be in format: port:dlci (e.g., 0:100)"};let[o,r]=t;if(!this.validatePort(o).isValid)return{isValid:!1,errorMessage:"Invalid port number"};let c=parseInt(r,10),p=!isNaN(c)&&c>=16&&c<=1007;return{isValid:p,errorMessage:p?void 0:"DLCI must be between 16 and 1007"}}validateIpAddress(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:"IP address is required"};let o=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e);return{isValid:o,errorMessage:o?void 0:"Invalid IP address format"}}validateUnique(e,t,o){let r=o!==void 0?t.includes(e)&&e!==o:t.includes(e);return{isValid:!r,errorMessage:r?this.errorMessages.duplicate:void 0}}validateHostname(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:"Hostname is required"};let o=/^([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])?$/.test(e)&&e.length<=253;return{isValid:o,errorMessage:o?void 0:"Invalid hostname format (use letters, numbers, hyphens, and dots)"}}macRegex=/^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$/;validateMacAddress(e){return!e||e.trim()===""?{isValid:!0}:this.macRegex.test(e)?{isValid:!0}:{isValid:!1,errorMessage:"Invalid MAC address format (expected XX:XX:XX:XX:XX:XX)"}}validatePattern(e,t,o="Field",r){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required(o)};let a=t.test(e);return{isValid:a,errorMessage:a?void 0:r||this.errorMessages.formatInvalid(o,t.toString())}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var nP=(()=>{class n{base=f(zi);validateSourcePort=this.base.createIntegerValidator("Source Port",0);validateDestinationPort=this.base.createIntegerValidator("Destination Port",0);validateSourceVci=this.base.createIntegerValidator("Source VCI",1);validateDestinationVci=this.base.createIntegerValidator("Destination VCI",1);validateSourceVpi=this.base.createIntegerValidator("Source VPI",1);validateDestinationVpi=this.base.createIntegerValidator("Destination VPI",1);validateVcMapping(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:"Mapping is required"};if(!/^([0-9]*):([0-9]*):([0-9]*)$/.test(e))return{isValid:!1,errorMessage:"VC mapping must be in format: port:vpi:vci (e.g., 0:0:100)"};let r=e.split(":"),[a,c,p]=r;return a&&!this.base.validatePort(a).isValid?{isValid:!1,errorMessage:"Port must be a non-negative integer"}:c&&!this.base.validatePort(c).isValid?{isValid:!1,errorMessage:"VPI must be a non-negative integer"}:p&&!this.base.validatePositiveInteger(p,"VCI").isValid?{isValid:!1,errorMessage:"VCI must be a positive integer (>= 1)"}:{isValid:!0}}validateVpMapping(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:"Mapping is required"};let t=e.split(":");if(t.length!==2)return{isValid:!1,errorMessage:"VP mapping must be in format: port:vpi (e.g., 0:0)"};let[o,r]=t;return this.base.validatePort(o).isValid?this.base.validatePort(r).isValid?{isValid:!0}:{isValid:!1,errorMessage:"VPI must be a non-negative integer"}:{isValid:!1,errorMessage:"Port must be a non-negative integer"}}validateMappingEntry(e,t,o,r,a,c,p){let u=this.validateSourcePort(e);if(!u.isValid)return u;let h=this.validateSourceVci(t);if(!h.isValid)return h;let _=this.validateDestinationPort(o);if(!_.isValid)return _;let S=this.validateDestinationVci(r);if(!S.isValid)return S;if(!p){let x=this.validateSourceVpi(a);if(!x.isValid)return x;let b=this.validateDestinationVpi(c);if(!b.isValid)return b}return{isValid:!0}}validateUniqueMapping(e,t){return t.some(r=>r.portIn===e)?{isValid:!1,errorMessage:"This mapping already exists"}:{isValid:!0}}validateGeneratedMapping(e,t,o){return o?this.validateVpMapping(e):this.validateVcMapping(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var E0=(()=>{class n{base=f(zi);validateName(e){return this.base.required(e,"Name")}validateRemoteConsolePort(e){return!e||e.trim()===""?{isValid:!0}:this.base.validatePortRange(e,1,65535)}validateInterfaceName(e){return!e||e.trim()===""?{isValid:!1,errorMessage:"Interface name is required"}:{isValid:!0}}validateUniqueInterface(e,t){return t.includes(e)?{isValid:!1,errorMessage:`Interface ${e} already configured.`}:{isValid:!0}}validateConsoleType(e,t){return!e||e.trim()===""?{isValid:!1,errorMessage:"Console type is required"}:t.includes(e)?{isValid:!0}:{isValid:!1,errorMessage:`Invalid console type. Must be one of: ${t.join(", ")}`}}validateRemoteConsoleHost(e){return!e||e.trim()===""?{isValid:!0}:/^[a-zA-Z0-9.-]+$/.test(e)?{isValid:!0}:{isValid:!1,errorMessage:"Invalid hostname or IP address format"}}validateRemoteConsoleHttpPath(e){return!e||e.trim()===""?{isValid:!0}:e&&!e.startsWith("/")?{isValid:!1,errorMessage:"HTTP path must start with /"}:{isValid:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var D0=(()=>{class n{base=f(zi);macRegex=/^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$/;resolutionRegex=/^[0-9]+x[0-9]+$/;validateName(e){return this.base.required(e,"Name")}validateAdapters(e,t=99){if(!e||e.trim()==="")return{isValid:!1,errorMessage:"Adapters is required"};let o=parseInt(e,10);return isNaN(o)||o<0||o!==parseFloat(e)?{isValid:!1,errorMessage:`Adapters must be a non-negative integer (0-${t})`}:o>t?{isValid:!1,errorMessage:`Adapters must not exceed ${t}`}:{isValid:!0}}validateMacAddress(e){return!e||e.trim()===""?{isValid:!0}:this.macRegex.test(e)?{isValid:!0}:{isValid:!1,errorMessage:"Invalid MAC address format (expected XX:XX:XX:XX:XX:XX)"}}validateMemory(e){return!e||e.trim()===""?{isValid:!0}:this.base.validatePort(e).isValid?{isValid:!0}:{isValid:!1,errorMessage:"Memory must be a non-negative integer"}}validateCpus(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseFloat(e);return isNaN(t)||t<0?{isValid:!1,errorMessage:"CPUs must be a non-negative number"}:{isValid:!0}}validateConsoleHttpPort(e){return!e||e.trim()===""?{isValid:!0}:this.base.validatePortRange(e,1,65535)}validateConsoleHttpPath(e){return this.base.required(e,"Console HTTP path")}validateConsoleResolution(e){return!e||e.trim()===""?{isValid:!0}:this.resolutionRegex.test(e)?{isValid:!0}:{isValid:!1,errorMessage:"Invalid resolution format (expected WIDTHxHEIGHT, e.g. 1024x768)"}}validateEnvironment(e,t="Environment"){if(!e||e.trim()==="")return{isValid:!0};let o=e.split(`
`);for(let r=0;r<o.length;r++){let a=o[r].trim();if(!a)continue;let c=a.indexOf("=");if(c<=0)return{isValid:!1,errorMessage:`${t}, line ${r+1}: Invalid format (expected KEY=VALUE)`};let p=a.substring(0,c);if(p!==p.toUpperCase())return{isValid:!1,errorMessage:`${t}, line ${r+1}: Variable name "${p}" should be uppercase (e.g., ${p.toUpperCase()}=value)`}}return{isValid:!0}}validateConsolePort(e){return!e||e.trim()===""?{isValid:!0}:this.base.validatePortRange(e,1,65535)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var P0=(()=>{class n{base=f(zi);idlePcRegex=/^(0x[0-9a-fA-F]+)?$/;platformRamLimits={c7200:{min:512,max:512},c3725:{min:128,max:256},c3745:{min:128,max:256},c2691:{min:128,max:256},c3600:{min:192,max:192},c2600:{min:160,max:160},c1700:{min:160,max:160}};platformNvramDefaults={c7200:512,c3725:256,c3745:256,c2691:256,c3600:256,c2600:256,c1700:256};validateName(e){return this.base.required(e,"Name")}validateImagePath(e){return this.base.required(e,"IOS image path")}validateRam(e){let t=this.base.required(e,"RAM");if(!t.isValid)return t;let o=parseInt(e,10);return isNaN(o)||o<0||o!==parseFloat(e)?{isValid:!1,errorMessage:"RAM must be a non-negative integer"}:{isValid:!0}}validateNvram(e){let t=this.base.required(e,"NVRAM");if(!t.isValid)return t;let o=parseInt(e,10);return isNaN(o)||o<0||o!==parseFloat(e)?{isValid:!1,errorMessage:"NVRAM must be a non-negative integer"}:{isValid:!0}}validateIdlepc(e){return!e||e.trim()===""?{isValid:!0}:this.idlePcRegex.test(e)?{isValid:!0}:{isValid:!1,errorMessage:"Invalid Idle-PC format (expected 0x..., e.g. 0x1234)"}}validateMacAddress(e){return!e||e.trim()===""?{isValid:!0}:/^([0-9a-fA-F]{4}\.){2}[0-9a-fA-F]{4}$/.test(e)?{isValid:!0}:{isValid:!1,errorMessage:"Invalid MAC address format (expected XXXX.XXXX.XXXX)"}}validateRamForPlatform(e,t){let o=this.validateRam(e);if(!o.isValid)return o;let r=this.platformRamLimits[t];if(r){let a=parseInt(e,10);if(a<r.min||a>r.max)return{isValid:!1,errorMessage:`RAM for ${t} should be ${r.min} MB${r.max!==r.min?` (${r.min}-${r.max})`:""}`}}return{isValid:!0}}validateNvramForPlatform(e,t){let o=this.validateNvram(e);if(!o.isValid)return o;let r=this.platformNvramDefaults[t];if(r){let a=parseInt(e,10);if(a>r*2)return{isValid:!1,errorMessage:`NVRAM for ${t} is typically ${r} KB. Value ${a} seems unusually high.`}}return{isValid:!0}}validateIomem(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<0||t>100||t!==parseFloat(e)?{isValid:!1,errorMessage:"I/O memory must be an integer between 0 and 100"}:{isValid:!0}}validateDisk(e,t){if(!e||e.trim()==="")return{isValid:!0};let o=parseInt(e,10);return isNaN(o)||o<0||o!==parseFloat(e)?{isValid:!1,errorMessage:`${t} must be a non-negative integer`}:{isValid:!0}}validateNonNegative(e,t){if(!e||e.trim()==="")return{isValid:!0};let o=parseInt(e,10);return isNaN(o)||o<0||o!==parseFloat(e)?{isValid:!1,errorMessage:`${t} must be a non-negative integer`}:{isValid:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var I0=(()=>{class n{base=f(zi);validateName(e){return this.base.required(e,"Name")}validatePath(e){return this.base.required(e,"IOU image path")}validateEthernetAdapters(e){let t=this.base.required(e,"Ethernet adapters");if(!t.isValid)return t;let o=parseInt(e,10);return isNaN(o)||o<0||o!==parseFloat(e)?{isValid:!1,errorMessage:"Ethernet adapters must be a non-negative integer"}:{isValid:!0}}validateSerialAdapters(e){let t=this.base.required(e,"Serial adapters");if(!t.isValid)return t;let o=parseInt(e,10);return isNaN(o)||o<0||o!==parseFloat(e)?{isValid:!1,errorMessage:"Serial adapters must be a non-negative integer"}:{isValid:!0}}validateRam(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<0||t!==parseFloat(e)?{isValid:!1,errorMessage:"RAM must be a non-negative integer"}:{isValid:!0}}validateNvram(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<0||t!==parseFloat(e)?{isValid:!1,errorMessage:"NVRAM must be a non-negative integer"}:{isValid:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var iP=(()=>{class n{base=f(zi);validateName(e){return this.base.required(e,"Name")}validateRequiredRam(e){return this.base.required(e,"RAM")}validateCpus(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<1||t>255||t!==parseFloat(e)?{isValid:!1,errorMessage:"CPUs must be an integer between 1 and 255"}:{isValid:!0}}validateAdapters(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<0||t>275||t!==parseFloat(e)?{isValid:!1,errorMessage:"Adapters must be an integer between 0 and 275"}:{isValid:!0}}validateCpuThrottling(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<0||t>800||t!==parseFloat(e)?{isValid:!1,errorMessage:"CPU throttling must be between 0 and 800"}:{isValid:!0}}validateMacAddress(e){return!e||e.trim()===""?{isValid:!0}:this.base.validateMacAddress(e)}validatePortSegmentSize(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<0||t!==parseFloat(e)?{isValid:!1,errorMessage:"Port segment size must be a non-negative integer"}:{isValid:!0}}validateFirstPortName(e){return!e||e.trim()===""?{isValid:!0}:/[{}\0]/.test(e)?{isValid:!1,errorMessage:"First port name should not contain placeholder {0} or special characters"}:{isValid:!0}}validatePortNameFormat(e){if(!e||e.trim()==="")return{isValid:!0};if(!e.includes("{0}"))return{isValid:!1,errorMessage:"Port name format must include {0} as a placeholder (e.g., Ethernet{0})"};let t=e.replace("{0}","");return t.includes("{")||t.includes("}")?{isValid:!1,errorMessage:"Only {0} is allowed as placeholder, no extra braces (e.g., Ethernet{0})"}:{isValid:!0}}validateMaxcpus(e){if(!e||e.trim()==="")return{isValid:!0};let t=parseInt(e,10);return isNaN(t)||t<1||t>255||t!==parseFloat(e)?{isValid:!1,errorMessage:"Max CPUs must be an integer between 1 and 255"}:{isValid:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Mne=1,ml=(()=>{class n{httpController;symbols=new an([]);cache;cachedControllerKey="";builtinCache;builtinControllerKey="";dimensionsCache=new Map;blobUrlCache=new Map;maximumSymbolSize=80;constructor(e){this.httpController=e}getMaximumSymbolSize(){return this.maximumSymbolSize}get(e){return this.symbols.getValue().find(t=>t.symbol_id===e)}getDimensions(e,t){let o=`${e.host}:${e.port}:${t}`;if(!this.dimensionsCache.has(o)){let r=encodeURI(t);this.dimensionsCache.set(o,this.httpController.get(e,`/symbols/${r}/dimensions`).pipe(_p(1)))}return this.dimensionsCache.get(o)}getSymbolBlobUrl(e,t){return this.blobUrlCache.has(t)||this.blobUrlCache.set(t,this.httpController.getBlob(e,t).pipe(Lt(o=>URL.createObjectURL(o)),_p(1))),this.blobUrlCache.get(t)}scaleDimensionsForNode(e){let t=e.width>e.height?this.maximumSymbolSize/e.width:this.maximumSymbolSize/e.height;return{width:e.width*t,height:e.height*t}}getByFilename(e){return this.symbols.getValue().find(t=>t.filename===e)}add(e,t,o){return this.cache=null,this.cachedControllerKey="",this.httpController.post(e,`/symbols/${t}/raw`,o)}addFile(e,t,o){return this.cache=null,this.cachedControllerKey="",this.httpController.postBlob(e,`/symbols/${t}/raw`,o)}delete(e,t){this.cache=null,this.cachedControllerKey="";let o=encodeURI(t);return this.httpController.delete(e,`/symbols/${o}`)}load(e){return this.httpController.get(e,"/symbols")}list(e){let t=`${e.host}:${e.port}`;return(!this.cache||this.cachedControllerKey!==t)&&(this.cachedControllerKey=t,this.cache=this.load(e).pipe(_p(Mne))),this.cache}listBuiltinSymbols(e){let t=`${e.host}:${e.port}`;return(!this.builtinCache||this.builtinControllerKey!==t)&&(this.builtinControllerKey=t,this.builtinCache=this.load(e).pipe(Lt(o=>o.filter(r=>r.builtin)),_p(1))),this.builtinCache}listCustomSymbols(e){return this.load(e).pipe(Lt(t=>t.filter(o=>!o.builtin)))}raw(e,t){let o=encodeURI(t);return this.httpController.getText(e,`/symbols/${o}/raw`)}getSymbolFromTemplate(e,t){return`${e.protocol}//${e.host}:${e.port}/${wi.current_version}/symbols/${t.symbol}/raw`}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var S8=(()=>{class n{transform(e,t){return e?t?(t=t.toLowerCase(),e.filter(o=>o.filename.toLowerCase().includes(t))):e:[]}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"filenamefilter",type:n,pure:!0})}return n})();var Ns=(()=>{class n{dialogRef;data;constructor(e,t){this.dialogRef=e,this.data=t}get title(){return this.data.title||"Confirm Delete"}get confirmButtonText(){return this.data.confirmButtonText||"Yes"}get cancelButtonText(){return this.data.cancelButtonText||"No"}onNoClick(){this.dialogRef.close(!1)}onYesClick(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(Ie),ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-confirmation-dialog"]],decls:20,vars:4,consts:[[1,"dialog-container"],[1,"dialog-header"],[1,"dialog-icon","warning-icon"],[1,"dialog-title"],[1,"dialog-content"],[1,"dialog-message"],[1,"dialog-actions"],["mat-button","",1,"cancel-button",3,"click"],[1,"button-icon"],["mat-raised-button","","color","warn",1,"confirm-button",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"mat-icon",2),d(3,"warning"),l(),s(4,"h2",3),d(5),l()(),s(6,"div",4)(7,"p",5),d(8),l()(),s(9,"div",6)(10,"button",7),g("click",function(){return o.onNoClick()}),s(11,"mat-icon",8),d(12,"close"),l(),s(13,"span"),d(14),l()(),s(15,"button",9),g("click",function(){return o.onYesClick()}),s(16,"mat-icon",8),d(17,"check_circle"),l(),s(18,"span"),d(19),l()()()()),t&2&&(m(5),j(o.title),m(3),j(o.data.message),m(6),j(o.cancelButtonText),m(5),j(o.confirmButtonText))},dependencies:[ne,ie,de,W,pe],styles:['.dialog-container[_ngcontent-%COMP%]{position:relative;overflow:hidden;animation:_ngcontent-%COMP%_dialogSlideIn .2s ease-out;border-radius:16px;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 30%,transparent);background-color:var(--mat-sys-surface)}@keyframes _ngcontent-%COMP%_dialogSlideIn{0%{opacity:0;transform:scale(.9) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.dialog-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:24px 30px 16px;background:var(--mat-sys-error-container);border-bottom:1px solid var(--mat-sys-outline-variant);margin-bottom:4px;border-radius:16px 16px 0 0}.dialog-icon[_ngcontent-%COMP%]{width:28px;height:28px;font-size:28px;display:flex;align-items:center;justify-content:center}.warning-icon[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.dialog-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:var(--mat-sys-on-surface);margin:0;letter-spacing:-.2px}.dialog-content[_ngcontent-%COMP%]{padding:10px 30px 24px}.dialog-message[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);margin:0;line-height:1.5;letter-spacing:-.1px}.dialog-actions[_ngcontent-%COMP%]{padding:16px 30px 30px;display:flex;justify-content:center;gap:10px}.cancel-button[_ngcontent-%COMP%], .confirm-button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:7px 24px;border-radius:8px;font-weight:500;font-size:14px;transition:all .1s ease;position:relative;overflow:hidden;min-width:70px;justify-content:center}.cancel-button[_ngcontent-%COMP%]{color:var(--mat-sys-primary);background:transparent;border:1px solid var(--mat-sys-outline)}.cancel-button[_ngcontent-%COMP%]:hover{background:var(--mat-sys-primary-container);border-color:var(--mat-sys-primary);transform:translateY(-1px);box-shadow:0 3px 10px color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.cancel-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.cancel-button[_ngcontent-%COMP%] .button-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.confirm-button[_ngcontent-%COMP%]{background:var(--mat-sys-error);color:var(--mat-sys-on-error);border:none;box-shadow:0 2px 6px color-mix(in srgb,var(--mat-sys-error) 25%,transparent)}.confirm-button[_ngcontent-%COMP%]:hover{background:var(--mat-sys-error);opacity:.9;transform:translateY(-1px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-error) 35%,transparent)}.confirm-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.confirm-button[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--mat-sys-on-error) 20%,transparent),transparent);transition:left .5s}.confirm-button[_ngcontent-%COMP%]:hover:before{left:100%}.confirm-button[_ngcontent-%COMP%] .button-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.cancel-button[_ngcontent-%COMP%]:after, .confirm-button[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;width:0;height:0;border-radius:50%;background:currentColor;opacity:.4;transform:translate(-50%,-50%);transition:width .6s,height .6s}.cancel-button[_ngcontent-%COMP%]:active:after, .confirm-button[_ngcontent-%COMP%]:active:after{width:200px;height:200px;opacity:0;transition:0s}.cancel-button[_ngcontent-%COMP%]:focus-visible, .confirm-button[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--mat-sys-primary);outline-offset:2px}'],changeDetection:0})}return n})();var kne=(n,i)=>i.symbol_id;function Tne(n,i){if(n&1&&(s(0,"p",16),d(1),l()),n&2){let e=v(2);Be("success",e.uploadSuccess())("error",!e.uploadSuccess()),m(),ee(" ",e.uploadStatus()," ")}}function Ene(n,i){if(n&1){let e=z();s(0,"div",9)(1,"p",10),d(2,"Select an image file to upload as a new symbol."),l(),s(3,"p",11)(4,"strong"),d(5,"Supported formats:"),l(),d(6," SVG, PNG, JPG, JPEG, GIF"),l(),s(7,"p",12)(8,"strong"),d(9,"Recommended size:"),l(),d(10," 128\xD7128 pixels (max 256\xD7256)"),l(),s(11,"input",13,0),g("change",function(o){k(e);let r=v();return T(r.uploadSymbolFile(o))}),l(),s(13,"button",14),g("click",function(){k(e);let o=Pe(12);return T(o.click())}),s(14,"mat-icon"),d(15,"add"),l(),d(16," Choose File to Upload "),l(),A(17,Tne,2,5,"p",15),l()}if(n&2){let e=v();m(17),O(e.uploadStatus()?17:-1)}}function Dne(n,i){n&1&&(s(0,"div",23),d(1,"Loading symbols..."),l())}function Pne(n,i){n&1&&(s(0,"div",24)(1,"mat-icon"),d(2,"info"),l(),s(3,"p"),d(4,'No custom symbols found. Upload symbols using the "Add Symbol" tab.'),l()())}function Ine(n,i){if(n&1){let e=z();s(0,"div",27),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.toggleSelection(o.symbol_id))}),R(1,"img",28),s(2,"span",29),d(3),l()()}if(n&2){let e=i.$implicit,t=v(3);Be("selected",t.isSymbolSelected(e.symbol_id)),m(),C("src",t.getImageSource(e.symbol_id),Ia)("alt",e.symbol_id),m(2),j(e.symbol_id)}}function Ane(n,i){if(n&1&&(s(0,"div",25),Y(1,Ine,4,5,"div",26,kne),l()),n&2){let e=v(2);m(),Z(e.customSymbols())}}function One(n,i){if(n&1){let e=z();s(0,"div",17)(1,"div",18)(2,"p",10),d(3,"Select custom symbols to delete:"),l(),s(4,"div",19)(5,"button",20),g("click",function(){k(e);let o=v();return T(o.deleteSelectedSymbols())}),s(6,"mat-icon"),d(7,"delete"),l(),d(8),l(),s(9,"button",21),g("click",function(){k(e);let o=v();return T(o.selectAllCustom())}),d(10,"Select all"),l(),s(11,"button",22),g("click",function(){k(e);let o=v();return T(o.clearSelection())}),d(12,"Clear"),l()()(),A(13,Dne,2,0,"div",23)(14,Pne,5,0,"div",24)(15,Ane,3,0,"div",25),l()}if(n&2){let e=v();m(5),C("disabled",!e.hasSelectedSymbols()),m(3),ee(" Delete (",e.selectedForDeletion().size,") "),m(5),O(e.isLoading()?13:e.customSymbols().length===0?14:15)}}var w8=(()=>{class n{dialogRef=f(Ie);cd=f(Q);symbolService=f(ml);toasterService=f(te);data=f(gt);controller=ae(void 0);activeTab=ae(0);symbolsUpdated=new ve;uploadStatus=ae("");uploadSuccess=ae(!1);customSymbols=ae([]);selectedForDeletion=ae(new Set);isLoading=ae(!1);symbolBlobUrls=new Map;constructor(){this.data?.controller&&(this.controller.set(this.data.controller),this.loadCustomSymbols())}onCloseClick(){this.dialogRef.close()}onTabChange(e){this.activeTab.set(e),e===1&&this.loadCustomSymbols(),this.cd.markForCheck()}loadCustomSymbols(){this.controller()&&this.symbolService.list(this.controller()).subscribe({next:e=>{let t=e.filter(o=>!o.builtin);this.customSymbols.set(t),this.loadSymbolBlobs(t),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load symbols";this.toasterService.error(t),this.cd.markForCheck()}})}loadSymbolBlobs(e){let t=new Map;e.forEach(r=>{let a=`/symbols/${r.symbol_id}/raw`;t.set(r.symbol_id,a)});let o=Array.from(t.values());qi(o.map(r=>this.symbolService.getSymbolBlobUrl(this.controller(),r))).subscribe({next:r=>{o.forEach((a,c)=>{for(let[p,u]of t.entries())if(u===a){this.symbolBlobUrls.set(p,r[c]);break}}),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load symbol images";this.toasterService.error(a),this.cd.markForCheck()}})}getImageSource(e){return this.symbolBlobUrls.get(e)||""}toggleSelection(e){let t=this.selectedForDeletion(),o=new Set(t);o.has(e)?o.delete(e):o.add(e),this.selectedForDeletion.set(o),this.cd.markForCheck()}isSymbolSelected(e){return this.selectedForDeletion().has(e)}selectAllCustom(){let e=new Set(this.customSymbols().map(t=>t.symbol_id));this.selectedForDeletion.set(e),this.cd.markForCheck()}clearSelection(){this.selectedForDeletion.set(new Set),this.cd.markForCheck()}hasSelectedSymbols(){return this.selectedForDeletion().size>0}deleteSelectedSymbols(){let e=this.customSymbols().filter(o=>this.selectedForDeletion().has(o.symbol_id));if(e.length===0)return;let t=e.map(o=>this.symbolService.delete(this.controller(),o.symbol_id));qi(t).subscribe({next:()=>{this.selectedForDeletion.set(new Set),this.loadCustomSymbols(),this.symbolsUpdated.emit()},error:o=>{let r=o.error?.message||o.message||"Failed to delete symbols";this.toasterService.error(r),this.cd.markForCheck()}})}uploadSymbolFile(e){let t=e.target,o=t.files[0];if(!o)return;let r=o.name,a=r.split(".").pop()?.toLowerCase();if(this.uploadStatus.set(`Uploading ${r}...`),this.uploadSuccess.set(!1),this.cd.markForCheck(),a==="svg"||a==="svgz"){let c=new FileReader;c.onloadend=()=>{let p=c.result;this.symbolService.add(this.controller(),r,p).subscribe({next:()=>{this.uploadStatus.set(`Successfully uploaded ${r}`),this.uploadSuccess.set(!0),this.symbolsUpdated.emit(),this.cd.markForCheck(),setTimeout(()=>{this.uploadStatus.set(""),this.cd.markForCheck()},3e3)},error:u=>{let h=u.error?.message||u.message||"Failed to upload symbol";this.uploadStatus.set(`Failed to upload ${r}: ${h}`),this.uploadSuccess.set(!1),this.cd.markForCheck()}})},c.readAsText(o)}else if(a==="png"||a==="jpg"||a==="jpeg"||a==="gif"){let c=new Blob([o],{type:o.type});this.symbolService.addFile(this.controller(),r,c).subscribe({next:()=>{this.uploadStatus.set(`Successfully uploaded ${r}`),this.uploadSuccess.set(!0),this.symbolsUpdated.emit(),this.cd.markForCheck(),setTimeout(()=>{this.uploadStatus.set(""),this.cd.markForCheck()},3e3)},error:p=>{let u=p.error?.message||p.message||"Failed to upload symbol";this.uploadStatus.set(`Failed to upload ${r}: ${u}`),this.uploadSuccess.set(!1),this.cd.markForCheck()}})}else{let c=new Blob([o],{type:o.type||"application/octet-stream"});this.symbolService.addFile(this.controller(),r,c).subscribe({next:()=>{this.uploadStatus.set(`Successfully uploaded ${r}`),this.uploadSuccess.set(!0),this.symbolsUpdated.emit(),this.cd.markForCheck(),setTimeout(()=>{this.uploadStatus.set(""),this.cd.markForCheck()},3e3)},error:p=>{let u=p.error?.message||p.message||"Failed to upload symbol";this.uploadStatus.set(`Failed to upload ${r}: ${u}`),this.uploadSuccess.set(!1),this.cd.markForCheck()}})}t.value=""}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-symbols-manager-dialog"]],decls:11,vars:1,consts:[["file",""],["mat-dialog-title",""],[1,"symbols-manager-content"],[3,"selectedIndexChange","selectedIndex"],["label","Add Symbol"],["matTabContent",""],["label","Manage Symbols"],["align","end"],["mat-button","",3,"click"],[1,"add-symbol-section"],[1,"instructions"],[1,"supported-formats"],[1,"recommended-size"],["type","file","accept",".svg,.svgz,.png,.jpg,.jpeg,.gif",1,"non-visible",3,"change"],["mat-raised-button","","color","primary",3,"click"],[1,"upload-status",3,"success","error"],[1,"upload-status"],[1,"manage-symbols-section"],[1,"manage-header"],[1,"delete-actions"],["mat-button","","color","warn","mat-raised-button","",3,"click","disabled"],["mat-button","","matTooltip","Select all custom symbols",3,"click"],["mat-button","","matTooltip","Clear selection",3,"click"],[1,"loading-message"],[1,"empty-message"],[1,"symbols-grid"],[1,"symbol-item",3,"selected"],[1,"symbol-item",3,"click"],[3,"src","alt"],[1,"symbol-name"]],template:function(t,o){t&1&&(s(0,"h2",1),d(1,"Symbols Manager"),l(),s(2,"mat-dialog-content",2)(3,"mat-tab-group",3),ac("selectedIndexChange",function(a){return rc(o.activeTab,a)||(o.activeTab=a),a}),g("selectedIndexChange",function(a){return o.onTabChange(a)}),s(4,"mat-tab",4),xe(5,Ene,18,1,"ng-template",5),l(),s(6,"mat-tab",6),xe(7,One,16,3,"ng-template",5),l()()(),s(8,"mat-dialog-actions",7)(9,"button",8),g("click",function(){return o.onCloseClick()}),d(10,"Close"),l()()),t&2&&(m(3),oc("selectedIndex",o.activeTab))},dependencies:[ne,W,pe,ie,de,_e,Ne,Fe,bt,To,L4,tr,nr,wt,It],styles:[".symbols-manager-content[_ngcontent-%COMP%]{overflow:auto}.manage-symbols-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;padding:20px}.manage-symbols-section[_ngcontent-%COMP%] .manage-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.manage-symbols-section[_ngcontent-%COMP%] .manage-header[_ngcontent-%COMP%] .instructions[_ngcontent-%COMP%]{font-size:16px;color:var(--mat-sys-on-surface);margin:0}.manage-symbols-section[_ngcontent-%COMP%] .manage-header[_ngcontent-%COMP%] .delete-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.manage-symbols-section[_ngcontent-%COMP%] .loading-message[_ngcontent-%COMP%], .manage-symbols-section[_ngcontent-%COMP%] .empty-message[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:60px 20px;color:var(--mat-sys-on-surface-variant);text-align:center}.manage-symbols-section[_ngcontent-%COMP%] .loading-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .manage-symbols-section[_ngcontent-%COMP%] .empty-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;color:var(--mat-sys-primary)}.manage-symbols-section[_ngcontent-%COMP%] .loading-message[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .manage-symbols-section[_ngcontent-%COMP%] .empty-message[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:16px}.manage-symbols-section[_ngcontent-%COMP%] .symbols-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:12px;padding:16px 0;max-height:400px;overflow-y:auto}.add-symbol-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:40px 20px}.add-symbol-section[_ngcontent-%COMP%] .instructions[_ngcontent-%COMP%]{font-size:16px;color:var(--mat-sys-on-surface);text-align:center;margin:0}.add-symbol-section[_ngcontent-%COMP%] .supported-formats[_ngcontent-%COMP%], .add-symbol-section[_ngcontent-%COMP%] .recommended-size[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);text-align:center;margin:0}.add-symbol-section[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-top:16px}.add-symbol-section[_ngcontent-%COMP%] .upload-status[_ngcontent-%COMP%]{margin-top:16px;padding:12px 16px;border-radius:8px;font-size:14px;text-align:center}.add-symbol-section[_ngcontent-%COMP%] .upload-status.success[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}.add-symbol-section[_ngcontent-%COMP%] .upload-status.error[_ngcontent-%COMP%]{background-color:var(--mat-sys-error-container);color:var(--mat-sys-on-error-container)}.symbol-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background-color:var(--mat-sys-surface-container)}.symbol-item[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-container-high);border-color:var(--mat-sys-outline)}.symbol-item.selected[_ngcontent-%COMP%]{border-color:var(--mat-sys-error);background-color:var(--mat-sys-error-container);box-shadow:0 0 0 2px var(--mat-sys-error)}.symbol-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:48px;height:48px;object-fit:contain}.symbol-item[_ngcontent-%COMP%] .symbol-name[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface);text-align:center;word-break:break-all;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.non-visible[_ngcontent-%COMP%]{display:none}"],changeDetection:0})}return n})();var fo=(()=>{class n{configs=new Map;constructor(){this.registerDefaultConfigs()}registerDefaultConfigs(){let e={panelClass:["base-dialog-panel"]},t={panelClass:["base-dialog-panel","configurator-dialog-panel"]},o={panelClass:["base-dialog-panel","simple-dialog-panel"]};this.configs.set("changeSymbol",it(K({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","change-symbol-dialog-panel"]})),this.configs.set("templateSymbol",it(K({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","change-symbol-dialog-panel"]})),this.configs.set("symbolsManager",it(K({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel"]})),this.configs.set("confirmation",{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"]}),this.configs.set("editController",it(K({},e),{panelClass:["base-dialog-panel","edit-controller-dialog-panel"]})),this.configs.set("addController",it(K({},e),{panelClass:["base-dialog-panel","add-controller-dialog-panel"]})),this.configs.set("customAdapters",{panelClass:["base-dialog-panel","custom-adapters-dialog-panel"]}),this.configs.set("editProject",it(K({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","edit-project-dialog-panel"]})),this.configs.set("addAce",it(K({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","add-ace-dialog-panel"]})),this.configs.set("newTemplate",it(K({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","new-template-dialog-panel"]})),this.configs.set("nodesMenuConfirmation",it(K({},o),{panelClass:["base-dialog-panel","simple-dialog-panel","nodes-menu-confirmation-dialog-panel"]})),this.configs.set("startCapture",it(K({},o),{panelClass:["base-dialog-panel","simple-dialog-panel"]})),this.configs.set("linkStyleEditor",it(K({},o),{panelClass:["base-dialog-panel","simple-dialog-panel"]})),this.configs.set("packetFilters",it(K({},o),{panelClass:["base-dialog-panel","simple-dialog-panel"]})),this.configs.set("helpDialog",it(K({},o),{panelClass:["base-dialog-panel","simple-dialog-panel"]}))}getConfig(e){let t=this.configs.get(e);return t?K({},t):(console.warn(`DialogConfigService: No config found for "${e}", using base config`),{panelClass:["base-dialog-panel"]})}openConfig(e,t){let o=this.getConfig(e);return t?K(K({},o),t):o}registerConfig(e,t){this.configs.set(e,t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Nne=(n,i,e)=>({buttonSelected:n,"in-delete-mode":i,"delete-selected":e}),Fne=n=>({imageSelected:n}),Rne=(n,i)=>i.theme,Lne=(n,i)=>i.symbol_id;function Vne(n,i){if(n&1){let e=z();s(0,"mat-radio-group",12)(1,"mat-radio-button",13),g("click",function(){k(e);let o=v();return T(o.setFilter("all"))}),d(2,"All symbols"),l(),s(3,"mat-radio-button",14),g("click",function(){k(e);let o=v();return T(o.setFilter("builtin"))}),d(4,"Built-in symbols"),l(),s(5,"mat-radio-button",15),g("click",function(){k(e);let o=v();return T(o.setFilter("custom"))}),d(6,"Custom symbols"),l()(),s(7,"button",16),g("click",function(){k(e);let o=v();return T(o.openSymbolsManager())}),s(8,"mat-icon"),d(9,"settings"),l(),d(10," Symbols Manager "),l()}}function Bne(n,i){if(n&1){let e=z();s(0,"div",1)(1,"button",17),g("click",function(){k(e);let o=v();return T(o.deleteSelectedSymbols())}),s(2,"mat-icon"),d(3,"delete"),l(),d(4),l(),s(5,"span",18),d(6),l(),s(7,"button",19),g("click",function(){k(e);let o=v();return T(o.selectAllVisible())}),d(8,"Select all"),l(),s(9,"button",20),g("click",function(){k(e);let o=v();return T(o.clearSelection())}),d(10,"Clear"),l(),s(11,"button",16),g("click",function(){k(e);let o=v();return T(o.toggleDeleteMode())}),d(12,"Cancel"),l()()}if(n&2){let e=v();m(),C("disabled",!e.hasSelectedSymbols()),m(3),ee(" Delete (",e.selectedForDeletion().size,") "),m(2),ee("",e.selectedForDeletion().size," selected")}}function zne(n,i){if(n&1){let e=z();s(0,"div",23)(1,"div",24)(2,"button",25),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.isDeleteMode()&&r.canDeleteSymbol(o)?r.toggleSelection(o.symbol_id):r.setSelected(o.symbol_id))}),R(3,"img",26),l()()()}if(n&2){let e=i.$implicit,t=v(2);m(),Be("delete-mode",t.isDeleteMode()),m(),C("ngClass",tC(5,Nne,t.isSelected===e.symbol_id,t.isDeleteMode(),t.isDeleteMode()&&t.isSymbolSelected(e.symbol_id))),m(),C("ngClass",dn(9,Fne,t.isSelected===e.symbol_id))("src",t.getImageSourceForTemplate(e.symbol_id),Ia)}}function jne(n,i){if(n&1){let e=z();s(0,"mat-expansion-panel",11)(1,"mat-expansion-panel-header",21),g("click",function(){let o=k(e).$implicit,r=v();return T(r.toggleTheme(o.theme))}),s(2,"mat-panel-title"),d(3),l(),s(4,"mat-panel-description"),d(5),l()(),s(6,"div",22),Y(7,zne,4,11,"div",23,Lne),en(9,"filenamefilter"),l()()}if(n&2){let e=i.$implicit,t=v();C("expanded",t.isThemeExpanded(e.theme)),m(3),ee(" ",e.theme," "),m(2),ee(" ",e.symbols.length," symbols "),m(2),Z(na(9,3,e.symbols,t.searchText()))}}var Em=(()=>{class n{symbolService=f(ml);toasterService=f(te);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);controller=le(void 0);symbol=le(void 0);symbolChanged=new ve;symbols=[];filteredSymbols=[];symbolGroups=[];isSelected="";selectedForDeletion=ae(new Set);searchText=U("");expandedThemes=ae([]);zoomLevel=ae(1);isDeleteMode=ae(!1);previousFilter="";symbolBlobUrls=new Map;Math=Math;ngOnInit(){this.isSelected=this.symbol(),this.loadSymbols()}toggleTheme(e){let t=this.expandedThemes();t.includes(e)?this.expandedThemes.set(t.filter(o=>o!==e)):this.expandedThemes.set([...t,e])}isThemeExpanded(e){return this.expandedThemes().includes(e)}setFilter(e){e==="all"?this.filteredSymbols=this.symbols:e==="builtin"?this.filteredSymbols=this.symbols.filter(t=>t.builtin):this.filteredSymbols=this.symbols.filter(t=>!t.builtin),this.updateSymbolGroups()}setSelected(e){this.isSelected=e,this.symbolChanged.emit(this.isSelected)}loadSymbols(){this.symbolService.list(this.controller()).subscribe({next:e=>{this.symbols=e,this.filteredSymbols=e,this.loadSymbolBlobs(e),this.updateSymbolGroups(),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load symbols";this.toasterService.error(t),this.cd.markForCheck()}})}loadSymbolBlobs(e){let t=new Map;e.forEach(r=>{let a=`/symbols/${r.symbol_id}/raw`;t.set(r.symbol_id,a)});let o=Array.from(t.values());qi(o.map(r=>this.symbolService.getSymbolBlobUrl(this.controller(),r))).subscribe({next:r=>{o.forEach((a,c)=>{for(let[p,u]of t.entries())if(u===a){this.symbolBlobUrls.set(p,r[c]);break}}),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load symbol images";this.toasterService.error(a),this.cd.markForCheck()}})}updateSymbolGroups(){let e=new Map;for(let t of this.filteredSymbols){let o=t.theme||"Other";e.has(o)||e.set(o,[]),e.get(o).push(t)}this.symbolGroups=Array.from(e.entries()).map(([t,o])=>({theme:t,symbols:o})).sort((t,o)=>t.theme.localeCompare(o.theme))}getImageSourceForTemplate(e){return this.symbolBlobUrls.get(e)||""}canDeleteSymbol(e){return!e.builtin}deleteSymbol(e,t){t.stopPropagation();let o={title:"Delete Symbol",message:`Are you sure you want to delete the symbol "${e.symbol_id}"?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(Ns,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:o}).afterClosed().subscribe(a=>{a&&this.symbolService.delete(this.controller(),e.symbol_id).subscribe({next:()=>{this.loadSymbols()},error:c=>{let p=c.error?.message||c.message||"Failed to delete symbol";this.toasterService.error(p),this.cd.markForCheck()}})})}zoomIn(){let e=this.zoomLevel();e<2&&this.zoomLevel.set(Math.min(2,e+.1))}zoomOut(){let e=this.zoomLevel();e>.5&&this.zoomLevel.set(Math.max(.5,e-.1))}resetZoom(){this.zoomLevel.set(1)}toggleSelection(e){let t=this.selectedForDeletion(),o=new Set(t);o.has(e)?o.delete(e):o.add(e),this.selectedForDeletion.set(o),this.cd.markForCheck()}isSymbolSelected(e){return this.selectedForDeletion().has(e)}toggleDeleteMode(){let e=this.isDeleteMode();this.isDeleteMode.update(t=>!t),!e&&this.isDeleteMode()?(this.previousFilter="all",this.setFilter("custom")):e&&!this.isDeleteMode()&&(this.selectedForDeletion.set(new Set),this.previousFilter&&this.setFilter(this.previousFilter)),this.cd.markForCheck()}selectAllVisible(){let e=this.filteredSymbols.filter(o=>!o.builtin),t=new Set(e.map(o=>o.symbol_id));this.selectedForDeletion.set(t),this.cd.markForCheck()}clearSelection(){this.selectedForDeletion.set(new Set),this.cd.markForCheck()}hasSelectedSymbols(){return this.selectedForDeletion().size>0}deleteSelectedSymbols(){let e=this.filteredSymbols.filter(a=>this.selectedForDeletion().has(a.symbol_id));if(e.length===0)return;let o={title:"Delete Symbols",message:e.length===1?`Are you sure you want to delete the symbol "${e[0].symbol_id}"?`:`Are you sure you want to delete ${e.length} symbols?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(Ns,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:o}).afterClosed().subscribe(a=>{if(a){let c=e.map(p=>this.symbolService.delete(this.controller(),p.symbol_id));qi(c).subscribe({next:()=>{this.selectedForDeletion.set(new Set),this.loadSymbols()},error:p=>{let u=p.error?.message||p.message||"Failed to delete symbols";this.toasterService.error(u),this.cd.markForCheck()}})}})}openSymbolsManager(){let e=this.dialogConfig.openConfig("symbolsManager",{data:{controller:this.controller()}});this.dialog.open(w8,e).afterClosed().subscribe(()=>{this.loadSymbols()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-symbols"]],inputs:{controller:[1,"controller"],symbol:[1,"symbol"],searchText:[1,"searchText"]},outputs:{symbolChanged:"symbolChanged",searchText:"searchTextChange"},decls:21,vars:8,consts:[[1,"menu"],[1,"delete-actions"],[1,"example-full-width"],["matInput","","placeholder","Search by filename",3,"input","value"],[1,"zoom-controls"],["mat-icon-button","","matTooltip","Zoom out",3,"click","disabled"],[1,"zoom-level"],["mat-icon-button","","matTooltip","Zoom in",3,"click","disabled"],["mat-button","",3,"click","disabled"],[1,"symbolsWrapper"],["multi",""],[3,"expanded"],["aria-label","Select an option",1,"radio-selection"],["value","1","checked","",3,"click"],["value","2",3,"click"],["value","3",3,"click"],["mat-button","",3,"click"],["mat-button","","color","warn","mat-raised-button","",3,"click","disabled"],[1,"selected-count"],["mat-button","","matTooltip","Select all custom symbols",3,"click"],["mat-button","","matTooltip","Clear selection",3,"click"],[3,"click"],[1,"wrapper"],[1,"buttonWrapper"],[1,"symbol-item"],[1,"button",3,"click","ngClass"],["lazyimg","",1,"image",3,"ngClass","src"]],template:function(t,o){t&1&&(s(0,"div",0),A(1,Vne,11,0)(2,Bne,13,3,"div",1),l(),s(3,"form")(4,"mat-form-field",2)(5,"input",3),g("input",function(a){return o.searchText.set(a.target.value)}),l()()(),s(6,"div",4)(7,"button",5),g("click",function(){return o.zoomOut()}),s(8,"mat-icon"),d(9,"remove"),l()(),s(10,"span",6),d(11),l(),s(12,"button",7),g("click",function(){return o.zoomIn()}),s(13,"mat-icon"),d(14,"add"),l()(),s(15,"button",8),g("click",function(){return o.resetZoom()}),d(16,"Reset"),l()(),s(17,"div",9)(18,"mat-accordion",10),Y(19,jne,10,6,"mat-expansion-panel",11,Rne),l()()),t&2&&(m(),O(o.isDeleteMode()?2:1),m(4),C("value",o.searchText()),m(2),C("disabled",o.zoomLevel()<=.5),m(4),ee("",o.Math.round(o.zoomLevel()*100),"%"),m(),C("disabled",o.zoomLevel()>=2),m(3),C("disabled",o.zoomLevel()===1),m(2),nn("--zoom-level",o.zoomLevel()),m(2),Z(o.symbolGroups))},dependencies:[ne,Yi,Xe,at,rt,Gn,W,pe,je,ie,de,Se,Ee,Me,io,xo,ho,cl,km,kd,Td,Mm,Gb,_e,wt,It,S8],styles:[".symbolsWrapper[_ngcontent-%COMP%]{overflow:visible;--zoom-level: 1}.zoom-controls[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:16px;padding:8px;background-color:var(--mat-sys-surface-container);border-radius:8px}.zoom-controls[_ngcontent-%COMP%] .zoom-level[_ngcontent-%COMP%]{min-width:50px;text-align:center;font-size:14px;font-weight:500}.wrapper[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(60px * var(--zoom-level)),1fr));gap:calc(4px * var(--zoom-level));transition:gap .2s ease}.buttonWrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;outline:none;padding:calc(4px * var(--zoom-level))}.symbol-item[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}.buttonSelected[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)}.image[_ngcontent-%COMP%]{width:calc(45px * var(--zoom-level));height:calc(45px * var(--zoom-level));object-fit:contain}.imageSelected[_ngcontent-%COMP%]{outline:2px solid var(--mat-sys-primary);outline-offset:1px}.delete-button[_ngcontent-%COMP%]{position:absolute;top:calc(-2px * var(--zoom-level));right:calc(-2px * var(--zoom-level));width:calc(16px * var(--zoom-level));height:calc(16px * var(--zoom-level));padding:0;display:flex;align-items:center;justify-content:center;background-color:transparent;transition:transform .2s ease;z-index:1}.delete-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:calc(12px * var(--zoom-level));width:auto;height:auto}.delete-button[_ngcontent-%COMP%]:hover{transform:scale(1.2);background-color:transparent}.menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;flex-wrap:wrap;gap:8px}.radio-selection[_ngcontent-%COMP%]{display:flex;gap:8px}.delete-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.delete-actions[_ngcontent-%COMP%] .selected-count[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface)}.example-full-width[_ngcontent-%COMP%]{width:100%;margin-bottom:8px}.non-visible[_ngcontent-%COMP%]{display:none}.symbol-item.delete-mode[_ngcontent-%COMP%]{padding:2px;border-radius:4px}.button[_ngcontent-%COMP%]{background:border-box;border-width:0;outline:none;width:100%;height:100%;padding:calc(4px * var(--zoom-level))}.button.in-delete-mode[_ngcontent-%COMP%]{cursor:pointer}.button.delete-selected[_ngcontent-%COMP%]{outline:2px solid var(--mat-sys-error);outline-offset:-2px;box-shadow:0 0 0 2px var(--mat-sys-error)}"],changeDetection:0})}return n})();var qr=(()=>{class n{dialogRef=f(Ie);cd=f(Q);controller;symbol="";constructor(){let e=f(gt);this.controller=e.controller,this.symbol=e.symbol}ngOnInit(){this.cd.markForCheck()}symbolChanged(e){this.symbol=e,this.cd.markForCheck()}onCloseClick(){this.dialogRef.close()}onSelectClick(){this.dialogRef.close(this.symbol)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-template-symbol-dialog"]],decls:9,vars:2,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[3,"symbolChanged","controller","symbol"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Select symbol"),l(),s(2,"div",1)(3,"app-symbols",2),g("symbolChanged",function(a){return o.symbolChanged(a)}),l()(),s(4,"div",3)(5,"button",4),g("click",function(){return o.onCloseClick()}),d(6,"Cancel"),l(),s(7,"button",5),g("click",function(){return o.onSelectClick()}),d(8,"Choose symbol"),l()()),t&2&&(m(3),C("controller",o.controller)("symbol",o.symbol))},dependencies:[_e,Ne,Fe,W,pe,Em],styles:[".modal-form-container[_ngcontent-%COMP%]{padding:16px;overflow-y:auto;max-height:500px}.menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.radio-selection[_ngcontent-%COMP%]{width:90%}.mat-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-left:16px}.non-visible[_ngcontent-%COMP%]{display:none}.example-full-width[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();function $ne(n,i){if(n&1){let e=z();s(0,"button",6),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Hne(n,i){if(n&1){let e=z();s(0,"mat-chip",29),g("removed",function(){let o=k(e).$implicit,r=v(3);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",30),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function Une(n,i){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),j(e[0])}}function Gne(n,i){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function Wne(n,i){if(n&1){let e=z();s(0,"form",11)(1,"mat-form-field",16)(2,"mat-label"),d(3,"Template name"),l(),s(4,"input",17),g("input",function(o){k(e);let r=v(2);return T(r.name.set(o.target.value))}),l()(),s(5,"mat-form-field",16)(6,"mat-label"),d(7,"Default name format"),l(),s(8,"input",18),g("input",function(o){k(e);let r=v(2);return T(r.defaultNameFormat.set(o.target.value))}),l()(),s(9,"div",19)(10,"mat-form-field",20)(11,"mat-label"),d(12,"Symbol"),l(),s(13,"input",21),g("input",function(o){k(e);let r=v(2);return T(r.symbol.set(o.target.value))}),l()(),s(14,"button",22),g("click",function(){k(e);let o=v(2);return T(o.chooseSymbol())}),d(15,"Choose symbol"),l()(),s(16,"mat-form-field",16)(17,"mat-label"),d(18,"Tags"),l(),s(19,"mat-chip-grid",null,0),Y(21,Hne,4,1,"mat-chip",null,Ae),l(),s(23,"input",23),g("matChipInputTokenEnd",function(o){k(e);let r=v(2);return T(r.addTag(o))}),l()(),s(24,"mat-form-field",16)(25,"mat-label"),d(26,"Category"),l(),s(27,"mat-select",24),g("selectionChange",function(o){k(e);let r=v(2);return T(r.category.set(o.value))}),Y(28,Une,2,2,"mat-option",25,Hi),l()(),s(30,"mat-form-field",16)(31,"mat-label"),d(32,"Console type"),l(),s(33,"mat-select",24),g("selectionChange",function(o){k(e);let r=v(2);return T(r.consoleType.set(o.value))}),Y(34,Gne,2,2,"mat-option",25,Ae),l()(),s(36,"mat-form-field",16)(37,"mat-label"),d(38,"Console host"),l(),s(39,"input",26),g("input",function(o){k(e);let r=v(2);return T(r.consoleHost.set(o.target.value))}),l()(),s(40,"mat-form-field",16)(41,"mat-label"),d(42,"Console port"),l(),s(43,"input",27),g("input",function(o){k(e);let r=v(2);return T(r.consolePort.set(+o.target.value))}),l()(),s(44,"mat-form-field",16)(45,"mat-label"),d(46,"Console HTTP path"),l(),s(47,"input",28),g("input",function(o){k(e);let r=v(2);return T(r.consoleHttpPath.set(o.target.value))}),l()()()}if(n&2){let e=Pe(20),t=v(2);m(4),C("value",t.name()),m(4),C("value",t.defaultNameFormat()),m(5),C("value",t.symbol()),m(8),Z(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Z(t.categories),m(5),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(5),C("value",t.consoleHost()),m(4),C("value",t.consolePort()),m(4),C("value",t.consoleHttpPath())}}function qne(n,i){n&1&&(s(0,"th",41),d(1,"Interface"),l())}function Qne(n,i){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function Xne(n,i){n&1&&(s(0,"th",41),d(1,"Actions"),l())}function Kne(n,i){if(n&1){let e=z();s(0,"td",42)(1,"button",43),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.onDeleteEthernetInterface(o))}),s(2,"mat-icon",44),d(3,"delete"),l()()()}}function Yne(n,i){n&1&&R(0,"tr",45)}function Zne(n,i){n&1&&R(0,"tr",46)}function Jne(n,i){if(n&1){let e=z();s(0,"div",11)(1,"div",31)(2,"mat-form-field",20)(3,"mat-label"),d(4,"Ethernet interface"),l(),s(5,"input",32),g("input",function(o){k(e);let r=v(2);return T(r.ethernetInterface.set(o.target.value))}),l()(),s(6,"button",33),g("click",function(){k(e);let o=v(2);return T(o.onAddEthernetInterface())}),d(7,"Add"),l()(),s(8,"table",34),Le(9,35),xe(10,qne,2,0,"th",36)(11,Qne,2,1,"td",37),Ve(),Le(12,38),xe(13,Xne,2,0,"th",36)(14,Kne,4,0,"td",37),Ve(),xe(15,Yne,1,0,"tr",39)(16,Zne,1,0,"tr",40),l()()}if(n&2){let e=v(2);m(5),C("value",e.ethernetInterface()),m(3),C("dataSource",e.portsMappingEthernet),m(7),C("matHeaderRowDef",e.ethernetDisplayColumns),m(),C("matRowDefColumns",e.ethernetDisplayColumns)}}function eie(n,i){n&1&&(s(0,"th",41),d(1,"Interface"),l())}function tie(n,i){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function nie(n,i){n&1&&(s(0,"th",41),d(1,"Actions"),l())}function iie(n,i){if(n&1){let e=z();s(0,"td",42)(1,"button",43),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.onDeleteTapInterface(o))}),s(2,"mat-icon",44),d(3,"delete"),l()()()}}function oie(n,i){n&1&&R(0,"tr",45)}function rie(n,i){n&1&&R(0,"tr",46)}function aie(n,i){if(n&1){let e=z();s(0,"div",11)(1,"div",31)(2,"mat-form-field",20)(3,"mat-label"),d(4,"TAP interface"),l(),s(5,"input",47),g("input",function(o){k(e);let r=v(2);return T(r.tapInterface.set(o.target.value))}),l()(),s(6,"button",33),g("click",function(){k(e);let o=v(2);return T(o.onAddTapInterface())}),d(7,"Add"),l()(),s(8,"table",34),Le(9,35),xe(10,eie,2,0,"th",36)(11,tie,2,1,"td",37),Ve(),Le(12,38),xe(13,nie,2,0,"th",36)(14,iie,4,0,"td",37),Ve(),xe(15,oie,1,0,"tr",39)(16,rie,1,0,"tr",40),l()()}if(n&2){let e=v(2);m(5),C("value",e.tapInterface()),m(3),C("dataSource",e.portsMappingTap),m(7),C("matHeaderRowDef",e.tapDisplayColumns),m(),C("matRowDefColumns",e.tapDisplayColumns)}}function sie(n,i){n&1&&(s(0,"th",41),d(1,"Name"),l())}function lie(n,i){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function cie(n,i){n&1&&(s(0,"th",41),d(1,"Local port"),l())}function die(n,i){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=i.$implicit;m(),j(e.lport)}}function mie(n,i){n&1&&(s(0,"th",41),d(1,"Remote host"),l())}function pie(n,i){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=i.$implicit;m(),j(e.rhost)}}function uie(n,i){n&1&&(s(0,"th",41),d(1,"Remote port"),l())}function hie(n,i){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=i.$implicit;m(),j(e.rport)}}function fie(n,i){n&1&&(s(0,"th",41),d(1,"Actions"),l())}function gie(n,i){if(n&1){let e=z();s(0,"td",42)(1,"button",60),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.deleteUdpInterface(o))}),s(2,"mat-icon",61),d(3,"delete"),l()()()}}function _ie(n,i){n&1&&R(0,"tr",45)}function vie(n,i){n&1&&R(0,"tr",46)}function Cie(n,i){if(n&1){let e=z();s(0,"div",11)(1,"div",48)(2,"mat-form-field",49)(3,"mat-label"),d(4,"Name"),l(),s(5,"input",50),g("input",function(o){k(e);let r=v(2);return T(r.newPortName.set(o.target.value))}),l()(),s(6,"mat-form-field",49)(7,"mat-label"),d(8,"Remote host"),l(),s(9,"input",51),g("input",function(o){k(e);let r=v(2);return T(r.newPortRhost.set(o.target.value))}),l()(),s(10,"mat-form-field",49)(11,"mat-label"),d(12,"Local port"),l(),s(13,"input",52),g("input",function(o){k(e);let r=v(2);return T(r.newPortLport.set(+o.target.value))}),l()(),s(14,"mat-form-field",49)(15,"mat-label"),d(16,"Remote port"),l(),s(17,"input",53),g("input",function(o){k(e);let r=v(2);return T(r.newPortRport.set(+o.target.value))}),l()()(),s(18,"div",54)(19,"button",55),g("click",function(){k(e);let o=v(2);return T(o.onAddUdpInterface())}),d(20,"Add"),l()(),s(21,"table",34),Le(22,35),xe(23,sie,2,0,"th",36)(24,lie,2,1,"td",37),Ve(),Le(25,56),xe(26,cie,2,0,"th",36)(27,die,2,1,"td",37),Ve(),Le(28,57),xe(29,mie,2,0,"th",36)(30,pie,2,1,"td",37),Ve(),Le(31,58),xe(32,uie,2,0,"th",36)(33,hie,2,1,"td",37),Ve(),Le(34,59),xe(35,fie,2,0,"th",36)(36,gie,4,0,"td",37),Ve(),xe(37,_ie,1,0,"tr",39)(38,vie,1,0,"tr",40),l()()}if(n&2){let e=v(2);m(5),C("value",e.newPortName()),m(4),C("value",e.newPortRhost()),m(4),C("value",e.newPortLport()),m(4),C("value",e.newPortRport()),m(4),C("dataSource",e.dataSourceUdp),m(16),C("matHeaderRowDef",e.displayColumnsUdp),m(),C("matRowDefColumns",e.displayColumnsUdp)}}function bie(n,i){if(n&1){let e=z();s(0,"div",12)(1,"mat-form-field",62)(2,"mat-label"),d(3,"Usage"),l(),s(4,"textarea",63),g("input",function(o){k(e);let r=v(2);return T(r.usage.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function xie(n,i){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("general"))}),s(3,"h3",9),d(4,"General"),l(),s(5,"mat-icon",10),d(6),l()(),A(7,Wne,48,10,"form",11),l(),s(8,"section",7)(9,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("ethernet"))}),s(10,"h3",9),d(11,"Ethernet interfaces"),l(),s(12,"mat-icon",10),d(13),l()(),A(14,Jne,17,4,"div",11),l(),s(15,"section",7)(16,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("tap"))}),s(17,"h3",9),d(18,"TAP interfaces"),l(),s(19,"mat-icon",10),d(20),l()(),A(21,aie,17,4,"div",11),l(),s(22,"section",7)(23,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("udp"))}),s(24,"h3",9),d(25,"UDP tunnels"),l(),s(26,"mat-icon",10),d(27),l()(),A(28,Cie,39,7,"div",11),l(),s(29,"section",7)(30,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("usage"))}),s(31,"h3",9),d(32,"Usage"),l(),s(33,"mat-icon",10),d(34),l()(),A(35,bie,5,1,"div",12),l(),s(36,"div",13)(37,"button",14),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(38,"Cancel"),l(),s(39,"button",15),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(40,"Save"),l()()()}if(n&2){let e=v();m(6),j(e.generalExpanded?"expand_less":"expand_more"),m(),O(e.generalExpanded?7:-1),m(6),j(e.ethernetExpanded?"expand_less":"expand_more"),m(),O(e.ethernetExpanded?14:-1),m(6),j(e.tapExpanded?"expand_less":"expand_more"),m(),O(e.tapExpanded?21:-1),m(6),j(e.udpExpanded?"expand_less":"expand_more"),m(),O(e.udpExpanded?28:-1),m(6),j(e.usageExpanded?"expand_less":"expand_more"),m(),O(e.usageExpanded?35:-1)}}var sx=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);toasterService=f(te);builtInTemplatesConfigurationService=f(ya);validationService=f(E0);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);controller;cloudNodeTemplate;separatorKeysCodes=[13,188];categories=[];consoleTypes=[];ethernetInterfaces=["Ethernet 2","Ethernet 3"];ethernetDisplayColumns=["name","actions"];tapDisplayColumns=["name","actions"];displayColumnsUdp=["name","lport","rhost","rport","action"];generalExpanded=!1;ethernetExpanded=!1;tapExpanded=!1;udpExpanded=!1;usageExpanded=!1;name=U("");defaultNameFormat=U("");symbol=U("");category=U("");consoleType=U("");consoleHost=U("");consolePort=U(0);consoleHttpPath=U("");usage=U("");tags=U([]);ethernetInterface=U("");tapInterface=U("");portsMappingEthernet=[];portsMappingTap=[];portsMappingUdp=[];dataSourceUdp=[];newPortName=U("");newPortLport=U(0);newPortRhost=U("");newPortRport=U(0);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.getConfiguration(),this.builtInTemplatesService.getTemplate(this.controller,t).subscribe({next:r=>{this.cloudNodeTemplate=r,this.cloudNodeTemplate.tags||(this.cloudNodeTemplate.tags=[]),this.name.set(r.name||""),this.defaultNameFormat.set(r.default_name_format||""),this.symbol.set(r.symbol||""),this.category.set(r.category||""),this.consoleType.set(r.remote_console_type||""),this.consoleHost.set(r.remote_console_host||""),this.consolePort.set(r.remote_console_port||0),this.consoleHttpPath.set(r.remote_console_http_path||""),this.usage.set(r.usage||""),this.tags.set(r.tags||[]),this.portsMappingEthernet=this.cloudNodeTemplate.ports_mapping.filter(a=>a.type==="ethernet"),this.portsMappingTap=this.cloudNodeTemplate.ports_mapping.filter(a=>a.type==="tap"),this.portsMappingUdp=this.cloudNodeTemplate.ports_mapping.filter(a=>a.type==="udp"),this.dataSourceUdp=[...this.portsMappingUdp],this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","builtin","cloud-nodes"])}toggleSection(e){switch(e){case"general":this.generalExpanded=!this.generalExpanded;break;case"ethernet":this.ethernetExpanded=!this.ethernetExpanded;break;case"tap":this.tapExpanded=!this.tapExpanded;break;case"udp":this.udpExpanded=!this.udpExpanded;break;case"usage":this.usageExpanded=!this.usageExpanded;break}}getConfiguration(){this.categories=this.builtInTemplatesConfigurationService.getCategoriesForCloudNodes(),this.consoleTypes=this.builtInTemplatesConfigurationService.getConsoleTypesForCloudNodes()}onAddEthernetInterface(){let e=this.ethernetInterface();if(e){let t=this.validationService.validateInterfaceName(e);if(!t.isValid){this.toasterService.error(t.errorMessage||"Invalid interface name");return}let o=this.portsMappingEthernet.map(a=>a.name),r=this.validationService.validateUniqueInterface(e,o);if(!r.isValid){this.toasterService.error(r.errorMessage||`Interface ${e} already configured.`);return}this.portsMappingEthernet=[...this.portsMappingEthernet,{interface:e,name:e,port_number:0,type:"ethernet"}],this.ethernetInterface.set(""),this.cd.markForCheck()}}onDeleteEthernetInterface(e){this.portsMappingEthernet=this.portsMappingEthernet.filter(t=>t!==e),this.cd.markForCheck()}onAddTapInterface(){let e=this.tapInterface();if(e){let t=this.validationService.validateInterfaceName(e);if(!t.isValid){this.toasterService.error(t.errorMessage||"Invalid interface name");return}let o=this.portsMappingTap.map(a=>a.name),r=this.validationService.validateUniqueInterface(e,o);if(!r.isValid){this.toasterService.error(r.errorMessage||`Interface ${e} already configured.`);return}this.portsMappingTap=[...this.portsMappingTap,{interface:e,name:e,port_number:0,type:"tap"}],this.tapInterface.set(""),this.cd.markForCheck()}}onDeleteTapInterface(e){this.portsMappingTap=this.portsMappingTap.filter(t=>t!==e),this.cd.markForCheck()}onAddUdpInterface(){if(!this.newPortRhost()||this.newPortRhost().trim()===""){this.toasterService.error("Remote host is required");return}if(this.newPortLport()<1||this.newPortLport()>65535){this.toasterService.error("Local port must be between 1 and 65535");return}if(this.newPortRport()<1||this.newPortRport()>65535){this.toasterService.error("Remote port must be between 1 and 65535");return}let e={name:this.newPortName(),lport:this.newPortLport(),rhost:this.newPortRhost(),rport:this.newPortRport(),port_number:0,type:"udp"};this.portsMappingUdp.push(e),this.dataSourceUdp=[...this.portsMappingUdp],this.newPortName.set(""),this.newPortLport.set(0),this.newPortRhost.set(""),this.newPortRport.set(0),this.cd.markForCheck()}deleteUdpInterface(e){this.portsMappingUdp=this.portsMappingUdp.filter(t=>t!==e),this.dataSourceUdp=[...this.portsMappingUdp],this.cd.markForCheck()}onSave(){let e=this.validationService.validateName(this.name());if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}if(this.consolePort()){let o=this.validationService.validateRemoteConsolePort(this.consolePort().toString());if(!o.isValid){this.toasterService.error(o.errorMessage||"Remote console port must be between 1 and 65535");return}}let t=this.validationService.validateConsoleType(this.consoleType(),this.consoleTypes);if(!t.isValid){this.toasterService.error(t.errorMessage||"Invalid console type");return}if(this.consoleHost()){let o=this.validationService.validateRemoteConsoleHost(this.consoleHost());if(!o.isValid){this.toasterService.error(o.errorMessage||"Invalid remote console host");return}}if(this.consoleHttpPath()){let o=this.validationService.validateRemoteConsoleHttpPath(this.consoleHttpPath());if(!o.isValid){this.toasterService.error(o.errorMessage||"Invalid HTTP path");return}}this.cloudNodeTemplate.name=this.name(),this.cloudNodeTemplate.default_name_format=this.defaultNameFormat(),this.cloudNodeTemplate.symbol=this.symbol(),this.cloudNodeTemplate.category=this.category(),this.cloudNodeTemplate.remote_console_type=this.consoleType(),this.cloudNodeTemplate.remote_console_host=this.consoleHost(),this.cloudNodeTemplate.remote_console_port=this.consolePort(),this.cloudNodeTemplate.remote_console_http_path=this.consoleHttpPath(),this.cloudNodeTemplate.usage=this.usage(),this.cloudNodeTemplate.tags=this.tags(),this.cloudNodeTemplate.ports_mapping=[...this.portsMappingEthernet,...this.portsMappingTap,...this.portsMappingUdp],this.builtInTemplatesService.saveTemplate(this.controller,this.cloudNodeTemplate).subscribe({next:()=>{this.toasterService.success("Changes saved"),this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to save template";this.toasterService.error(r),this.cd.markForCheck()}})}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.symbol()}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&this.symbol.set(o)})}addTag(e){let t=(e.value||"").trim(),o=this.tags();t&&this.tags.set([...o,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),o=t.indexOf(e);if(o>=0){let r=[...t];r.splice(o,1),this.tags.set(r)}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-cloud-nodes-template-details"]],inputs:{name:[1,"name"],defaultNameFormat:[1,"defaultNameFormat"],symbol:[1,"symbol"],category:[1,"category"],consoleType:[1,"consoleType"],consoleHost:[1,"consoleHost"],consolePort:[1,"consolePort"],consoleHttpPath:[1,"consoleHttpPath"],usage:[1,"usage"],tags:[1,"tags"],ethernetInterface:[1,"ethernetInterface"],tapInterface:[1,"tapInterface"],newPortName:[1,"newPortName"],newPortLport:[1,"newPortLport"],newPortRhost:[1,"newPortRhost"],newPortRport:[1,"newPortRport"]},outputs:{name:"nameChange",defaultNameFormat:"defaultNameFormatChange",symbol:"symbolChange",category:"categoryChange",consoleType:"consoleTypeChange",consoleHost:"consoleHostChange",consolePort:"consolePortChange",consoleHttpPath:"consoleHttpPathChange",usage:"usageChange",tags:"tagsChange",ethernetInterface:"ethernetInterfaceChange",tapInterface:"tapInterfaceChange",newPortName:"newPortNameChange",newPortLport:"newPortLportChange",newPortRhost:"newPortRhostChange",newPortRport:"newPortRportChange"},decls:6,vars:2,consts:[["chipList",""],[1,"cloud-nodes-details"],[1,"cloud-nodes-details__header"],["mat-icon-button","",1,"cloud-nodes-details__back-btn"],[1,"cloud-nodes-details__title"],[1,"cloud-nodes-details__content"],["mat-icon-button","",1,"cloud-nodes-details__back-btn",3,"click"],[1,"cloud-nodes-details__form-card"],[1,"cloud-nodes-details__section-header",3,"click"],[1,"cloud-nodes-details__section-title"],[1,"cloud-nodes-details__expand-icon"],[1,"cloud-nodes-details__form"],[1,"preferences__usage-form"],[1,"cloud-nodes-details__actions"],["mat-button","",1,"cloud-nodes-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"cloud-nodes-details__save-btn",3,"click"],["appearance","fill",1,"cloud-nodes-details__field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],[1,"cloud-nodes-details__symbol-row"],["appearance","fill",1,"cloud-nodes-details__field","cloud-nodes-details__field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"cloud-nodes-details__symbol-btn",3,"click"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"selectionChange","value"],[3,"value"],["matInput","","type","text","placeholder","Console host",3,"input","value"],["matInput","","type","number","placeholder","Console port",3,"input","value"],["matInput","","type","text","placeholder","Console HTTP path",3,"input","value"],[3,"removed"],["matChipRemove",""],[1,"cloud-nodes-details__add-row"],["matInput","","type","text","placeholder","Ethernet interface name",3,"input","value"],["mat-button","",1,"cloud-nodes-details__add-btn",3,"click"],["mat-table","",1,"cloud-nodes-details__table",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","matTooltip","Delete interface",3,"click"],["aria-label","Delete interface"],["mat-header-row",""],["mat-row",""],["matInput","","type","text","placeholder","TAP interface",3,"input","value"],[1,"udp-tunnels__input-grid"],["appearance","fill"],["matInput","","type","text","placeholder","Name",3,"input","value"],["matInput","","type","text","placeholder","Remote host",3,"input","value"],["matInput","","type","number","min","1","max","65535","placeholder","Local port",3,"input","value"],["matInput","","type","number","min","1","max","65535","placeholder","Remote port",3,"input","value"],[1,"udp-tunnels__add-btn"],["mat-button","",3,"click"],["matColumnDef","lport"],["matColumnDef","rhost"],["matColumnDef","rport"],["matColumnDef","action"],["mat-icon-button","","matTooltip","Delete port",3,"click"],["aria-label","Delete port"],["appearance","fill",1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,$ne,3,0,"button",3),s(3,"h1",4),d(4,"Cloud node template configuration"),l()(),A(5,xie,41,10,"main",5),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.cloudNodeTemplate?5:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,ie,de,W,pe,je,we,Me,et,Se,Ee,vt,At,_t,ti,Jn,vi,Ci,mi,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,wt,It],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.cloud-nodes-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.cloud-nodes-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.cloud-nodes-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.cloud-nodes-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.cloud-nodes-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.cloud-nodes-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.cloud-nodes-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px}.cloud-nodes-details__section-header[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s ease;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.cloud-nodes-details__section-header[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.cloud-nodes-details__section-title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.cloud-nodes-details__expand-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:transform .2s ease}.cloud-nodes-details__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;padding:16px 24px 24px}.cloud-nodes-details__field[_ngcontent-%COMP%]{width:100%}.cloud-nodes-details__field--flex[_ngcontent-%COMP%]{flex:1}.cloud-nodes-details__field--full[_ngcontent-%COMP%]{width:100%;padding:0}.cloud-nodes-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.cloud-nodes-details__symbol-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.cloud-nodes-details__port-item[_ngcontent-%COMP%]{padding:8px 0;font-size:14px;color:var(--mat-sys-on-surface-variant)}.cloud-nodes-details__add-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.cloud-nodes-details__add-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.udp-tunnels__input-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.udp-tunnels__add-btn[_ngcontent-%COMP%]{display:flex;justify-content:center}.udp-tunnels__add-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:80%}.cloud-nodes-details__table[_ngcontent-%COMP%]{width:100%;background:transparent}.cloud-nodes-details__table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.cloud-nodes-details__table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.cloud-nodes-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.cloud-nodes-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.cloud-nodes-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.cloud-nodes-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.cloud-nodes-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.cloud-nodes-details__title[_ngcontent-%COMP%]{font-size:22px}.cloud-nodes-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.cloud-nodes-details__section-header[_ngcontent-%COMP%]{padding:12px 16px}.cloud-nodes-details__form[_ngcontent-%COMP%]{padding:16px}.cloud-nodes-details__symbol-row[_ngcontent-%COMP%], .cloud-nodes-details__add-row[_ngcontent-%COMP%]{flex-direction:column}.cloud-nodes-details__symbol-btn[_ngcontent-%COMP%], .cloud-nodes-details__add-btn[_ngcontent-%COMP%]{width:100%}.cloud-nodes-details__actions[_ngcontent-%COMP%]{flex-direction:column}.cloud-nodes-details__cancel-btn[_ngcontent-%COMP%], .cloud-nodes-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var pl=(()=>{class n{httpController;newTemplateCreated=new He;constructor(e){this.httpController=e}list(e){return this.httpController.get(e,"/templates")}deleteTemplate(e,t){return this.httpController.delete(e,`/templates/${t}`,{observe:"body"})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Oi=(()=>{class n{controller=le(void 0);deleteEvent=new ve;templateService=f(pl);dialog=f(nt);toasterService=f(te);deleteItem(e,t){this.dialog.open(Sm,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{templateName:e},autoFocus:!1,disableClose:!0}).afterClosed().subscribe(r=>{r&&this.templateService.deleteTemplate(this.controller(),t).subscribe({next:()=>{this.deleteEvent.emit(t),this.toasterService.success(`Template ${e} deleted.`)},error:a=>{let c=a.error?.message||a.message||"Failed to delete template";this.toasterService.error(c)}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-delete-template"]],inputs:{controller:[1,"controller"]},outputs:{deleteEvent:"deleteEvent"},decls:0,vars:0,template:function(t,o){},dependencies:[_e],encapsulation:2,changeDetection:0})}return n})();var Xr=(()=>{class n{textMessage=le(void 0);emptyTemplatesListMessage=Jt(()=>this.textMessage()??"Empty templates list");static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-empty-templates-list"]],inputs:{textMessage:[1,"textMessage"]},decls:4,vars:1,consts:[[1,"default-content"],[1,"matCard"],[1,"header"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"mat-card",1)(2,"h6",2),d(3),l()()()),t&2&&(m(3),ee(" ",o.emptyTemplatesListMessage()," "))},dependencies:[Mt,On],styles:[".header[_ngcontent-%COMP%]{text-align:center}"],changeDetection:0})}return n})();var yie=(n,i)=>i.template_id;function Sie(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/builtin")}}function wie(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/builtin/cloud-nodes/addtemplate")}}function Mie(n,i){n&1&&R(0,"app-empty-templates-list")}function kie(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"cloud"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(11,"mat-icon"),d(12,"delete"),l(),s(13,"span"),d(14,"Delete"),l()(),s(15,"a",16)(16,"mat-icon"),d(17,"edit"),l(),s(18,"span"),d(19,"Edit"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(10),C("routerLink",e.template_id)}}function Tie(n,i){if(n&1&&(s(0,"nav",8),Y(1,kie,20,4,"div",10,yie),l()),n&2){let e=v();m(),Z(e.cloudNodesTemplates)}}var lx=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);toasterService=f(te);cd=f(Q);controller;cloudNodesTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.builtInTemplatesService.getTemplates(this.controller).subscribe({next:e=>{this.cloudNodesTemplates=e.filter(t=>t.template_type==="cloud"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-cloud-nodes-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"cloud-nodes"],[1,"cloud-nodes__header"],["mat-icon-button","",1,"cloud-nodes__back-btn",3,"routerLink"],[1,"cloud-nodes__title"],["matTooltip","Add cloud node template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"cloud-nodes__add-btn",3,"routerLink"],[1,"cloud-nodes__content"],[1,"cloud-nodes__list"],[3,"deleteEvent","controller"],[1,"cloud-nodes__list-item",3,"routerLink"],[1,"cloud-nodes__list-icon"],[1,"cloud-nodes__list-name"],["mat-icon-button","",1,"cloud-nodes__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,Sie,3,1,"button",4),s(3,"h1",5),d(4,"Cloud nodes templates"),l(),A(5,wie,3,1,"button",6),l(),s(6,"main",7),A(7,Mie,1,0,"app-empty-templates-list"),A(8,Tie,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.cloudNodesTemplates.length?-1:7),m(),O(o.cloudNodesTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.cloud-nodes__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.cloud-nodes__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.cloud-nodes__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.cloud-nodes__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.cloud-nodes__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.cloud-nodes__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.cloud-nodes__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.cloud-nodes__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.cloud-nodes__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.cloud-nodes__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.cloud-nodes__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.cloud-nodes__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.cloud-nodes__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.cloud-nodes__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.cloud-nodes__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.cloud-nodes__back-btn[_ngcontent-%COMP%], .cloud-nodes__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.cloud-nodes__title[_ngcontent-%COMP%]{font-size:24px}.cloud-nodes__content[_ngcontent-%COMP%]{padding:0 16px 16px}.cloud-nodes__list-item[_ngcontent-%COMP%]{padding:14px 16px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();function Eie(n,i){if(n&1){let e=z();s(0,"button",15),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var cx=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);router=f(ht);toasterService=f(te);templateMocksService=f(xa);formBuilder=f(Vn);computeService=f(ko);cd=f(Q);controller;templateName="";formGroup;isLocalComputerChosen=!0;constructor(){this.formGroup=this.formBuilder.group({templateName:new Ye("",Ue.required),numberOfPorts:new Ye(8,Ue.required)})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}setControllerType(e){e==="local"&&(this.isLocalComputerChosen=!0)}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","builtin","ethernet-hubs"])}addTemplate(){this.formGroup.invalid?this.toasterService.error("Fill all required fields"):this.templateMocksService.getEthernetHubTemplate().subscribe({next:e=>{e.template_id=Ai(),e.name=this.formGroup.get("templateName").value,e.compute_id="local";for(let t=0;t<this.formGroup.get("numberOfPorts").value;t++)e.ports_mapping.push({name:`Ethernet${t}`,port_number:t});this.builtInTemplatesService.addTemplate(this.controller,e).subscribe({next:()=>{this.goBack()},error:t=>{let o=t.error?.message||t.message||"Failed to add ethernet hub template";this.toasterService.error(o),this.cd.markForCheck()}})},error:e=>{let t=e.error?.message||e.message||"Failed to load template";this.toasterService.error(t),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ethernet-hubs-add-template"]],decls:24,vars:3,consts:[[1,"ethernet-hub-add"],[1,"ethernet-hub-add__header"],["mat-icon-button","",1,"ethernet-hub-add__back-btn"],[1,"ethernet-hub-add__title"],[1,"ethernet-hub-add__content"],[1,"ethernet-hub-add__form-card"],[1,"ethernet-hub-add__radio-group"],["value","1",1,"ethernet-hub-add__radio",3,"click","checked"],[1,"ethernet-hub-add__form",3,"formGroup"],["appearance","fill",1,"ethernet-hub-add__field"],["formControlName","templateName","matInput","","type","text","placeholder","Template name"],["formControlName","numberOfPorts","matInput","","type","number","min","0","placeholder","Number of ports"],[1,"ethernet-hub-add__actions"],["mat-button","",1,"ethernet-hub-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"ethernet-hub-add__submit-btn",3,"click"],["mat-icon-button","",1,"ethernet-hub-add__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,Eie,3,0,"button",2),s(3,"h1",3),d(4,"New Ethernet hub template"),l()(),s(5,"main",4)(6,"section",5)(7,"mat-radio-group",6)(8,"mat-radio-button",7),g("click",function(){return o.setControllerType("local")}),d(9," Run the Ethernet Hub locally "),l()(),s(10,"form",8)(11,"mat-form-field",9)(12,"mat-label"),d(13,"Template name"),l(),R(14,"input",10),l(),s(15,"mat-form-field",9)(16,"mat-label"),d(17,"Number of ports"),l(),R(18,"input",11),l()()(),s(19,"div",12)(20,"button",13),g("click",function(){return o.goBack()}),d(21,"Cancel"),l(),s(22,"button",14),g("click",function(){return o.addTemplate()}),d(23," Add template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",o.formGroup))},dependencies:[ne,Xe,at,Ft,_r,Pt,rt,dc,Dt,Rt,zt,dt,ie,de,W,pe,je,Mt,io,xo,ho,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ethernet-hub-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ethernet-hub-add__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-hub-add__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ethernet-hub-add__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ethernet-hub-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ethernet-hub-add__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.ethernet-hub-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.ethernet-hub-add__radio[_ngcontent-%COMP%]{font-size:16px}.ethernet-hub-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ethernet-hub-add__field[_ngcontent-%COMP%]{width:100%}.ethernet-hub-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.ethernet-hub-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.ethernet-hub-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ethernet-hub-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ethernet-hub-add__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ethernet-hub-add__title[_ngcontent-%COMP%]{font-size:24px}.ethernet-hub-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ethernet-hub-add__form-card[_ngcontent-%COMP%]{padding:16px}.ethernet-hub-add__actions[_ngcontent-%COMP%]{flex-direction:column}.ethernet-hub-add__cancel-btn[_ngcontent-%COMP%], .ethernet-hub-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}"],changeDetection:0})}return n})();function Die(n,i){if(n&1){let e=z();s(0,"button",6),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Pie(n,i){if(n&1){let e=z();s(0,"mat-chip",27),g("removed",function(){let o=k(e).$implicit,r=v(3);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",28),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function Iie(n,i){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Aie(n,i){if(n&1){let e=z();s(0,"form",11)(1,"mat-form-field",16)(2,"mat-label"),d(3,"Template name"),l(),s(4,"input",17),g("input",function(o){k(e);let r=v(2);return T(r.templateName.set(o.target.value))}),l()(),s(5,"mat-form-field",16)(6,"mat-label"),d(7,"Default name format"),l(),s(8,"input",18),g("input",function(o){k(e);let r=v(2);return T(r.defaultName.set(o.target.value))}),l()(),s(9,"div",19)(10,"mat-form-field",20)(11,"mat-label"),d(12,"Symbol"),l(),s(13,"input",21),g("input",function(o){k(e);let r=v(2);return T(r.symbol.set(o.target.value))}),l()(),s(14,"button",22),g("click",function(){k(e);let o=v(2);return T(o.chooseSymbol())}),d(15,"Choose symbol"),l()(),s(16,"mat-form-field",16)(17,"mat-label"),d(18,"Tags"),l(),s(19,"mat-chip-grid",null,0),Y(21,Pie,4,1,"mat-chip",null,Ae),l(),s(23,"input",23),g("matChipInputTokenEnd",function(o){k(e);let r=v(2);return T(r.addTag(o))}),l()(),s(24,"mat-form-field",16)(25,"mat-label"),d(26,"Category"),l(),s(27,"mat-select",24),g("selectionChange",function(o){k(e);let r=v(2);return T(r.category.set(o.value))}),Y(28,Iie,2,2,"mat-option",25,Hi),l()(),s(30,"mat-form-field",16)(31,"mat-label"),d(32,"Number of ports"),l(),s(33,"input",26),g("input",function(o){k(e);let r=v(2);return T(r.numberOfPorts.set(+o.target.value))}),l()()()}if(n&2){let e=Pe(20),t=v(2);m(4),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.symbol()),m(8),Z(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Z(t.categories),m(5),C("value",t.numberOfPorts())}}function Oie(n,i){if(n&1){let e=z();s(0,"div",12)(1,"mat-form-field",29)(2,"mat-label"),d(3,"Usage notes"),l(),s(4,"textarea",30),g("input",function(o){k(e);let r=v(2);return T(r.usage.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function Nie(n,i){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("general"))}),s(3,"h3",9),d(4,"General settings"),l(),s(5,"mat-icon",10),d(6),l()(),A(7,Aie,34,7,"form",11),l(),s(8,"section",7)(9,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("usage"))}),s(10,"h3",9),d(11,"Usage"),l(),s(12,"mat-icon",10),d(13),l()(),A(14,Oie,5,1,"div",12),l(),s(15,"div",13)(16,"button",14),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(17,"Cancel"),l(),s(18,"button",15),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(19,"Save"),l()()()}if(n&2){let e=v();m(6),j(e.generalSettingsExpanded()?"expand_less":"expand_more"),m(),O(e.generalSettingsExpanded()?7:-1),m(6),j(e.usageExpanded()?"expand_less":"expand_more"),m(),O(e.usageExpanded()?14:-1)}}var dx=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);toasterService=f(te);builtInTemplatesConfigurationService=f(ya);validationService=f(zi);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);controller;ethernetHubTemplate;separatorKeysCodes=[13,188];categories=[];templateName=U("");defaultName=U("");symbol=U("");category=U("");numberOfPorts=U(0);tags=U([]);usage=U("");generalSettingsExpanded=U(!1);usageExpanded=U(!1);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.categories=this.builtInTemplatesConfigurationService.getCategoriesForEthernetHubs(),this.builtInTemplatesService.getTemplate(this.controller,t).subscribe({next:r=>{this.ethernetHubTemplate=r,this.ethernetHubTemplate.ports_mapping||(this.ethernetHubTemplate.ports_mapping=[]),this.ethernetHubTemplate.tags||(this.ethernetHubTemplate.tags=[]),this.templateName.set(r.name||""),this.defaultName.set(r.default_name_format||""),this.symbol.set(r.symbol||""),this.category.set(r.category||""),this.numberOfPorts.set(r.ports_mapping.length||0),this.tags.set(r.tags||[]),this.usage.set(r.usage||""),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","builtin","ethernet-hubs"])}onSave(){let e=this.validationService.required(this.templateName(),"Template name");if(!e.isValid){this.toasterService.error(e.errorMessage||"Template name is required");return}this.ethernetHubTemplate.name=this.templateName(),this.ethernetHubTemplate.default_name_format=this.defaultName(),this.ethernetHubTemplate.symbol=this.symbol(),this.ethernetHubTemplate.category=this.category(),this.ethernetHubTemplate.tags=this.tags(),this.ethernetHubTemplate.usage=this.usage();let t=this.numberOfPorts();this.ethernetHubTemplate.ports_mapping=[];for(let o=0;o<t;o++)this.ethernetHubTemplate.ports_mapping.push({name:`Ethernet${o}`,port_number:o});this.builtInTemplatesService.saveTemplate(this.controller,this.ethernetHubTemplate).subscribe({next:()=>{this.toasterService.success("Changes saved"),this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to save template";this.toasterService.error(r),this.cd.markForCheck()}})}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.symbol()}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&this.symbol.set(o)})}addTag(e){let t=(e.value||"").trim(),o=this.tags();t&&this.tags.set([...o,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),o=t.indexOf(e);if(o>=0){let r=[...t];r.splice(o,1),this.tags.set(r)}}toggleSection(e){switch(e){case"general":this.generalSettingsExpanded.set(!this.generalSettingsExpanded());break;case"usage":this.usageExpanded.set(!this.usageExpanded());break}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ethernet-hubs-template-details"]],inputs:{templateName:[1,"templateName"],defaultName:[1,"defaultName"],symbol:[1,"symbol"],category:[1,"category"],numberOfPorts:[1,"numberOfPorts"],tags:[1,"tags"],usage:[1,"usage"],generalSettingsExpanded:[1,"generalSettingsExpanded"],usageExpanded:[1,"usageExpanded"]},outputs:{templateName:"templateNameChange",defaultName:"defaultNameChange",symbol:"symbolChange",category:"categoryChange",numberOfPorts:"numberOfPortsChange",tags:"tagsChange",usage:"usageChange",generalSettingsExpanded:"generalSettingsExpandedChange",usageExpanded:"usageExpandedChange"},decls:6,vars:2,consts:[["chipList",""],[1,"ethernet-hub-details"],[1,"ethernet-hub-details__header"],["mat-icon-button","",1,"ethernet-hub-details__back-btn"],[1,"ethernet-hub-details__title"],[1,"ethernet-hub-details__content"],["mat-icon-button","",1,"ethernet-hub-details__back-btn",3,"click"],[1,"ethernet-hub-details__form-card"],[1,"ethernet-hub-details__section-header",3,"click"],[1,"ethernet-hub-details__section-title"],[1,"ethernet-hub-details__expand-icon"],[1,"ethernet-hub-details__form"],[1,"preferences__usage-form"],[1,"ethernet-hub-details__actions"],["mat-button","",1,"ethernet-hub-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"ethernet-hub-details__save-btn",3,"click"],["appearance","fill",1,"ethernet-hub-details__field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],[1,"ethernet-hub-details__symbol-row"],["appearance","fill",1,"ethernet-hub-details__field","ethernet-hub-details__field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"ethernet-hub-details__symbol-btn",3,"click"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"selectionChange","value"],[3,"value"],["matInput","","type","number","placeholder","Number of ports",3,"input","value"],[3,"removed"],["matChipRemove",""],["appearance","fill",1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,Die,3,0,"button",3),s(3,"h1",4),d(4,"Ethernet hub template configuration"),l()(),A(5,Nie,20,4,"main",5),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.ethernetHubTemplate?5:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,ie,de,W,pe,je,we,Me,et,Se,Ee,vt,At,_t,ti,Jn,vi,Ci,mi],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ethernet-hub-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ethernet-hub-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-hub-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ethernet-hub-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ethernet-hub-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ethernet-hub-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.ethernet-hub-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px}.ethernet-hub-details__section-header[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s ease;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.ethernet-hub-details__section-header[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.ethernet-hub-details__section-title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.ethernet-hub-details__expand-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:transform .2s ease}.ethernet-hub-details__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;padding:16px 24px 24px}.ethernet-hub-details__field[_ngcontent-%COMP%]{width:100%}.ethernet-hub-details__field--flex[_ngcontent-%COMP%]{flex:1}.ethernet-hub-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.ethernet-hub-details__symbol-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.ethernet-hub-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.ethernet-hub-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.ethernet-hub-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ethernet-hub-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ethernet-hub-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ethernet-hub-details__title[_ngcontent-%COMP%]{font-size:22px}.ethernet-hub-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ethernet-hub-details__section-header[_ngcontent-%COMP%]{padding:12px 16px}.ethernet-hub-details__form[_ngcontent-%COMP%]{padding:16px}.ethernet-hub-details__symbol-row[_ngcontent-%COMP%], .ethernet-hub-details__actions[_ngcontent-%COMP%]{flex-direction:column}.ethernet-hub-details__cancel-btn[_ngcontent-%COMP%], .ethernet-hub-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Fie=(n,i)=>i.template_id;function Rie(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/builtin")}}function Lie(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/builtin/ethernet-hubs/addtemplate")}}function Vie(n,i){n&1&&R(0,"app-empty-templates-list")}function Bie(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"device_hub"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(11,"mat-icon"),d(12,"delete"),l(),s(13,"span"),d(14,"Delete"),l()(),s(15,"a",16)(16,"mat-icon"),d(17,"edit"),l(),s(18,"span"),d(19,"Edit"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(10),C("routerLink",e.template_id)}}function zie(n,i){if(n&1&&(s(0,"nav",8),Y(1,Bie,20,4,"div",10,Fie),l()),n&2){let e=v();m(),Z(e.ethernetHubsTemplates)}}var mx=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);toasterService=f(te);cd=f(Q);controller;ethernetHubsTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.builtInTemplatesService.getTemplates(this.controller).subscribe({next:e=>{this.ethernetHubsTemplates=e.filter(t=>t.template_type==="ethernet_hub"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ethernet-hubs-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"ethernet-hubs"],[1,"ethernet-hubs__header"],["mat-icon-button","",1,"ethernet-hubs__back-btn",3,"routerLink"],[1,"ethernet-hubs__title"],["matTooltip","Add Ethernet hub template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"ethernet-hubs__add-btn",3,"routerLink"],[1,"ethernet-hubs__content"],[1,"ethernet-hubs__list"],[3,"deleteEvent","controller"],[1,"ethernet-hubs__list-item",3,"routerLink"],[1,"ethernet-hubs__list-icon"],[1,"ethernet-hubs__list-name"],["mat-icon-button","",1,"ethernet-hubs__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,Rie,3,1,"button",4),s(3,"h1",5),d(4,"Ethernet hubs templates"),l(),A(5,Lie,3,1,"button",6),l(),s(6,"main",7),A(7,Vie,1,0,"app-empty-templates-list"),A(8,zie,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.ethernetHubsTemplates.length?-1:7),m(),O(o.ethernetHubsTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ethernet-hubs__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ethernet-hubs__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-hubs__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ethernet-hubs__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.ethernet-hubs__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-hubs__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.ethernet-hubs__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ethernet-hubs__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.ethernet-hubs__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.ethernet-hubs__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.ethernet-hubs__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.ethernet-hubs__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.ethernet-hubs__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.ethernet-hubs__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ethernet-hubs__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ethernet-hubs__back-btn[_ngcontent-%COMP%], .ethernet-hubs__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ethernet-hubs__title[_ngcontent-%COMP%]{font-size:24px}.ethernet-hubs__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ethernet-hubs__list-item[_ngcontent-%COMP%]{padding:14px 16px}}"],changeDetection:0})}return n})();function jie(n,i){if(n&1){let e=z();s(0,"button",15),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var px=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);router=f(ht);toasterService=f(te);formBuilder=f(Vn);cd=f(Q);controller;formGroup;isLocalComputerChosen=!0;constructor(){this.formGroup=this.formBuilder.group({templateName:new Ye("",Ue.required),numberOfPorts:new Ye(8,Ue.required)})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}setControllerType(e){e==="local"&&(this.isLocalComputerChosen=!0)}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","builtin","ethernet-switches"])}addTemplate(){if(this.formGroup.invalid)this.toasterService.error("Fill all required fields");else{let e={template_id:Ai(),builtin:!1,name:this.formGroup.get("templateName").value,compute_id:"local",template_type:"ethernet_switch",category:"switch",console_type:"none",default_name_format:"Switch{0}",symbol:"ethernet_switch",ports_mapping:[],tags:[],usage:""},t=this.formGroup.get("numberOfPorts").value;for(let o=0;o<t;o++)e.ports_mapping.push({name:`Ethernet${o}`,port_number:o,ethertype:"0x8100",type:"access",vlan:1});this.builtInTemplatesService.addTemplate(this.controller,e).subscribe({next:()=>{this.toasterService.success("Template added successfully"),this.goBack()},error:o=>{let r=o.error?.message||o.message||"Failed to add ethernet switch template";this.toasterService.error(r),this.cd.markForCheck()}})}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ethernet-switches-add-template"]],decls:24,vars:3,consts:[[1,"ethernet-switch-add"],[1,"ethernet-switch-add__header"],["mat-icon-button","",1,"ethernet-switch-add__back-btn"],[1,"ethernet-switch-add__title"],[1,"ethernet-switch-add__content"],[1,"ethernet-switch-add__form-card"],[1,"ethernet-switch-add__radio-group"],["value","1",1,"ethernet-switch-add__radio",3,"click","checked"],[1,"ethernet-switch-add__form",3,"formGroup"],["appearance","fill",1,"ethernet-switch-add__field"],["formControlName","templateName","matInput","","type","text","placeholder","Template name"],["formControlName","numberOfPorts","matInput","","type","number","min","0","placeholder","Number of ports"],[1,"ethernet-switch-add__actions"],["mat-button","",1,"ethernet-switch-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"ethernet-switch-add__submit-btn",3,"click"],["mat-icon-button","",1,"ethernet-switch-add__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,jie,3,0,"button",2),s(3,"h1",3),d(4,"New Ethernet switch template"),l()(),s(5,"main",4)(6,"section",5)(7,"mat-radio-group",6)(8,"mat-radio-button",7),g("click",function(){return o.setControllerType("local")}),d(9," Run the Ethernet switch locally "),l()(),s(10,"form",8)(11,"mat-form-field",9)(12,"mat-label"),d(13,"Template name"),l(),R(14,"input",10),l(),s(15,"mat-form-field",9)(16,"mat-label"),d(17,"Number of ports"),l(),R(18,"input",11),l()()(),s(19,"div",12)(20,"button",13),g("click",function(){return o.goBack()}),d(21,"Cancel"),l(),s(22,"button",14),g("click",function(){return o.addTemplate()}),d(23," Add template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",o.formGroup))},dependencies:[ne,Xe,at,Ft,_r,Pt,rt,dc,Dt,Rt,zt,dt,ie,de,W,pe,je,io,xo,ho,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ethernet-switch-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ethernet-switch-add__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-switch-add__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ethernet-switch-add__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ethernet-switch-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ethernet-switch-add__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.ethernet-switch-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.ethernet-switch-add__radio[_ngcontent-%COMP%]{font-size:16px}.ethernet-switch-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ethernet-switch-add__field[_ngcontent-%COMP%]{width:100%}.ethernet-switch-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.ethernet-switch-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.ethernet-switch-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ethernet-switch-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ethernet-switch-add__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ethernet-switch-add__title[_ngcontent-%COMP%]{font-size:22px}.ethernet-switch-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ethernet-switch-add__form-card[_ngcontent-%COMP%]{padding:16px}.ethernet-switch-add__actions[_ngcontent-%COMP%]{flex-direction:column}.ethernet-switch-add__cancel-btn[_ngcontent-%COMP%], .ethernet-switch-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}"],changeDetection:0})}return n})();function $ie(n,i){n&1&&(s(0,"th",19),d(1,"Port number"),l())}function Hie(n,i){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=i.$implicit;m(),j(e.port_number)}}function Uie(n,i){n&1&&(s(0,"th",19),d(1,"VLAN"),l())}function Gie(n,i){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=i.$implicit;m(),j(e.vlan)}}function Wie(n,i){n&1&&(s(0,"th",19),d(1,"Type"),l())}function qie(n,i){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=i.$implicit;m(),j(e.type)}}function Qie(n,i){n&1&&(s(0,"th",19),d(1,"EtherType"),l())}function Xie(n,i){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=i.$implicit;m(),j(e.ethertype)}}function Kie(n,i){n&1&&(s(0,"th",19),d(1,"Actions"),l())}function Yie(n,i){if(n&1){let e=z();s(0,"td",20)(1,"button",21),g("click",function(){let o=k(e).$implicit,r=v();return T(r.delete(o))}),s(2,"mat-icon",22),d(3,"delete"),l()()()}}function Zie(n,i){n&1&&R(0,"tr",23)}function Jie(n,i){n&1&&R(0,"tr",24)}function eoe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function toe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}var Ed=(()=>{class n{ethernetPorts=[];newPortNumber=U(0);newPortVlan=U(1);newPortType=U("access");newPortEthertype=U("0x8100");builtInTemplatesConfigurationService=f(ya);toasterService=f(te);portTypes=ae([]);etherTypes=ae([]);displayedColumns=["port_number","vlan","type","ethertype","action"];ngOnInit(){this.getConfiguration(),this.newPortNumber.set(this.ethernetPorts.length)}getConfiguration(){this.etherTypes.set(this.builtInTemplatesConfigurationService.getEtherTypesForEthernetSwitches()),this.portTypes.set(this.builtInTemplatesConfigurationService.getPortTypesForEthernetSwitches())}onAdd(){if(this.ethernetPorts.some(o=>o.port_number===this.newPortNumber())){this.toasterService.error(`Port number ${this.newPortNumber()} already exists.`);return}let t={name:"Ethernet"+this.newPortNumber(),port_number:this.newPortNumber(),vlan:this.newPortVlan(),type:this.newPortType(),ethertype:this.newPortEthertype()};this.ethernetPorts.push(t),this.ethernetPorts=[].concat(this.ethernetPorts),this.newPortNumber.set(this.ethernetPorts.length)}delete(e){this.ethernetPorts=this.ethernetPorts.filter(t=>t!==e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ports"]],inputs:{ethernetPorts:"ethernetPorts",newPortNumber:[1,"newPortNumber"],newPortVlan:[1,"newPortVlan"],newPortType:[1,"newPortType"],newPortEthertype:[1,"newPortEthertype"]},outputs:{newPortNumber:"newPortNumberChange",newPortVlan:"newPortVlanChange",newPortType:"newPortTypeChange",newPortEthertype:"newPortEthertypeChange"},decls:34,vars:7,consts:[[1,"ports"],["mat-table","",1,"ports__table",3,"dataSource"],["matColumnDef","port_number"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","vlan"],["matColumnDef","type"],["matColumnDef","ethertype"],["matColumnDef","action"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"ports__add-row"],[1,"ports__field"],["matInput","","type","number","min","0","placeholder","Port",3,"input","value"],["matInput","","type","number","min","1","max","65535","placeholder","VLAN",3,"input","value"],["placeholder","Type",3,"selectionChange","value"],[3,"value"],["placeholder","EtherType",3,"selectionChange","value"],["mat-button","",1,"ports__add-btn",3,"click"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","matTooltip","Delete port","matTooltipClass","custom-tooltip",3,"click"],["aria-label","Delete port"],["mat-header-row",""],["mat-row",""]],template:function(t,o){t&1&&(s(0,"div",0)(1,"table",1),Le(2,2),xe(3,$ie,2,0,"th",3)(4,Hie,2,1,"td",4),Ve(),Le(5,5),xe(6,Uie,2,0,"th",3)(7,Gie,2,1,"td",4),Ve(),Le(8,6),xe(9,Wie,2,0,"th",3)(10,qie,2,1,"td",4),Ve(),Le(11,7),xe(12,Qie,2,0,"th",3)(13,Xie,2,1,"td",4),Ve(),Le(14,8),xe(15,Kie,2,0,"th",3)(16,Yie,4,0,"td",4),Ve(),xe(17,Zie,1,0,"tr",9)(18,Jie,1,0,"tr",10),l(),s(19,"div",11)(20,"mat-form-field",12)(21,"input",13),g("input",function(a){return o.newPortNumber.set(+a.target.value)}),l()(),s(22,"mat-form-field",12)(23,"input",14),g("input",function(a){return o.newPortVlan.set(+a.target.value)}),l()(),s(24,"mat-form-field",12)(25,"mat-select",15),g("selectionChange",function(a){return o.newPortType.set(a.value)}),Y(26,eoe,2,2,"mat-option",16,Ae),l()(),s(28,"mat-form-field",12)(29,"mat-select",17),g("selectionChange",function(a){return o.newPortEthertype.set(a.value)}),Y(30,toe,2,2,"mat-option",16,Ae),l()(),s(32,"button",18),g("click",function(){return o.onAdd()}),d(33,"Add"),l()()()),t&2&&(m(),C("dataSource",o.ethernetPorts),m(16),C("matHeaderRowDef",o.displayedColumns),m(),C("matRowDefColumns",o.displayedColumns),m(3),C("value",o.newPortNumber()),m(2),C("value",o.newPortVlan()),m(2),C("value",o.newPortType()),m(),Z(o.portTypes()),m(3),C("value",o.newPortEthertype()),m(),Z(o.etherTypes()))},dependencies:[ne,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W,pe,je,ie,de,we,Me,Se,Ee,vt,At,_t,wt,It,Fo],styles:[".ports[_ngcontent-%COMP%]{display:block;width:100%;overflow:hidden;flex-shrink:0}.ports__add-row[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;gap:8px;align-items:flex-start;padding:16px 24px}.ports__add-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}@media(max-width:768px){.ports__add-row[_ngcontent-%COMP%]{flex-direction:column;padding:16px}}"],changeDetection:0})}return n})();function noe(n,i){if(n&1){let e=z();s(0,"button",7),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function ioe(n,i){if(n&1){let e=z();s(0,"mat-chip",28),g("removed",function(){let o=k(e).$implicit,r=v(3);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",29),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function ooe(n,i){if(n&1&&(s(0,"mat-option",27),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function roe(n,i){if(n&1&&(s(0,"mat-option",27),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function aoe(n,i){if(n&1){let e=z();s(0,"form",12)(1,"mat-form-field",18)(2,"mat-label"),d(3,"Template name"),l(),s(4,"input",19),g("input",function(o){k(e);let r=v(2);return T(r.templateName.set(o.target.value))}),l()(),s(5,"mat-form-field",18)(6,"mat-label"),d(7,"Default name format"),l(),s(8,"input",20),g("input",function(o){k(e);let r=v(2);return T(r.defaultName.set(o.target.value))}),l()(),s(9,"div",21)(10,"mat-form-field",22)(11,"mat-label"),d(12,"Symbol"),l(),s(13,"input",23),g("input",function(o){k(e);let r=v(2);return T(r.symbol.set(o.target.value))}),l()(),s(14,"button",24),g("click",function(){k(e);let o=v(2);return T(o.chooseSymbol())}),d(15,"Choose symbol"),l()(),s(16,"mat-form-field",18)(17,"mat-label"),d(18,"Tags"),l(),s(19,"mat-chip-grid",null,0),Y(21,ioe,4,1,"mat-chip",null,Ae),l(),s(23,"input",25),g("matChipInputTokenEnd",function(o){k(e);let r=v(2);return T(r.addTag(o))}),l()(),s(24,"mat-form-field",18)(25,"mat-label"),d(26,"Category"),l(),s(27,"mat-select",26),g("selectionChange",function(o){k(e);let r=v(2);return T(r.category.set(o.value))}),Y(28,ooe,2,2,"mat-option",27,Hi),l()(),s(30,"mat-form-field",18)(31,"mat-label"),d(32,"Console type"),l(),s(33,"mat-select",26),g("selectionChange",function(o){k(e);let r=v(2);return T(r.consoleType.set(o.value))}),Y(34,roe,2,2,"mat-option",27,Ae),l()()()}if(n&2){let e=Pe(20),t=v(2);m(4),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.symbol()),m(8),Z(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Z(t.categories),m(5),C("value",t.consoleType()),m(),Z(t.consoleTypes)}}function soe(n,i){if(n&1&&R(0,"app-ports",13,1),n&2){let e=v(2);C("ethernetPorts",e.ethernetSwitchTemplate.ports_mapping)}}function loe(n,i){if(n&1){let e=z();s(0,"div",14)(1,"mat-form-field",30)(2,"mat-label"),d(3,"Usage notes"),l(),s(4,"textarea",31),g("input",function(o){k(e);let r=v(2);return T(r.usage.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function coe(n,i){if(n&1){let e=z();s(0,"main",6)(1,"section",8)(2,"div",9),g("click",function(){k(e);let o=v();return T(o.toggleSection("general"))}),s(3,"h3",10),d(4,"General settings"),l(),s(5,"mat-icon",11),d(6),l()(),A(7,aoe,36,7,"form",12),l(),s(8,"section",8)(9,"div",9),g("click",function(){k(e);let o=v();return T(o.toggleSection("ports"))}),s(10,"h3",10),d(11,"Port settings"),l(),s(12,"mat-icon",11),d(13),l()(),A(14,soe,2,1,"app-ports",13),l(),s(15,"section",8)(16,"div",9),g("click",function(){k(e);let o=v();return T(o.toggleSection("usage"))}),s(17,"h3",10),d(18,"Usage"),l(),s(19,"mat-icon",11),d(20),l()(),A(21,loe,5,1,"div",14),l(),s(22,"div",15)(23,"button",16),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(24,"Cancel"),l(),s(25,"button",17),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(26," Save "),l()()()}if(n&2){let e=v();m(6),j(e.generalSettingsExpanded()?"expand_less":"expand_more"),m(),O(e.generalSettingsExpanded()?7:-1),m(6),j(e.portsExpanded()?"expand_less":"expand_more"),m(),O(e.portsExpanded()?14:-1),m(6),j(e.usageExpanded()?"expand_less":"expand_more"),m(),O(e.usageExpanded()?21:-1)}}var ux=(()=>{class n{portsComponent;route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);toasterService=f(te);builtInTemplatesConfigurationService=f(ya);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);controller;ethernetSwitchTemplate;separatorKeysCodes=[13,188];categories=[];consoleTypes=[];templateName=U("");defaultName=U("");symbol=U("");category=U("");consoleType=U("");tags=U([]);usage=U("");generalSettingsExpanded=U(!1);portsExpanded=U(!1);usageExpanded=U(!1);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.getConfiguration(),this.builtInTemplatesService.getTemplate(this.controller,t).subscribe({next:r=>{this.ethernetSwitchTemplate=r,this.ethernetSwitchTemplate.tags||(this.ethernetSwitchTemplate.tags=[]),this.templateName.set(r.name||""),this.defaultName.set(r.default_name_format||""),this.symbol.set(r.symbol||""),this.category.set(r.category||""),this.consoleType.set(r.console_type||""),this.tags.set(r.tags||[]),this.usage.set(r.usage||""),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}getConfiguration(){this.categories=this.builtInTemplatesConfigurationService.getCategoriesForEthernetSwitches(),this.consoleTypes=this.builtInTemplatesConfigurationService.getConsoleTypesForEthernetSwitches()}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","builtin","ethernet-switches"])}onSave(){this.ethernetSwitchTemplate.name=this.templateName(),this.ethernetSwitchTemplate.default_name_format=this.defaultName(),this.ethernetSwitchTemplate.symbol=this.symbol(),this.ethernetSwitchTemplate.category=this.category(),this.ethernetSwitchTemplate.console_type=this.consoleType(),this.ethernetSwitchTemplate.tags=this.tags(),this.ethernetSwitchTemplate.usage=this.usage(),this.portsComponent&&(this.ethernetSwitchTemplate.ports_mapping=this.portsComponent.ethernetPorts),this.builtInTemplatesService.saveTemplate(this.controller,this.ethernetSwitchTemplate).subscribe({next:()=>{this.toasterService.success("Changes saved"),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to save template";this.toasterService.error(t),this.cd.markForCheck()}})}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.symbol()}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&this.symbol.set(o)})}addTag(e){let t=(e.value||"").trim(),o=this.tags();t&&this.tags.set([...o,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),o=t.indexOf(e);if(o>=0){let r=[...t];r.splice(o,1),this.tags.set(r)}}toggleSection(e){switch(e){case"general":this.generalSettingsExpanded.set(!this.generalSettingsExpanded());break;case"ports":this.portsExpanded.set(!this.portsExpanded());break;case"usage":this.usageExpanded.set(!this.usageExpanded());break}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ethernet-switches-template-details"]],viewQuery:function(t,o){if(t&1&&xn(Ed,5),t&2){let r;mt(r=pt())&&(o.portsComponent=r.first)}},inputs:{templateName:[1,"templateName"],defaultName:[1,"defaultName"],symbol:[1,"symbol"],category:[1,"category"],consoleType:[1,"consoleType"],tags:[1,"tags"],usage:[1,"usage"],generalSettingsExpanded:[1,"generalSettingsExpanded"],portsExpanded:[1,"portsExpanded"],usageExpanded:[1,"usageExpanded"]},outputs:{templateName:"templateNameChange",defaultName:"defaultNameChange",symbol:"symbolChange",category:"categoryChange",consoleType:"consoleTypeChange",tags:"tagsChange",usage:"usageChange",generalSettingsExpanded:"generalSettingsExpandedChange",portsExpanded:"portsExpandedChange",usageExpanded:"usageExpandedChange"},decls:6,vars:2,consts:[["chipList",""],["ports",""],[1,"ethernet-switch-details"],[1,"ethernet-switch-details__header"],["mat-icon-button","",1,"ethernet-switch-details__back-btn"],[1,"ethernet-switch-details__title"],[1,"ethernet-switch-details__content"],["mat-icon-button","",1,"ethernet-switch-details__back-btn",3,"click"],[1,"ethernet-switch-details__form-card"],[1,"ethernet-switch-details__section-header",3,"click"],[1,"ethernet-switch-details__section-title"],[1,"ethernet-switch-details__expand-icon"],[1,"ethernet-switch-details__form"],[3,"ethernetPorts"],[1,"preferences__usage-form"],[1,"ethernet-switch-details__actions"],["mat-button","",1,"ethernet-switch-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"ethernet-switch-details__save-btn",3,"click"],["appearance","fill",1,"ethernet-switch-details__field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],[1,"ethernet-switch-details__symbol-row"],["appearance","fill",1,"ethernet-switch-details__field","ethernet-switch-details__field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"ethernet-switch-details__symbol-btn",3,"click"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"selectionChange","value"],[3,"value"],[3,"removed"],["matChipRemove",""],["appearance","fill",1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,noe,3,0,"button",4),s(3,"h1",5),d(4,"Ethernet switch template configuration"),l()(),A(5,coe,27,6,"main",6),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.ethernetSwitchTemplate?5:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,ie,de,W,pe,je,we,Me,et,Se,Ee,vt,At,_t,ti,Jn,vi,Ci,mi,Ed],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ethernet-switch-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ethernet-switch-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-switch-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ethernet-switch-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ethernet-switch-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ethernet-switch-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.ethernet-switch-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px;display:flex;flex-direction:column}.ethernet-switch-details__section-header[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s ease;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.ethernet-switch-details__section-header[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.ethernet-switch-details__section-title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.ethernet-switch-details__expand-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:transform .2s ease}.ethernet-switch-details__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;padding:16px 24px 24px}.ethernet-switch-details__field[_ngcontent-%COMP%]{width:100%}.ethernet-switch-details__field--flex[_ngcontent-%COMP%]{flex:1}.ethernet-switch-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.ethernet-switch-details__symbol-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.ethernet-switch-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.ethernet-switch-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.ethernet-switch-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ethernet-switch-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ethernet-switch-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ethernet-switch-details__title[_ngcontent-%COMP%]{font-size:22px}.ethernet-switch-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ethernet-switch-details__section-header[_ngcontent-%COMP%]{padding:12px 16px}.ethernet-switch-details__form[_ngcontent-%COMP%]{padding:16px}.ethernet-switch-details__symbol-row[_ngcontent-%COMP%], .ethernet-switch-details__actions[_ngcontent-%COMP%]{flex-direction:column}.ethernet-switch-details__cancel-btn[_ngcontent-%COMP%], .ethernet-switch-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var doe=(n,i)=>i.template_id;function moe(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/builtin")}}function poe(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/builtin/ethernet-switches/addtemplate")}}function uoe(n,i){n&1&&R(0,"app-empty-templates-list")}function hoe(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"settings_ethernet"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(11,"mat-icon"),d(12,"delete"),l(),s(13,"span"),d(14,"Delete"),l()(),s(15,"a",16)(16,"mat-icon"),d(17,"edit"),l(),s(18,"span"),d(19,"Edit"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(10),C("routerLink",e.template_id)}}function foe(n,i){if(n&1&&(s(0,"nav",8),Y(1,hoe,20,4,"div",10,doe),l()),n&2){let e=v();m(),Z(e.ethernetSwitchesTemplates)}}var hx=(()=>{class n{route=f(lt);controllerService=f(Je);builtInTemplatesService=f(yr);toasterService=f(te);cd=f(Q);controller;ethernetSwitchesTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.builtInTemplatesService.getTemplates(this.controller).subscribe({next:e=>{this.ethernetSwitchesTemplates=e.filter(t=>t.template_type==="ethernet_switch"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ethernet-switches-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"ethernet-switches"],[1,"ethernet-switches__header"],["mat-icon-button","",1,"ethernet-switches__back-btn",3,"routerLink"],[1,"ethernet-switches__title"],["matTooltip","Add Ethernet switch template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"ethernet-switches__add-btn",3,"routerLink"],[1,"ethernet-switches__content"],[1,"ethernet-switches__list"],[3,"deleteEvent","controller"],[1,"ethernet-switches__list-item",3,"routerLink"],[1,"ethernet-switches__list-icon"],[1,"ethernet-switches__list-name"],["mat-icon-button","",1,"ethernet-switches__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,moe,3,1,"button",4),s(3,"h1",5),d(4,"Ethernet switches templates"),l(),A(5,poe,3,1,"button",6),l(),s(6,"main",7),A(7,uoe,1,0,"app-empty-templates-list"),A(8,foe,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.ethernetSwitchesTemplates.length?-1:7),m(),O(o.ethernetSwitchesTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ethernet-switches__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ethernet-switches__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-switches__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ethernet-switches__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.ethernet-switches__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.ethernet-switches__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.ethernet-switches__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ethernet-switches__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.ethernet-switches__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.ethernet-switches__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.ethernet-switches__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.ethernet-switches__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.ethernet-switches__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.ethernet-switches__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ethernet-switches__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ethernet-switches__back-btn[_ngcontent-%COMP%], .ethernet-switches__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ethernet-switches__title[_ngcontent-%COMP%]{font-size:24px}.ethernet-switches__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ethernet-switches__list-item[_ngcontent-%COMP%]{padding:14px 16px}}"],changeDetection:0})}return n})();var goe=["*"];function _oe(n,i){n&1&&on(0)}var oP=(()=>{class n{_elementRef=f(Zt);constructor(){}focus(){this._elementRef.nativeElement.focus()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"]})}return n})(),rP=(()=>{class n{template=f(Oo);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkStepLabel",""]]})}return n})();var pu={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},voe=new cn("STEPPER_GLOBAL_OPTIONS"),fx=(()=>{class n{_stepperOptions;_stepper=f(Zh);_displayDefaultIndicatorType;stepLabel;_childForms;content;stepControl;get interacted(){return this._interacted()}set interacted(e){this._interacted.set(e)}_interacted=ae(!1);interactedStream=new ve;label;errorMessage;ariaLabel;ariaLabelledby;get state(){return this._state()}set state(e){this._state.set(e)}_state=ae(void 0);get editable(){return this._editable()}set editable(e){this._editable.set(e)}_editable=ae(!0);optional=!1;get completed(){let e=this._completedOverride(),t=this._interacted();return e??(t&&(!this.stepControl||this.stepControl.valid))}set completed(e){this._completedOverride.set(e)}_completedOverride=ae(null);index=ae(-1);isSelected=Jt(()=>this._stepper.selectedIndex===this.index());indicatorType=Jt(()=>{let e=this.isSelected(),t=this.completed,o=this._state()??pu.NUMBER,r=this._editable();return this._showError()&&this.hasError&&!e?pu.ERROR:this._displayDefaultIndicatorType?!t||e?pu.NUMBER:r?pu.EDIT:pu.DONE:t&&!e?pu.DONE:t&&e?o:r&&e?pu.EDIT:o});isNavigable=Jt(()=>{let e=this.isSelected();return this.completed||e||!this._stepper.linear});get hasError(){let e=this._customError();return e??this._getDefaultError()}set hasError(e){this._customError.set(e)}_customError=ae(null);_getDefaultError(){return this.interacted&&!!this.stepControl?.invalid}constructor(){let e=f(voe,{optional:!0});this._stepperOptions=e||{},this._displayDefaultIndicatorType=this._stepperOptions.displayDefaultIndicatorType!==!1}select(){this._stepper.selected=this}reset(){this._interacted.set(!1),this._completedOverride()!=null&&this._completedOverride.set(!1),this._customError()!=null&&this._customError.set(!1),this.stepControl&&(this._childForms?.forEach(e=>e.resetForm?.()),this.stepControl.reset())}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this._interacted()||(this._interacted.set(!0),this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??this._customError()!=null}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["cdk-step"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,rP,5)(r,o4,5),t&2){let a;mt(a=pt())&&(o.stepLabel=a.first),mt(a=pt())&&(o._childForms=a)}},viewQuery:function(t,o){if(t&1&&xn(Oo,7),t&2){let r;mt(r=pt())&&(o.content=r.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],state:"state",editable:[2,"editable","editable",Ct],optional:[2,"optional","optional",Ct],completed:[2,"completed","completed",Ct],hasError:[2,"hasError","hasError",Ct]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],features:[bn],ngContentSelectors:goe,decls:1,vars:0,template:function(t,o){t&1&&(ii(),ju(0,_oe,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}return n})(),Zh=(()=>{class n{_dir=f(Ka,{optional:!0});_changeDetectorRef=f(Q);_elementRef=f(Zt);_destroyed=new He;_keyManager;_steps;steps=new Il;_stepHeader;_sortedHeaders=new Il;linear=!1;get selectedIndex(){return this._selectedIndex()}set selectedIndex(e){this._steps?(this._isValidIndex(e),this.selectedIndex!==e&&(this.selected?._markAsInteracted(),!this._anyControlsInvalidOrPending(e)&&(e>=this.selectedIndex||this.steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e))):this._selectedIndex.set(e)}_selectedIndex=ae(0);get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}selectionChange=new ve;selectedIndexChange=new ve;_groupId=f(Mo).getId("cdk-stepper-");get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation(e==="vertical")}_orientation="horizontal";constructor(){}ngAfterContentInit(){this._steps.changes.pipe(pi(this._steps),tt(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(t=>t._stepper===this)),this.steps.forEach((t,o)=>t.index.set(o)),this.steps.notifyOnChanges()})}ngAfterViewInit(){if(this._stepHeader.changes.pipe(pi(this._stepHeader),tt(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((t,o)=>t._elementRef.nativeElement.compareDocumentPosition(o._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new Gd(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation(this._orientation==="vertical"),this._keyManager.updateActiveItem(this.selectedIndex),(this._dir?this._dir.change:Nn()).pipe(pi(this._layoutDirection()),tt(this._destroyed)).subscribe(e=>this._keyManager?.withHorizontalOrientation(e)),this._keyManager.updateActiveItem(this.selectedIndex),this.steps.changes.subscribe(()=>{this.selected||this._selectedIndex.set(Math.max(this.selectedIndex-1,0))}),this._isValidIndex(this.selectedIndex)||this._selectedIndex.set(0),this.linear&&this.selectedIndex>0){let e=this.steps.toArray().slice(0,this._selectedIndex());for(let t of e)t._markAsInteracted()}}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex()+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex()-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`${this._groupId}-label-${e}`}_getStepContentId(e){return`${this._groupId}-content-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){let t=e-this._selectedIndex();return t<0?this._layoutDirection()==="rtl"?"next":"previous":t>0?this._layoutDirection()==="rtl"?"previous":"next":"current"}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex()}_updateSelectedItemIndex(e){let t=this.steps.toArray(),o=this._selectedIndex();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:o,selectedStep:t[e],previouslySelectedStep:t[o]}),this._keyManager&&(this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e)),this._selectedIndex.set(e),this.selectedIndexChange.emit(e),this._stateChanged()}_onKeydown(e){let t=fa(e),o=e.keyCode,r=this._keyManager;r?.activeItemIndex!=null&&!t&&(o===32||o===13)?(this.selectedIndex=r.activeItemIndex,e.preventDefault()):r?.setFocusOrigin("keyboard").onKeydown(e)}_anyControlsInvalidOrPending(e){return this.linear&&e>=0?this.steps.toArray().slice(0,e).some(t=>{let o=t.stepControl;return(o?o.invalid||o.pending||!t.interacted:!t.completed)&&!t.optional&&!t._completedOverride()}):!1}_layoutDirection(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_containsFocus(){let e=this._elementRef.nativeElement,t=lC();return e===t||e.contains(t)}_isValidIndex(e){return e>-1&&(!this.steps||e<this.steps.length)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkStepper",""]],contentQueries:function(t,o,r){if(t&1&&Ki(r,fx,5)(r,oP,5),t&2){let a;mt(a=pt())&&(o._steps=a),mt(a=pt())&&(o._stepHeader=a)}},inputs:{linear:[2,"linear","linear",Ct],selectedIndex:[2,"selectedIndex","selectedIndex",No],selected:"selected",orientation:"orientation"},outputs:{selectionChange:"selectionChange",selectedIndexChange:"selectedIndexChange"},exportAs:["cdkStepper"]})}return n})(),M8=(()=>{class n{_stepper=f(Zh);type="submit";constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["button","cdkStepperNext",""]],hostVars:1,hostBindings:function(t,o){t&1&&g("click",function(){return o._stepper.next()}),t&2&&Wo("type",o.type)},inputs:{type:"type"}})}return n})(),k8=(()=>{class n{_stepper=f(Zh);type="button";constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["button","cdkStepperPrevious",""]],hostVars:1,hostBindings:function(t,o){t&1&&g("click",function(){return o._stepper.previous()}),t&2&&Wo("type",o.type)},inputs:{type:"type"}})}return n})(),T8=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[hi]})}return n})();var Coe=(n,i,e)=>({index:n,active:i,optional:e});function boe(n,i){if(n&1&&ro(0,2),n&2){let e=v();C("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",tC(2,Coe,e.index,e.active,e.optional))}}function xoe(n,i){if(n&1&&(s(0,"span",7),d(1),l()),n&2){let e=v(2);m(),j(e._getDefaultTextForState(e.state))}}function yoe(n,i){if(n&1&&(s(0,"span",8),d(1),l()),n&2){let e=v(3);m(),j(e._intl.completedLabel)}}function Soe(n,i){if(n&1&&(s(0,"span",8),d(1),l()),n&2){let e=v(3);m(),j(e._intl.editableLabel)}}function woe(n,i){if(n&1&&(A(0,yoe,2,1,"span",8)(1,Soe,2,1,"span",8),s(2,"mat-icon",7),d(3),l()),n&2){let e=v(2);O(e.state==="done"?0:e.state==="edit"?1:-1),m(3),j(e._getDefaultTextForState(e.state))}}function Moe(n,i){if(n&1&&A(0,xoe,2,1,"span",7)(1,woe,4,2),n&2){let e,t=v();O((e=t.state)==="number"?0:1)}}function koe(n,i){n&1&&(s(0,"div",4),ro(1,9),l()),n&2&&(m(),C("ngTemplateOutlet",i.template))}function Toe(n,i){if(n&1&&(s(0,"div",4),d(1),l()),n&2){let e=v();m(),j(e.label)}}function Eoe(n,i){if(n&1&&(s(0,"div",5),d(1),l()),n&2){let e=v();m(),j(e._intl.optionalLabel)}}function Doe(n,i){if(n&1&&(s(0,"div",6),d(1),l()),n&2){let e=v();m(),j(e.errorMessage)}}var E8=["*"];function Poe(n,i){}function Ioe(n,i){if(n&1&&(on(0),xe(1,Poe,0,0,"ng-template",0)),n&2){let e=v();m(),C("cdkPortalOutlet",e._portal)}}var Aoe=["animatedContainer"],D8=n=>({steps:n}),P8=n=>({step:n});function Ooe(n,i){n&1&&on(0)}function Noe(n,i){if(n&1&&(s(0,"div",5),ro(1,9)(2,6),l()),n&2){let e=v(2),t=Pe(6);m(),C("ngTemplateOutlet",e.headerPrefix()),m(),C("ngTemplateOutlet",t)("ngTemplateOutletContext",dn(3,D8,e.steps))}}function Foe(n,i){if(n&1&&ro(0,6),n&2){let e=v(2),t=Pe(6);C("ngTemplateOutlet",t)("ngTemplateOutletContext",dn(2,D8,e.steps))}}function Roe(n,i){if(n&1&&(s(0,"div",10,2),ro(2,9),l()),n&2){let e=i.$implicit,t=i.$index,o=v(2);er("mat-horizontal-stepper-content-"+o._getAnimationDirection(t)),C("id",o._getStepContentId(t)),qt("aria-labelledby",o._getStepLabelId(t))("inert",o.selectedIndex===t?null:""),m(2),C("ngTemplateOutlet",e.content)}}function Loe(n,i){if(n&1&&(s(0,"div",3),A(1,Noe,3,5,"div",5)(2,Foe,1,4,"ng-container",6),s(3,"div",7),Y(4,Roe,3,6,"div",8,Ae),l()()),n&2){let e=v();m(),O(e.headerPrefix()?1:2),m(3),Z(e.steps)}}function Voe(n,i){if(n&1&&ro(0,9),n&2){let e=v(2);C("ngTemplateOutlet",e.headerPrefix())}}function Boe(n,i){if(n&1&&(s(0,"div",11),ro(1,6),s(2,"div",12,2)(4,"div",13)(5,"div",14),ro(6,9),l()()()()),n&2){let e=i.$implicit,t=i.$index,o=i.$index,r=i.$count,a=v(2),c=Pe(4);m(),C("ngTemplateOutlet",c)("ngTemplateOutletContext",dn(10,P8,e)),m(),Be("mat-stepper-vertical-line",o!==r-1)("mat-vertical-content-container-active",a.selectedIndex===t),qt("inert",a.selectedIndex===t?null:""),m(2),C("id",a._getStepContentId(t)),qt("aria-labelledby",a._getStepLabelId(t)),m(2),C("ngTemplateOutlet",e.content)}}function zoe(n,i){if(n&1&&(s(0,"div",4),A(1,Voe,1,1,"ng-container",9),Y(2,Boe,7,12,"div",11,Ae),l()),n&2){let e=v();m(),O(e.headerPrefix()?1:-1),m(),Z(e.steps)}}function joe(n,i){if(n&1){let e=z();s(0,"mat-step-header",15),g("click",function(){let o=k(e).step;return T(o.select())})("keydown",function(o){k(e);let r=v();return T(r._onKeydown(o))}),l()}if(n&2){let e=i.step,t=v();Be("mat-horizontal-stepper-header",t.orientation==="horizontal")("mat-vertical-stepper-header",t.orientation==="vertical"),C("tabIndex",t._getFocusIndex()===e.index()?0:-1)("id",t._getStepLabelId(e.index()))("index",e.index())("state",e.indicatorType())("label",e.stepLabel||e.label)("selected",e.isSelected())("active",e.isNavigable())("optional",e.optional)("errorMessage",e.errorMessage)("iconOverrides",t._iconOverrides)("disableRipple",t.disableRipple||!e.isNavigable())("color",e.color||t.color),qt("role",t.orientation==="horizontal"?"tab":"button")("aria-posinset",t.orientation==="horizontal"?e.index()+1:null)("aria-setsize",t.orientation==="horizontal"?t.steps.length:null)("aria-selected",t.orientation==="horizontal"?e.isSelected():null)("aria-current",t.orientation==="vertical"&&e.isSelected()?"step":null)("aria-disabled",t.orientation==="vertical"&&e.isSelected()?"true":null)("aria-expanded",t.orientation==="vertical"?e.isSelected():null)("aria-controls",t._getStepContentId(e.index()))("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null)("aria-disabled",e.isNavigable()?null:!0)}}function $oe(n,i){n&1&&R(0,"div",17)}function Hoe(n,i){if(n&1&&(ro(0,6),A(1,$oe,1,0,"div",17)),n&2){let e=i.$implicit,t=i.$index,o=i.$count;v(2);let r=Pe(4);C("ngTemplateOutlet",r)("ngTemplateOutletContext",dn(3,P8,e)),m(),O(t!==o-1?1:-1)}}function Uoe(n,i){if(n&1&&(s(0,"div",16),Y(1,Hoe,2,5,null,null,Ae),l()),n&2){let e=i.steps;m(),Z(e)}}var A0=(()=>{class n extends rP{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["","matStepLabel",""]],features:[si]})}return n})(),Goe=(()=>{class n{changes=new He;optionalLabel="Optional";completedLabel="Completed";editableLabel="Editable";static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),aP=(()=>{class n extends oP{_intl=f(Goe);_focusMonitor=f(Aa);_intlSubscription;state;label;errorMessage;iconOverrides;index;selected=!1;active=!1;optional=!1;disableRipple=!1;color;constructor(){super();let e=f(cr);e.load(ia),e.load(bC);let t=f(Q);this._intlSubscription=this._intl.changes.subscribe(()=>t.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(e,t){e?this._focusMonitor.focusVia(this._elementRef,e,t):this._elementRef.nativeElement.focus(t)}_stringLabel(){return this.label instanceof A0?null:this.label}_templateLabel(){return this.label instanceof A0?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getDefaultTextForState(e){return e=="number"?`${this.index+1}`:e=="edit"?"create":e=="error"?"warning":e}_hasEmptyLabel(){return!this._stringLabel()&&!this._templateLabel()&&!this._hasOptionalLabel()&&!this._hasErrorLabel()}_hasOptionalLabel(){return this.optional&&this.state!=="error"}_hasErrorLabel(){return this.state==="error"}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-step-header"]],hostAttrs:["role","",1,"mat-step-header"],hostVars:4,hostBindings:function(t,o){t&2&&(er("mat-"+(o.color||"primary")),Be("mat-step-header-empty-label",o._hasEmptyLabel()))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},features:[si],decls:10,vars:17,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-step-label"],[1,"mat-step-text-label"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[3,"ngTemplateOutlet"]],template:function(t,o){if(t&1&&(R(0,"div",0),s(1,"div")(2,"div",1),A(3,boe,1,6,"ng-container",2)(4,Moe,2,1),l()(),s(5,"div",3),A(6,koe,2,1,"div",4)(7,Toe,2,1,"div",4),A(8,Eoe,2,1,"div",5),A(9,Doe,2,1,"div",6),l()),t&2){let r;C("matRippleTrigger",o._getHostElement())("matRippleDisabled",o.disableRipple),m(),er(Ui("mat-step-icon-state-",o.state," mat-step-icon")),Be("mat-step-icon-selected",o.selected),m(2),O(o.iconOverrides&&o.iconOverrides[o.state]?3:4),m(2),Be("mat-step-label-active",o.active)("mat-step-label-selected",o.selected)("mat-step-label-error",o.state=="error"),m(),O((r=o._templateLabel())?6:o._stringLabel()?7:-1,r),m(2),O(o._hasOptionalLabel()?8:-1),m(),O(o._hasErrorLabel()?9:-1)}},dependencies:[Us,ck,de],styles:[`.mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus-visible .mat-focus-indicator::before{content:""}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-sys-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-sys-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}@media(forced-colors: active){.mat-step-header{outline:solid 1px}.mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.mat-step-header[aria-disabled=true]{outline-color:GrayText}.mat-step-header[aria-disabled=true] .mat-step-label,.mat-step-header[aria-disabled=true] .mat-step-icon,.mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-sys-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-sys-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color, transparent);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-sys-error))}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle;font-family:var(--mat-stepper-header-label-text-font, var(--mat-sys-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-sys-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-sys-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-sys-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-sys-title-small-weight))}.mat-step-header-empty-label .mat-step-label{min-width:0}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-done-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-sys-on-primary))}
`],encapsulation:2,changeDetection:0})}return n})(),Woe=(()=>{class n{templateRef=f(Oo);name;constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:[0,"matStepperIcon","name"]}})}return n})(),qoe=(()=>{class n{_template=f(Oo);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["ng-template","matStepContent",""]]})}return n})(),Hl=(()=>{class n extends fx{_errorStateMatcher=f(fd,{skipSelf:!0});_viewContainerRef=f(oo);_isSelected=So.EMPTY;stepLabel=void 0;color;_lazyContent;_portal;ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe(Un(()=>this._stepper.selectionChange.pipe(Lt(e=>e.selectedStep===this),pi(this._stepper.selected===this)))).subscribe(e=>{e&&this._lazyContent&&!this._portal&&(this._portal=new pd(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(e,t){let o=this._errorStateMatcher.isErrorState(e,t),r=!!(e&&e.invalid&&this.interacted);return o||r}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275cmp=F({type:n,selectors:[["mat-step"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,A0,5)(r,qoe,5),t&2){let a;mt(a=pt())&&(o.stepLabel=a.first),mt(a=pt())&&(o._lazyContent=a.first)}},hostAttrs:["hidden",""],inputs:{color:"color"},exportAs:["matStep"],features:[fn([{provide:fd,useExisting:n},{provide:fx,useExisting:n}]),si],ngContentSelectors:E8,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(t,o){t&1&&(ii(),xe(0,Ioe,2,1,"ng-template"))},dependencies:[Gu],encapsulation:2,changeDetection:0})}return n})(),Ul=(()=>{class n extends Zh{_ngZone=f(Vi);_renderer=f(Si);_animationsDisabled=qo();_cleanupTransition;_isAnimating=ae(!1);_stepHeader=void 0;_animatedContainers;_steps=void 0;steps=new Il;_icons;animationDone=new ve;disableRipple=!1;color;labelPosition="end";headerPosition="top";headerPrefix=le(null);_iconOverrides={};get animationDuration(){return this._animationDuration}set animationDuration(e){this._animationDuration=/^\d+$/.test(e)?e+"ms":e}_animationDuration="";_isServer=!f($s).isBrowser;constructor(){super();let t=f(Zt).nativeElement.nodeName.toLowerCase();this.orientation=t==="mat-vertical-stepper"?"vertical":"horizontal"}ngAfterContentInit(){super.ngAfterContentInit(),this._icons.forEach(({name:e,templateRef:t})=>this._iconOverrides[e]=t),this.steps.changes.pipe(tt(this._destroyed)).subscribe(()=>this._stateChanged()),this.selectedIndexChange.pipe(tt(this._destroyed)).subscribe(()=>{let e=this._getAnimationDuration();e==="0ms"||e==="0s"?this._onAnimationDone():this._isAnimating.set(!0)}),this._ngZone.runOutsideAngular(()=>{this._animationsDisabled||setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-stepper-animations-enabled"),this._cleanupTransition=this._renderer.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionend)},200)})}ngAfterViewInit(){if(super.ngAfterViewInit(),typeof queueMicrotask=="function"){let e=!1;this._animatedContainers.changes.pipe(pi(null),tt(this._destroyed)).subscribe(()=>queueMicrotask(()=>{e||(e=!0,this.animationDone.emit()),this._stateChanged()}))}}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransition?.()}_getAnimationDuration(){return this._animationsDisabled?"0ms":this.animationDuration?this.animationDuration:this.orientation==="horizontal"?"500ms":"225ms"}_handleTransitionend=e=>{let t=e.target;if(!t)return;let o=this.orientation==="horizontal"&&e.propertyName==="transform"&&t.classList.contains("mat-horizontal-stepper-content-current"),r=this.orientation==="vertical"&&e.propertyName==="grid-template-rows"&&t.classList.contains("mat-vertical-content-container-active");(o||r)&&this._animatedContainers.find(c=>c.nativeElement===t)&&this._onAnimationDone()};_onAnimationDone(){this._isAnimating.set(!1),this.animationDone.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-stepper"],["mat-vertical-stepper"],["mat-horizontal-stepper"],["","matStepper",""]],contentQueries:function(t,o,r){if(t&1&&Ki(r,Hl,5)(r,Woe,5),t&2){let a;mt(a=pt())&&(o._steps=a),mt(a=pt())&&(o._icons=a)}},viewQuery:function(t,o){if(t&1&&xn(aP,5)(Aoe,5),t&2){let r;mt(r=pt())&&(o._stepHeader=r),mt(r=pt())&&(o._animatedContainers=r)}},hostVars:14,hostBindings:function(t,o){t&2&&(nn("--mat-stepper-animation-duration",o._getAnimationDuration()),Be("mat-stepper-horizontal",o.orientation==="horizontal")("mat-stepper-vertical",o.orientation==="vertical")("mat-stepper-label-position-end",o.orientation==="horizontal"&&o.labelPosition=="end")("mat-stepper-label-position-bottom",o.orientation==="horizontal"&&o.labelPosition=="bottom")("mat-stepper-header-position-bottom",o.headerPosition==="bottom")("mat-stepper-animating",o._isAnimating()))},inputs:{disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",headerPrefix:[1,"headerPrefix"],animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],features:[fn([{provide:Zh,useExisting:n}]),si],ngContentSelectors:E8,decls:7,vars:2,consts:[["stepTemplate",""],["horizontalStepsTemplate",""],["animatedContainer",""],[1,"mat-horizontal-stepper-wrapper"],[1,"mat-vertical-stepper-wrapper"],[1,"mat-horizontal-stepper-header-wrapper"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-horizontal-content-container"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id","class"],[3,"ngTemplateOutlet"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id"],[1,"mat-step"],[1,"mat-vertical-content-container"],["role","region",1,"mat-vertical-stepper-content",3,"id"],[1,"mat-vertical-content"],[3,"click","keydown","tabIndex","id","index","state","label","selected","active","optional","errorMessage","iconOverrides","disableRipple","color"],["aria-orientation","horizontal","role","tablist",1,"mat-horizontal-stepper-header-container"],[1,"mat-stepper-horizontal-line"]],template:function(t,o){if(t&1&&(ii(),A(0,Ooe,1,0),A(1,Loe,6,1,"div",3)(2,zoe,4,1,"div",4),xe(3,joe,1,27,"ng-template",null,0,Rg)(5,Uoe,3,0,"ng-template",null,1,Rg)),t&2){let r;O(o._isServer?0:-1),m(),O((r=o.orientation)==="horizontal"?1:r==="vertical"?2:-1)}},dependencies:[ck,aP],styles:[`.mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-sys-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-sys-surface))}.mat-horizontal-stepper-header-wrapper{align-items:center;display:flex}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center;flex-grow:1}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:"";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;overflow:hidden;align-items:center;padding:0 24px;height:var(--mat-stepper-header-height, 72px)}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-horizontal-stepper-header.mat-step-header-empty-label .mat-step-icon{margin:0}.mat-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px;padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{visibility:hidden;overflow:hidden;outline:0;height:0}.mat-stepper-animations-enabled .mat-horizontal-stepper-content{transition:transform var(--mat-stepper-animation-duration, 0) cubic-bezier(0.35, 0, 0.25, 1)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-previous{transform:translate3d(-100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-next{transform:translate3d(100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{visibility:visible;transform:none;height:auto}.mat-stepper-horizontal:not(.mat-stepper-animating) .mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{overflow:visible}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}@media(forced-colors: active){.mat-horizontal-content-container{outline:solid 1px}}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{display:grid;grid-template-rows:0fr;grid-template-columns:100%;margin-left:36px;border:0;position:relative}.mat-stepper-animations-enabled .mat-vertical-content-container{transition:grid-template-rows var(--mat-stepper-animation-duration, 0) cubic-bezier(0.4, 0, 0.2, 1)}.mat-vertical-content-container.mat-vertical-content-container-active{grid-template-rows:1fr}.mat-step:last-child .mat-vertical-content-container{border:none}@media(forced-colors: active){.mat-vertical-content-container{outline:solid 1px}}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}@supports not (grid-template-rows: 0fr){.mat-vertical-content-container{height:0}.mat-vertical-content-container.mat-vertical-content-container-active{height:auto}}.mat-stepper-vertical-line::before{content:"";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-sys-outline));top:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0;visibility:hidden}.mat-stepper-animations-enabled .mat-vertical-stepper-content{transition:visibility var(--mat-stepper-animation-duration, 0) linear}.mat-vertical-content-container-active>.mat-vertical-stepper-content{visibility:visible}.mat-vertical-content{padding:0 24px 24px 24px}
`],encapsulation:2,changeDetection:0})}return n})(),I8=(()=>{class n extends M8{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["button","matStepperNext",""]],hostAttrs:[1,"mat-stepper-next"],hostVars:1,hostBindings:function(t,o){t&2&&Wo("type",o.type)},features:[si]})}return n})(),A8=(()=>{class n extends k8{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275dir=ft({type:n,selectors:[["button","matStepperPrevious",""]],hostAttrs:[1,"mat-stepper-previous"],hostVars:1,hostBindings:function(t,o){t&2&&Wo("type",o.type)},features:[si]})}return n})(),ul=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({providers:[fd],imports:[Wu,T8,ie,mc,Ul,aP,hi]})}return n})();var Fc=(()=>{class n{getConsoleTypes(){return["telnet","ssh","vnc","http","https","none"]}getAuxConsoleTypes(){return["telnet","ssh","none"]}getCategories(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getConsoleResolutions(){return["2560x1440","1920x1080","1680x1050","1440x900","1366x768","1280x1024","1280x800","1024x768","800x600","640x480"]}getMacAddrRegex(){return/^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$/}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ds=(()=>{class n{httpController;constructor(e){this.httpController=e}getTemplates(e){return this.httpController.get(e,"/templates")}getTemplate(e,t){return this.httpController.get(e,`/templates/${t}`)}getImages(e){return this.httpController.get(e,`/computes/${wi.compute_id}/docker/images`)}addTemplate(e,t){let o=this.prepareTemplate(t);return this.httpController.post(e,"/templates",o)}saveTemplate(e,t){let o=this.prepareTemplate(t);return this.httpController.put(e,`/templates/${t.template_id}`,o)}prepareTemplate(e){return it(K({},e),{custom_adapters:e.custom_adapters||[]})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Qoe=(n,i)=>i.image;function Xoe(n,i){if(n&1&&(s(0,"mat-option",22),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e.image)}}function Koe(n,i){if(n&1){let e=z();s(0,"mat-form-field",13)(1,"mat-label"),d(2,"Image list"),l(),s(3,"mat-select",30),g("selectionChange",function(o){k(e);let r=v();return T(r.selectedImage=o.value)}),Y(4,Xoe,2,2,"mat-option",22,Qoe),l()()}if(n&2){let e=v();m(3),C("value",e.selectedImage),m(),Z(e.dockerImages)}}function Yoe(n,i){if(n&1){let e=z();s(0,"mat-form-field",13)(1,"mat-label"),d(2,"Image name"),l(),s(3,"input",31),g("input",function(o){k(e);let r=v();return T(r.filename.set(o.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.filename())}}function Zoe(n,i){if(n&1&&(s(0,"mat-option",22),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function Joe(n,i){if(n&1&&(s(0,"mat-option",22),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}var gx=(()=>{class n{route=f(lt);controllerService=f(Je);dockerService=f(ds);toasterService=f(te);router=f(ht);templateMocksService=f(xa);configurationService=f(Fc);computeService=f(ko);cd=f(Q);controller;dockerTemplate;consoleTypes=[];auxConsoleTypes=[];dockerImages=[];selectedImage;newImageSelected=!1;isLocalComputerChosen=!0;filename=U("");templateName=U("");adapters=U(1);startCommand=U("");consoleType=U("");auxConsoleType=U("");environment=U("");ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.consoleTypes=this.configurationService.getConsoleTypes(),this.auxConsoleTypes=this.configurationService.getAuxConsoleTypes(),this.templateMocksService.getDockerTemplate().subscribe({next:o=>{this.dockerTemplate=o,this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to load template";this.toasterService.error(r),this.cd.markForCheck()}}),this.dockerService.getImages(t).subscribe({next:o=>{this.dockerImages=o,this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to load docker images";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}setControllerType(e){e==="local"&&(this.isLocalComputerChosen=!0)}setDiskImage(e){this.newImageSelected=e==="newImage"}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","docker","templates"])}addTemplate(){!this.newImageSelected&&this.selectedImage||this.newImageSelected&&this.filename()&&this.templateName()&&this.adapters()?(this.dockerTemplate.template_id=Ai(),this.newImageSelected?this.dockerTemplate.image=this.filename():this.dockerTemplate.image=this.selectedImage.image,this.dockerTemplate.name=this.templateName(),this.dockerTemplate.adapters=this.adapters(),this.dockerTemplate.compute_id="local",this.dockerTemplate.start_command=this.startCommand(),this.dockerTemplate.console_type=this.consoleType()||"none",this.dockerTemplate.aux_type=this.auxConsoleType()||"none",this.dockerTemplate.environment=this.environment(),this.dockerService.addTemplate(this.controller,this.dockerTemplate).subscribe({next:e=>{this.goBack()},error:e=>{let t=e.error?.message||e.message||"Failed to add template";this.toasterService.error(t),this.cd.markForCheck()}})):this.toasterService.error("Fill all required fields")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-docker-template"]],inputs:{filename:[1,"filename"],templateName:[1,"templateName"],adapters:[1,"adapters"],startCommand:[1,"startCommand"],consoleType:[1,"consoleType"],auxConsoleType:[1,"auxConsoleType"],environment:[1,"environment"]},outputs:{filename:"filenameChange",templateName:"templateNameChange",adapters:"adaptersChange",startCommand:"startCommandChange",consoleType:"consoleTypeChange",auxConsoleType:"auxConsoleTypeChange",environment:"environmentChange"},decls:69,vars:18,consts:[[1,"docker-add"],[1,"docker-add__header"],[1,"docker-add__title"],[1,"docker-add__content"],[1,"docker-add__stepper-card"],[1,"docker-add__stepper",3,"linear"],["label","Controller type",3,"completed"],[1,"docker-add__step-content"],[1,"docker-add__radio-group"],["value","1",1,"docker-add__radio",3,"click","checked"],["label","Docker Virtual Machine",3,"completed"],[1,"docker-add__form"],["value","2",1,"docker-add__radio",3,"click"],["appearance","fill",1,"docker-add__field"],["label","Container name",3,"completed"],["matInput","","type","text","placeholder","Container name",1,"templatename",3,"input","value"],["label","Network adapters",3,"completed"],["matInput","","type","number","placeholder","Adapters",1,"networkadapter",3,"input","value"],["label","Start command",3,"completed"],["matInput","","type","text","placeholder","Start command",3,"input","value"],["label","Console type",3,"completed"],["placeholder","Console type",3,"selectionChange","value"],[3,"value"],["label","Auxiliary console type",3,"completed"],["placeholder","Auxiliary console type",3,"selectionChange","value"],["label","Environment"],["matInput","","type","text","placeholder","Environment variables (one per line, KEY=VALUE format). Supports: %vm-name%, %vm-id%, %project-id%, %project-path%",3,"input","value"],[1,"docker-add__actions"],["mat-button","",1,"docker-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"docker-add__submit-btn",3,"click"],["placeholder","Image list",3,"selectionChange","value"],["matInput","","type","text","placeholder","Image name",1,"filename",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1)(2,"h1",2),d(3,"New Docker container template"),l()(),s(4,"main",3)(5,"section",4)(6,"mat-vertical-stepper",5)(7,"mat-step",6)(8,"div",7)(9,"mat-radio-group",8)(10,"mat-radio-button",9),g("click",function(){return o.setControllerType("local")}),d(11," Run this Docker container locally "),l()()()(),s(12,"mat-step",10)(13,"div",7)(14,"div",11)(15,"mat-radio-group",8)(16,"mat-radio-button",9),g("click",function(){return o.setDiskImage("existingImage")}),d(17," Existing image "),l(),s(18,"mat-radio-button",12),g("click",function(){return o.setDiskImage("newImage")}),d(19," New image "),l()(),A(20,Koe,6,1,"mat-form-field",13),A(21,Yoe,4,1,"mat-form-field",13),l()()(),s(22,"mat-step",14)(23,"div",7)(24,"div",11)(25,"mat-form-field",13)(26,"mat-label"),d(27,"Container name"),l(),s(28,"input",15),g("input",function(a){return o.templateName.set(a.target.value)}),l()()()()(),s(29,"mat-step",16)(30,"div",7)(31,"div",11)(32,"mat-form-field",13)(33,"mat-label"),d(34,"Adapters"),l(),s(35,"input",17),g("input",function(a){return o.adapters.set(+a.target.value)}),l()()()()(),s(36,"mat-step",18)(37,"div",7)(38,"mat-form-field",13)(39,"mat-label"),d(40,"Start command"),l(),s(41,"input",19),g("input",function(a){return o.startCommand.set(a.target.value)}),l()()()(),s(42,"mat-step",20)(43,"div",7)(44,"mat-form-field",13)(45,"mat-label"),d(46,"Console type"),l(),s(47,"mat-select",21),g("selectionChange",function(a){return o.consoleType.set(a.value)}),Y(48,Zoe,2,2,"mat-option",22,Ae),l()()()(),s(50,"mat-step",23)(51,"div",7)(52,"mat-form-field",13)(53,"mat-label"),d(54,"Auxiliary console type"),l(),s(55,"mat-select",24),g("selectionChange",function(a){return o.auxConsoleType.set(a.value)}),Y(56,Joe,2,2,"mat-option",22,Ae),l()()()(),s(58,"mat-step",25)(59,"div",7)(60,"mat-form-field",13)(61,"mat-label"),d(62,"Environment"),l(),s(63,"textarea",26),g("input",function(a){return o.environment.set(a.target.value)}),l()()()()()(),s(64,"div",27)(65,"button",28),g("click",function(){return o.goBack()}),d(66,"Cancel"),l(),s(67,"button",29),g("click",function(){return o.addTemplate()}),d(68," Add template "),l()()()()),t&2&&(m(6),C("linear",!0),m(),C("completed",o.isLocalComputerChosen),m(3),C("checked",!0),m(2),C("completed",o.selectedImage||o.filename()),m(4),C("checked",!o.newImageSelected),m(4),O(o.newImageSelected?-1:20),m(),O(o.newImageSelected?21:-1),m(),C("completed",o.templateName()),m(6),C("value",o.templateName()),m(),C("completed",o.adapters()),m(6),C("value",o.adapters()),m(),C("completed",o.startCommand()),m(5),C("value",o.startCommand()),m(),C("completed",o.consoleType()),m(5),C("value",o.consoleType()),m(),Z(o.consoleTypes),m(2),C("completed",o.auxConsoleType()),m(5),C("value",o.auxConsoleType()),m(),Z(o.auxConsoleTypes),m(7),C("value",o.environment()))},dependencies:[ne,Xe,dt,ie,W,pe,Mt,io,xo,ho,we,Me,et,Se,Ee,vt,At,_t,ul,Hl,Ul,Ot],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.docker-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.docker-add__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.docker-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.docker-add__stepper-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.docker-add__stepper[_ngcontent-%COMP%]{background:transparent}.docker-add__step-content[_ngcontent-%COMP%]{padding:16px 24px 24px;display:flex;flex-direction:column;gap:16px}.docker-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.docker-add__radio[_ngcontent-%COMP%]{font-size:16px}.docker-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.docker-add__field[_ngcontent-%COMP%]{width:100%}.docker-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.docker-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.docker-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.docker-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.docker-add__title[_ngcontent-%COMP%]{font-size:24px}.docker-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.docker-add__step-content[_ngcontent-%COMP%]{padding:12px 16px 20px}.docker-add__actions[_ngcontent-%COMP%]{flex-direction:column}.docker-add__cancel-btn[_ngcontent-%COMP%], .docker-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();function ere(n,i){if(n&1){let e=z();s(0,"button",12),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var _x=(()=>{class n{route=f(lt);controllerService=f(Je);dockerService=f(ds);toasterService=f(te);router=f(ht);formBuilder=f(Vn);cd=f(Q);controller;templateName="";dockerTemplate;templateNameForm;constructor(){this.templateNameForm=this.formBuilder.group({templateName:new Ye("",Ue.required)})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.dockerService.getTemplate(this.controller,t).subscribe({next:r=>{this.dockerTemplate=r,this.templateName=`Copy of ${this.dockerTemplate.name}`,this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","docker","templates"])}addTemplate(){this.templateNameForm.invalid?this.toasterService.error("Fill all required fields"):(this.dockerTemplate.template_id=Ai(),this.dockerTemplate.name=this.templateNameForm.get("templateName").value,this.dockerService.addTemplate(this.controller,this.dockerTemplate).subscribe({next:e=>{this.goBack()},error:e=>{let t=e.error?.message||e.message||"Failed to copy docker template";this.toasterService.error(t),this.cd.markForCheck()}}))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-copy-docker-template"]],decls:17,vars:2,consts:[[1,"docker-copy"],[1,"docker-copy__header"],["mat-icon-button","",1,"docker-copy__back-btn"],[1,"docker-copy__title"],[1,"docker-copy__content"],[1,"docker-copy__form-card"],[1,"docker-copy__form",3,"formGroup"],["appearance","fill",1,"docker-copy__field"],["matInput","","type","text","placeholder","Name","formControlName","templateName"],[1,"docker-copy__actions"],["mat-button","",1,"docker-copy__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"docker-copy__submit-btn",3,"click"],["mat-icon-button","",1,"docker-copy__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,ere,3,0,"button",2),s(3,"h1",3),d(4,"Copy Docker container template"),l()(),s(5,"main",4)(6,"section",5)(7,"form",6)(8,"mat-form-field",7)(9,"mat-label"),d(10,"Template name"),l(),R(11,"input",8),l()()(),s(12,"div",9)(13,"button",10),g("click",function(){return o.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),g("click",function(){return o.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(5),C("formGroup",o.templateNameForm))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,dt,ie,de,W,pe,je,Mt,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.docker-copy__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.docker-copy__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.docker-copy__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.docker-copy__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.docker-copy__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.docker-copy__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.docker-copy__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;padding:24px}.docker-copy__field[_ngcontent-%COMP%]{width:100%}.docker-copy__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.docker-copy__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.docker-copy__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.docker-copy__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.docker-copy__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.docker-copy__title[_ngcontent-%COMP%]{font-size:22px}.docker-copy__content[_ngcontent-%COMP%]{padding:0 16px 16px}.docker-copy__form[_ngcontent-%COMP%]{padding:16px}.docker-copy__actions[_ngcontent-%COMP%]{flex-direction:column}.docker-copy__cancel-btn[_ngcontent-%COMP%], .docker-copy__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var ut=(()=>{class n{httpController;http;constructor(e,t){this.httpController=e,this.http=t}getNodeById(e,t,o){return this.httpController.get(e,`/projects/${t}/nodes/${o}`)}isolate(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/isolate`,{})}unisolate(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/unisolate`,{})}start(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/start`,{})}startAll(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/start`,{})}stop(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/stop`,{})}stopAll(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/stop`,{})}suspend(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/suspend`,{})}suspendAll(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/suspend`,{})}reload(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/reload`,{})}reloadAll(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/reload`,{})}resetAllNodes(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/console/reset`,{})}createFromTemplate(e,t,o,r,a,c){return c?this.httpController.post(e,`/projects/${t.project_id}/templates/${o.template_id}`,{x:Math.round(r),y:Math.round(a),compute_id:c}):this.httpController.post(e,`/projects/${t.project_id}/templates/${o.template_id}`,{x:Math.round(r),y:Math.round(a),compute_id:"local"})}updatePosition(e,t,o,r,a){let c=Math.round(r),p=Math.round(a);return t.snap_to_grid&&(c=Math.round((c+o.width/2)/t.grid_size)*t.grid_size,p=Math.round((p+o.height/2)/t.grid_size)*t.grid_size,c=Math.round(c-o.width/2),p=Math.round(p-o.height/2)),this.httpController.put(e,`/projects/${o.project_id}/nodes/${o.node_id}`,{x:c,y:p})}updateLabel(e,t,o){return this.httpController.put(e,`/projects/${t.project_id}/nodes/${t.node_id}`,{label:{rotation:o.rotation,style:o.style,text:o.text,x:Math.round(o.x),y:Math.round(o.y)}})}updateSymbol(e,t,o){return this.httpController.put(e,`/projects/${t.project_id}/nodes/${t.node_id}`,{symbol:o})}update(e,t){return this.httpController.put(e,`/projects/${t.project_id}/nodes/${t.node_id}`,{x:Math.round(t.x),y:Math.round(t.y),z:t.z})}updateNode(e,t){return this.httpController.put(e,`/projects/${t.project_id}/nodes/${t.node_id}`,{console_type:t.console_type,aux_type:t.aux_type,console_auto_start:t.console_auto_start,locked:t.locked,name:t.name,properties:t.properties,tags:t.tags})}updateNodeWithCustomAdapters(e,t){let o=t.custom_adapters?t.custom_adapters.map(r=>{let a={adapter_number:r.adapter_number,adapter_type:r.adapter_type};return r.port_name!==null&&r.port_name!==void 0&&(a.port_name=r.port_name),r.mac_address!==null&&r.mac_address!==void 0&&(a.mac_address=r.mac_address),a}):[];return this.httpController.put(e,`/projects/${t.project_id}/nodes/${t.node_id}`,{console_type:t.console_type,aux_type:t.aux_type,console_auto_start:t.console_auto_start,custom_adapters:o,name:t.name,properties:t.properties,tags:t.tags})}delete(e,t){return this.httpController.delete(e,`/projects/${t.project_id}/nodes/${t.node_id}`)}duplicate(e,t){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/duplicate`,{x:t.x+10,y:t.y+10,z:t.z})}getNode(e,t){return this.httpController.get(e,`/projects/${t.project_id}/nodes/${t.node_id}`)}getDefaultCommand(){return'putty.exe -telnet %h %p -wt "%d" -gns3 5 -skin 4'}uploadNodeFile(e,t,o,r,a){return this.httpController.post(e,`/projects/${t}/nodes/${o}/files/${encodeURIComponent(r)}`,a)}uploadNodeFileWithProgress(e,t,o,r,a){let p=`${e.protocol||location.protocol}//${e.host}:${e.port}/${wi.current_version}/projects/${t}/nodes/${o}/files/${encodeURIComponent(r)}`,u={};return e.authToken&&!e.tokenExpired&&(u.Authorization=`Bearer ${e.authToken}`),this.http.post(p,a,{headers:u,reportProgress:!0,observe:"events"}).pipe(Lt(h=>h.type===$u.UploadProgress?Math.round(100*h.loaded/(h.total||1)):h.type===$u.Response?100:0),po(h=>{let _=h.error?.message||h.message||"Failed to upload file";return Bo(()=>new Error(_))}))}getNodeFiles(e,t,o,r){let a=`/projects/${t}/nodes/${o}/files`,c=r?`?path=${encodeURIComponent(r)}`:"";return this.httpController.get(e,`${a}${c}`)}getNodeFilesRecursive(e,t,o){return this.httpController.get(e,`/projects/${t}/nodes/${o}/files?recursive=true`)}deleteNodeFile(e,t,o,r){return this.httpController.delete(e,`/projects/${t}/nodes/${o}/files/${encodeURIComponent(r)}`)}getNodeFileContent(e,t,o,r){return this.httpController.get(e,`/projects/${t}/nodes/${o}/files/${encodeURIComponent(r)}`,{responseType:"text"})}saveNodeFileContent(e,t,o,r,a){return this.httpController.post(e,`/projects/${t}/nodes/${o}/files/${encodeURIComponent(r)}`,a)}downloadNodeFile(e,t,o,r){return this.httpController.getBlob(e,`/projects/${t}/nodes/${o}/files/${encodeURIComponent(r)}`)}async streamNodeFileToFile(e,t,o,r,a,c){let u=`${e.protocol||location.protocol}//${e.host}:${e.port}/${wi.current_version}/projects/${t}/nodes/${o}/files/${encodeURIComponent(r)}`,h={};e.authToken&&!e.tokenExpired&&(h.Authorization=`Bearer ${e.authToken}`);let _=await fetch(u,{headers:h});if(!_.ok)throw new Error(`Download failed: ${_.status}`);let S=_.body.getReader(),x=await a.createWritable(),b=0;try{for(;;){let{done:M,value:w}=await S.read();if(M)break;await x.write(w),b+=w.length,c?.(b)}}finally{await x.close()}}getNetworkConfiguration(e,t){return this.httpController.get(e,`/projects/${t.project_id}/nodes/${t.node_id}/files/etc/network/interfaces`,{responseType:"text"})}saveNetworkConfiguration(e,t,o){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/files/etc/network/interfaces`,o)}getStartupConfiguration(e,t){let o=`/projects/${t.project_id}/nodes/${t.node_id}`;return t.node_type==="vpcs"?o+="/files/startup.vpc":t.node_type==="iou"?o+="/files/startup-config.cfg":t.node_type==="dynamips"&&(o+=`/files/configs/i${t.properties.dynamips_id}_startup-config.cfg`),this.httpController.get(e,o,{responseType:"text"})}getPrivateConfiguration(e,t){let o=`/projects/${t.project_id}/nodes/${t.node_id}`;return t.node_type==="iou"?o+="/files/private-config.cfg":t.node_type==="dynamips"&&(o+=`/files/configs/i${t.properties.dynamips_id}_private-config.cfg`),this.httpController.get(e,o,{responseType:"text"})}saveConfiguration(e,t,o){let r=`/projects/${t.project_id}/nodes/${t.node_id}`;return t.node_type==="vpcs"?r+="/files/startup.vpc":t.node_type==="iou"?r+="/files/startup-config.cfg":t.node_type==="dynamips"&&(r+=`/files/configs/i${t.properties.dynamips_id}_startup-config.cfg`),this.httpController.post(e,r,o)}savePrivateConfiguration(e,t,o){let r=`/projects/${t.project_id}/nodes/${t.node_id}`;return t.node_type==="iou"?r+="/files/private-config.cfg":t.node_type==="dynamips"&&(r+=`/files/configs/i${t.properties.dynamips_id}_private-config.cfg`),this.httpController.post(e,r,o)}getIdlePCProposals(e,t){return this.httpController.get(e,`/projects/${t.project_id}/nodes/${t.node_id}/dynamips/idlepc_proposals`)}getAutoIdlePC(e,t){return this.httpController.get(e,`/projects/${t.project_id}/nodes/${t.node_id}/dynamips/auto_idlepc`)}static \u0275fac=function(t){return new(t||n)(ge(mn),ge(js))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var tre=(n,i)=>i.adapter_number;function nre(n,i){n&1&&(s(0,"mat-error"),d(1,"Invalid MAC address format"),l())}function ire(n,i){if(n&1){let e=z();s(0,"div",7)(1,"span",14),d(2),l(),s(3,"span",15),d(4),l(),s(5,"mat-form-field",16)(6,"input",17),g("input",function(o){let r=k(e).$implicit,a=v();return T(a.onMacAddressChange(r.adapter_number,o.target.value))}),l(),A(7,nre,2,0,"mat-error"),l(),s(8,"button",18),g("click",function(){let o=k(e).$implicit,r=v();return T(r.removeAdapter(o.adapter_number))}),s(9,"mat-icon"),d(10,"delete"),l()()()}if(n&2){let e=i.$implicit,t=i.$index,o=v();m(2),ee("Adapter ",e.adapter_number),m(2),ee("eth",e.adapter_number),m(2),C("name",Ui("mac_address_",t))("value",e.mac_address),m(),O(e.mac_address&&!o.isMacAddressValid(e.mac_address)?7:-1)}}var Jh=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);dockerConfigurationService=f(Fc);validationService=f(zi);cdr=f(Q);controller;node;saveHandler;adapters=U([]);constructor(){}ngOnInit(){let e=this.adapters();e.length===0&&this.node?(this.node.custom_adapters?e.push(...this.node.custom_adapters.map(t=>it(K({},t),{mac_address:t.mac_address||""}))):this.node.ports.forEach((t,o)=>{e.push({adapter_number:o,mac_address:""})}),this.adapters.set(e)):e.length>0&&this.adapters.update(t=>t.map(o=>it(K({},o),{mac_address:o.mac_address||""})))}onMacAddressChange(e,t){this.adapters.update(o=>o.map(r=>r.adapter_number===e?it(K({},r),{mac_address:t}):r)),this.cdr.markForCheck()}addAdapter(){let e=this.adapters().reduce((t,o)=>Math.max(t,o.adapter_number),-1);this.adapters.update(t=>[...t,{adapter_number:e+1,mac_address:""}])}removeAdapter(e){this.adapters.update(t=>t.filter(o=>o.adapter_number!==e)),this.cdr.markForCheck()}isMacAddressValid(e){return this.validationService.validateMacAddress(e).isValid}hasInvalidMac(){return this.adapters().some(e=>e.mac_address&&!this.validationService.validateMacAddress(e.mac_address).isValid)}onSaveClick(){if(this.hasInvalidMac()){this.toasterService.error("One or more MAC addresses are invalid (expected XX:XX:XX:XX:XX:XX)");return}this.saveHandler?(this.saveHandler(this.adapters()),this.onCancelClick()):this.node&&(this.node.custom_adapters=this.adapters().map(e=>it(K({},e),{mac_address:e.mac_address||null})),this.nodeService.updateNodeWithCustomAdapters(this.controller,this.node).subscribe({next:()=>{this.onCancelClick(),this.toasterService.success(`Configuration saved for node ${this.node.name}`),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to update node with custom adapters";this.toasterService.error(t),this.cdr.markForCheck()}}))}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configure-custom-adapters"]],inputs:{adapters:[1,"adapters"]},outputs:{adapters:"adaptersChange"},decls:26,vars:1,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"content"],[1,"adapter-form"],[1,"adapter-header"],[1,"adapter-header-label"],[1,"adapter-header-field"],[1,"adapter-header-actions"],[1,"adapter-item"],[1,"add-adapter-row"],["mat-button","",1,"add-btn",3,"click"],[1,"info-note-text"],["mat-dialog-actions","","align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click"],[1,"adapter-label"],[1,"adapter-port-name"],["appearance","fill","subscriptSizing","dynamic",1,"adapter-field"],["matInput","","placeholder","XX:XX:XX:XX:XX:XX",3,"input","value","name"],["mat-icon-button","","matTooltip","Delete",1,"adapter-actions",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1)(3,"div",2)(4,"div",3)(5,"span",4),d(6,"Adapter"),l(),s(7,"span",5),d(8,"Port name"),l(),s(9,"span",5),d(10,"MAC address"),l(),R(11,"span",6),l(),Y(12,ire,11,6,"div",7,tre),l(),s(14,"div",8)(15,"button",9),g("click",function(){return o.addAdapter()}),s(16,"mat-icon"),d(17,"add"),l(),d(18," Add adapter "),l(),s(19,"div",10),d(20," Docker port names are fixed (eth0, eth1...). Deleting an adapter reduces the total number of adapters. "),l()()(),s(21,"div",11)(22,"button",12),g("click",function(){return o.onCancelClick()}),d(23,"Cancel"),l(),s(24,"button",13),g("click",function(){return o.onSaveClick()}),d(25,"Apply"),l()()),t&2&&(m(),ee("Configure custom adapters",o.node?" for node "+o.node.name:""),m(11),Z(o.adapters()))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,je,ie,de,wt,It,Se,Ee,Me,fi,we],styles:[".content[_ngcontent-%COMP%]{min-width:600px}.adapter-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;max-height:500px;overflow-y:auto}.adapter-item[_ngcontent-%COMP%]{display:grid;grid-template-columns:100px 120px 1fr auto;gap:12px;align-items:center;padding:12px 16px;background:var(--mat-sys-surface-container-lowest);border-radius:12px;border:1px solid color-mix(in srgb,var(--mat-sys-outline) 15%,transparent)}.adapter-item[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.adapter-header[_ngcontent-%COMP%]{display:grid;grid-template-columns:100px 120px 1fr auto;gap:12px;align-items:center;padding:8px 16px;margin-bottom:8px;border-bottom:2px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent);position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.adapter-header-label[_ngcontent-%COMP%], .adapter-header-field[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px;text-align:center}.adapter-header-actions[_ngcontent-%COMP%]{width:40px}.adapter-field[_ngcontent-%COMP%]{margin:0}.adapter-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:16px}.adapter-label[_ngcontent-%COMP%], .adapter-port-name[_ngcontent-%COMP%]{font-size:16px;font-weight:500;color:var(--mat-sys-on-surface);text-align:center}.adapter-port-name[_ngcontent-%COMP%]{padding:8px;background:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent);border-radius:4px}.adapter-actions[_ngcontent-%COMP%]{margin:0}.add-btn[_ngcontent-%COMP%]{flex-shrink:0;width:auto;margin-top:12px;height:48px;border-radius:12px;font-size:14px;font-weight:500;text-transform:none;border:2px dashed color-mix(in srgb,var(--mat-sys-outline) 40%,transparent);color:var(--mat-sys-on-surface-variant)}.add-btn[_ngcontent-%COMP%]:hover{border-color:var(--mat-sys-primary);color:var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 8%,transparent)}.add-adapter-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.info-note-text[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.7}"],changeDetection:0})}return n})();function ore(n,i){if(n&1){let e=z();s(0,"button",6),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function rre(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),j(e[0])}}function are(n,i){if(n&1){let e=z();s(0,"mat-chip",41),g("removed",function(){let o=k(e).$implicit,r=v(3);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",42),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function sre(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function lre(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function cre(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function dre(n,i){if(n&1){let e=z();s(0,"form",11)(1,"div",16)(2,"mat-form-field",17)(3,"mat-label"),d(4,"Template name"),l(),s(5,"input",18),g("input",function(o){k(e);let r=v(2);return T(r.name.set(o.target.value))}),l()(),s(6,"mat-form-field",17)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",19),g("input",function(o){k(e);let r=v(2);return T(r.defaultNameFormat.set(o.target.value))}),l()()(),s(10,"mat-form-field",17)(11,"mat-label"),d(12,"Image"),l(),s(13,"input",20),g("input",function(o){k(e);let r=v(2);return T(r.image.set(o.target.value))}),l()(),s(14,"div",21)(15,"mat-form-field",17)(16,"mat-label"),d(17,"Category"),l(),s(18,"mat-select",22),g("selectionChange",function(o){k(e);let r=v(2);return T(r.category.set(o.value))}),Y(19,rre,2,2,"mat-option",23,Hi),l()(),s(21,"mat-form-field",24)(22,"mat-label"),d(23,"Symbol"),l(),s(24,"input",25),g("input",function(o){k(e);let r=v(2);return T(r.symbol.set(o.target.value))}),l()(),s(25,"button",26),g("click",function(){k(e);let o=v(2);return T(o.chooseSymbol())}),d(26,"Choose symbol"),l()(),s(27,"mat-form-field",17)(28,"mat-label"),d(29,"Tags"),l(),s(30,"mat-chip-grid",null,0),Y(32,are,4,1,"mat-chip",null,Ae),l(),s(34,"input",27),g("matChipInputTokenEnd",function(o){k(e);let r=v(2);return T(r.addTag(o))}),l()(),s(35,"div",16)(36,"mat-form-field",17)(37,"mat-label"),d(38,"Adapters"),l(),s(39,"input",28),g("input",function(o){k(e);let r=v(2);return T(r.adaptersCount.set(+o.target.value))}),l()(),s(40,"mat-form-field",17)(41,"mat-label"),d(42,"Base MAC"),l(),s(43,"input",29),g("input",function(o){k(e);let r=v(2);return T(r.macAddress.set(o.target.value))}),l()(),s(44,"mat-form-field",17)(45,"mat-label"),d(46,"Maximum memory"),l(),s(47,"input",30),g("input",function(o){k(e);let r=v(2);return T(r.memory.set(o.target.value))}),l(),s(48,"span",31),d(49,"MB"),l()(),s(50,"mat-form-field",17)(51,"mat-label"),d(52,"Maximum CPUs"),l(),s(53,"input",32),g("input",function(o){k(e);let r=v(2);return T(r.cpus.set(o.target.value))}),l()(),s(54,"mat-form-field",17)(55,"mat-label"),d(56,"Console type"),l(),s(57,"mat-select",33),g("selectionChange",function(o){k(e);let r=v(2);return T(r.consoleType.set(o.value))}),Y(58,sre,2,2,"mat-option",23,Ae),l()(),s(60,"mat-form-field",17)(61,"mat-label"),d(62,"Auxiliary console type"),l(),s(63,"mat-select",34),g("selectionChange",function(o){k(e);let r=v(2);return T(r.auxConsoleType.set(o.value))}),Y(64,lre,2,2,"mat-option",23,Ae),l()(),s(66,"mat-form-field",17)(67,"mat-label"),d(68,"VNC console resolution"),l(),s(69,"mat-select",35),g("selectionChange",function(o){k(e);let r=v(2);return T(r.consoleResolution.set(o.value))}),Y(70,cre,2,2,"mat-option",23,Ae),l()(),s(72,"mat-form-field",17)(73,"mat-label"),d(74,"HTTP port in the container"),l(),s(75,"input",36),g("input",function(o){k(e);let r=v(2);return T(r.consoleHttpPort.set(o.target.value))}),l()(),s(76,"mat-form-field",37)(77,"mat-label"),d(78,"HTTP path"),l(),s(79,"input",38),g("input",function(o){k(e);let r=v(2);return T(r.consoleHttpPath.set(o.target.value))}),l()(),s(80,"mat-checkbox",39),g("change",function(o){k(e);let r=v(2);return T(r.consoleAutoStart.set(o.checked))}),d(81," Auto start console "),l()(),s(82,"button",40),g("click",function(){k(e);let o=v(2);return T(o.editCustomAdapters())}),d(83," Edit network configuration "),l()()}if(n&2){let e=Pe(31),t=v(2);m(5),C("value",t.name()),m(4),C("value",t.defaultNameFormat()),m(4),C("value",t.image()),m(5),C("value",t.category()),m(),Z(t.categories),m(5),C("value",t.symbol()),m(8),Z(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(5),C("value",t.adaptersCount()),m(4),C("value",t.macAddress()),m(4),C("value",t.memory()),m(6),C("value",t.cpus()),m(4),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(5),C("value",t.auxConsoleType()),m(),Z(t.auxConsoleTypes),m(5),C("value",t.consoleResolution()),m(),Z(t.consoleResolutions),m(5),C("value",t.consoleHttpPort()),m(4),C("value",t.consoleHttpPath()),m(),C("checked",t.consoleAutoStart())}}function mre(n,i){if(n&1){let e=z();s(0,"div",11)(1,"h6",43),d(2,"Start command"),l(),s(3,"mat-form-field",17)(4,"mat-label"),d(5,"Start command"),l(),s(6,"textarea",44),g("input",function(o){k(e);let r=v(2);return T(r.startCommand.set(o.target.value))}),l()(),s(7,"h6",43),d(8,"Environment"),l(),s(9,"mat-form-field",17)(10,"mat-label"),d(11,"Environment"),l(),s(12,"textarea",45),g("input",function(o){k(e);let r=v(2);return T(r.environment.set(o.target.value))}),l()(),s(13,"h6",43),d(14,"Extra volumes"),l(),s(15,"mat-form-field",17)(16,"mat-label"),d(17,"Extra volumes"),l(),s(18,"textarea",46),g("input",function(o){k(e);let r=v(2);return T(r.extraVolumes.set(o.target.value))}),l()(),s(19,"h6",43),d(20,"Extra hosts"),l(),s(21,"mat-form-field",17)(22,"mat-label"),d(23,"Extra hosts"),l(),s(24,"textarea",47),g("input",function(o){k(e);let r=v(2);return T(r.extraHosts.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(6),C("value",e.startCommand()),m(6),C("value",e.environment()),m(6),C("value",e.extraVolumes()),m(6),C("value",e.extraHosts())}}function pre(n,i){if(n&1){let e=z();s(0,"div",12)(1,"mat-form-field",48)(2,"mat-label"),d(3,"Usage"),l(),s(4,"textarea",49),g("input",function(o){k(e);let r=v(2);return T(r.usage.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function ure(n,i){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("general"))}),s(3,"h3",9),d(4,"General settings"),l(),s(5,"mat-icon",10),d(6),l()(),A(7,dre,84,17,"form",11),l(),s(8,"section",7)(9,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("advanced"))}),s(10,"h3",9),d(11,"Advanced"),l(),s(12,"mat-icon",10),d(13),l()(),A(14,mre,25,4,"div",11),l(),s(15,"section",7)(16,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("usage"))}),s(17,"h3",9),d(18,"Usage"),l(),s(19,"mat-icon",10),d(20),l()(),A(21,pre,5,1,"div",12),l(),s(22,"div",13)(23,"button",14),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(24,"Cancel"),l(),s(25,"button",15),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(26,"Save"),l()()()}if(n&2){let e=v();m(6),j(e.generalSettingsExpanded?"expand_less":"expand_more"),m(),O(e.generalSettingsExpanded?7:-1),m(6),j(e.advancedExpanded?"expand_less":"expand_more"),m(),O(e.advancedExpanded?14:-1),m(6),j(e.usageExpanded?"expand_less":"expand_more"),m(),O(e.usageExpanded?21:-1)}}var vx=(()=>{class n{route=f(lt);controllerService=f(Je);dockerService=f(ds);toasterService=f(te);validationService=f(D0);configurationService=f(Fc);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);controller;dockerTemplate;separatorKeysCodes=[13,188];generalSettingsExpanded=!1;advancedExpanded=!1;usageExpanded=!1;consoleTypes=[];auxConsoleTypes=[];consoleResolutions=[];categories=[];displayedColumns=["adapter_number","port_name"];name=U("");defaultNameFormat=U("");category=U("");symbol=U("");tags=U([]);image=U("");startCommand=U("");macAddress=U("");adaptersCount=U(0);memory=U(0);cpus=U(0);consoleType=U("");auxConsoleType=U("");consoleAutoStart=U(!1);consoleResolution=U("");consoleHttpPort=U(0);consoleHttpPath=U("");environment=U("");extraHosts=U("");extraVolumes=U("");usage=U("");constructor(){}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.getConfiguration(),this.dockerService.getTemplate(this.controller,t).subscribe({next:r=>{this.dockerTemplate=r,this.name.set(r.name||""),this.defaultNameFormat.set(r.default_name_format||""),this.category.set(r.category||""),this.symbol.set(r.symbol||""),this.tags.set(r.tags||[]),this.image.set(r.image||""),this.startCommand.set(r.start_command||""),this.macAddress.set(r.mac_address||""),this.adaptersCount.set(r.adapters||0),this.consoleType.set(r.console_type||""),this.auxConsoleType.set(r.aux_type||""),this.consoleAutoStart.set(r.console_auto_start||!1),this.consoleResolution.set(r.console_resolution||""),this.consoleHttpPort.set(r.console_http_port||0),this.consoleHttpPath.set(r.console_http_path||""),this.memory.set(r.memory||0),this.cpus.set(r.cpus||0),this.environment.set(r.environment||""),this.extraHosts.set(r.extra_hosts||""),this.extraVolumes.set((r.extra_volumes||[]).join(`
`)),this.usage.set(r.usage||""),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}getConfiguration(){this.consoleTypes=this.configurationService.getConsoleTypes(),this.auxConsoleTypes=this.configurationService.getAuxConsoleTypes(),this.categories=this.configurationService.getCategories(),this.consoleResolutions=this.configurationService.getConsoleResolutions()}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","docker","templates"])}toggleSection(e){switch(e){case"general":this.generalSettingsExpanded=!this.generalSettingsExpanded;break;case"advanced":this.advancedExpanded=!this.advancedExpanded;break;case"usage":this.usageExpanded=!this.usageExpanded;break}}onSave(){let e=this.validationService.validateName(this.name());if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}if(!this.validationService.validateName(this.image()).isValid){this.toasterService.error("Image is required");return}let o=this.validationService.validateAdapters(this.adaptersCount().toString(),100);if(!o.isValid){this.toasterService.error(o.errorMessage);return}let r=this.validationService.validateMacAddress(this.macAddress());if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.validateMemory(this.memory().toString());if(!a.isValid){this.toasterService.error(a.errorMessage);return}let c=this.validationService.validateCpus(this.cpus().toString());if(!c.isValid){this.toasterService.error(c.errorMessage);return}if(this.consoleHttpPort()){let u=this.validationService.validateConsoleHttpPort(this.consoleHttpPort().toString());if(!u.isValid){this.toasterService.error(u.errorMessage||"Console HTTP port must be between 1 and 65535");return}}let p=this.validationService.validateEnvironment(this.environment(),"Advanced > Environment");if(!p.isValid){this.toasterService.error(p.errorMessage);return}this.dockerTemplate.name=this.name(),this.dockerTemplate.default_name_format=this.defaultNameFormat(),this.dockerTemplate.category=this.category(),this.dockerTemplate.symbol=this.symbol(),this.dockerTemplate.tags=this.tags(),this.dockerTemplate.image=this.image(),this.dockerTemplate.start_command=this.startCommand(),this.dockerTemplate.mac_address=this.macAddress(),this.dockerTemplate.adapters=this.adaptersCount(),this.dockerTemplate.console_type=this.consoleType(),this.dockerTemplate.aux_type=this.auxConsoleType(),this.dockerTemplate.console_auto_start=this.consoleAutoStart(),this.dockerTemplate.console_resolution=this.consoleResolution(),this.dockerTemplate.console_http_port=this.consoleHttpPort(),this.dockerTemplate.console_http_path=this.consoleHttpPath(),this.dockerTemplate.memory=this.memory(),this.dockerTemplate.cpus=this.cpus(),this.dockerTemplate.environment=this.environment(),this.dockerTemplate.extra_hosts=this.extraHosts(),this.dockerTemplate.extra_volumes=this.extraVolumes()?this.extraVolumes().split(`
`).filter(u=>u.trim()):[],this.dockerTemplate.usage=this.usage(),this.dockerService.saveTemplate(this.controller,this.dockerTemplate).subscribe({next:u=>{this.toasterService.success("Changes saved")},error:u=>{let h=u.error?.message||u.message||"Failed to save template";this.toasterService.error(h),this.cd.markForCheck()}})}editCustomAdapters(){let e=this.dockerTemplate.custom_adapters||[];e.length===0&&(e=Array.from({length:this.adaptersCount()||1},(a,c)=>({adapter_number:c,port_name:"",adapter_type:""})));let t=this.dialogConfig.openConfig("base",{autoFocus:!1,panelClass:["base-dialog-panel","docker-configurator-dialog-panel"],disableClose:!0,data:{}});t.data={};let r=this.dialog.open(Jh,it(K({},t),{data:{}})).componentInstance;r.adapters.set(e),r.saveHandler=a=>{this.dockerTemplate.custom_adapters=a.map(c=>it(K({},c),{mac_address:c.mac_address||null})),this.adaptersCount.set(a.length)}}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.symbol()}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&this.symbol.set(o)})}addTag(e){let t=(e.value||"").trim();t&&this.dockerTemplate&&(this.dockerTemplate.tags||(this.dockerTemplate.tags=[]),this.dockerTemplate.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.dockerTemplate.tags)return;let t=this.dockerTemplate.tags.indexOf(e);t>=0&&this.dockerTemplate.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-docker-template-details"]],inputs:{name:[1,"name"],defaultNameFormat:[1,"defaultNameFormat"],category:[1,"category"],symbol:[1,"symbol"],tags:[1,"tags"],image:[1,"image"],startCommand:[1,"startCommand"],macAddress:[1,"macAddress"],adaptersCount:[1,"adaptersCount"],memory:[1,"memory"],cpus:[1,"cpus"],consoleType:[1,"consoleType"],auxConsoleType:[1,"auxConsoleType"],consoleAutoStart:[1,"consoleAutoStart"],consoleResolution:[1,"consoleResolution"],consoleHttpPort:[1,"consoleHttpPort"],consoleHttpPath:[1,"consoleHttpPath"],environment:[1,"environment"],extraHosts:[1,"extraHosts"],extraVolumes:[1,"extraVolumes"],usage:[1,"usage"]},outputs:{name:"nameChange",defaultNameFormat:"defaultNameFormatChange",category:"categoryChange",symbol:"symbolChange",tags:"tagsChange",image:"imageChange",startCommand:"startCommandChange",macAddress:"macAddressChange",adaptersCount:"adaptersCountChange",memory:"memoryChange",cpus:"cpusChange",consoleType:"consoleTypeChange",auxConsoleType:"auxConsoleTypeChange",consoleAutoStart:"consoleAutoStartChange",consoleResolution:"consoleResolutionChange",consoleHttpPort:"consoleHttpPortChange",consoleHttpPath:"consoleHttpPathChange",environment:"environmentChange",extraHosts:"extraHostsChange",extraVolumes:"extraVolumesChange",usage:"usageChange"},decls:6,vars:2,consts:[["chipList",""],[1,"docker-details"],[1,"docker-details__header"],["mat-icon-button","",1,"docker-details__back-btn"],[1,"docker-details__title"],[1,"docker-details__content"],["mat-icon-button","",1,"docker-details__back-btn",3,"click"],[1,"docker-details__form-card"],[1,"docker-details__section-header",3,"click"],[1,"docker-details__section-title"],[1,"docker-details__expand-icon"],[1,"form-container"],[1,"preferences__usage-form"],[1,"docker-details__actions"],["mat-button","",1,"docker-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"docker-details__save-btn",3,"click"],[1,"two-column-grid"],[1,"form-field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],["matInput","","type","text","placeholder","Docker image name",3,"input","value"],[1,"docker-details__symbol-row"],["placeholder","Category",3,"selectionChange","value"],[3,"value"],[1,"form-field","form-field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"docker-details__symbol-btn",3,"click"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],["matInput","","type","text","placeholder","Adapters",3,"input","value"],["matInput","","type","text","placeholder","Base MAC",3,"input","value"],["matInput","","type","text","min","0","placeholder","Memory",3,"input","value"],["matSuffix",""],["matInput","","type","text","min","0","placeholder","CPUs",3,"input","value"],["placeholder","Console type",3,"selectionChange","value"],["placeholder","Auxiliary console type",3,"selectionChange","value"],["placeholder","VNC console resolution",3,"selectionChange","value"],["matInput","","type","text","placeholder","HTTP port in the container",3,"input","value"],[1,"form-field","grid-span-2"],["matInput","","type","text","placeholder","HTTP path",3,"input","value"],[1,"grid-span-2",3,"change","checked"],["mat-button","",1,"form-field",3,"click"],[3,"removed"],["matChipRemove",""],[1,"docker-details__section-subtitle"],["matInput","","type","text","placeholder",'Command to run when the container starts (overrides image default CMD). E.g., python app.py, nginx -g "daemon off;"',3,"input","value"],["matInput","","type","text","placeholder","Environment variables (one per line, KEY=VALUE format). Supports: %vm-name%, %vm-id%, %project-id%, %project-path%",3,"input","value"],["matInput","","type","text","placeholder",`Container directories to persist, one per line (e.g., /data
/config)`,3,"input","value"],["matInput","","type","text","placeholder","Hostname to IP mappings, one per line (e.g., gns3.com:192.168.100.10)",3,"input","value"],[1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,ore,3,0,"button",3),s(3,"h1",4),d(4,"Docker container template configuration"),l()(),A(5,ure,27,6,"main",5),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.dockerTemplate?5:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,ie,de,W,pe,je,we,Me,et,Mi,Se,Ee,vt,At,_t,ti,Jn,vi,Ci,mi,Ot,Gt],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.docker-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.docker-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.docker-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.docker-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.docker-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.docker-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.docker-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px}.docker-details__section-header[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s ease;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.docker-details__section-header[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.docker-details__section-title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.docker-details__expand-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:transform .2s ease}.docker-details__form[_ngcontent-%COMP%], .form-container[_ngcontent-%COMP%]{padding:16px 24px 24px;display:flex;flex-direction:column;gap:16px}.docker-details__form[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%], .form-container[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:16px}.docker-details__form[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%] .grid-span-2[_ngcontent-%COMP%], .form-container[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%] .grid-span-2[_ngcontent-%COMP%]{grid-column:1/-1}.docker-details__field[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]{width:100%}.docker-details__field--flex[_ngcontent-%COMP%]{flex:1}.docker-details__field--full[_ngcontent-%COMP%]{width:100%;padding:0}.docker-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.docker-details__symbol-row[_ngcontent-%COMP%] .form-field[_ngcontent-%COMP%]{flex:1}.docker-details__symbol-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.docker-details__section-subtitle[_ngcontent-%COMP%]{font-size:12px;font-weight:600;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px;margin:8px 0}.docker-details__checkbox[_ngcontent-%COMP%]{margin-top:8px}.docker-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.docker-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.docker-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.docker-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.docker-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.docker-details__title[_ngcontent-%COMP%]{font-size:22px}.docker-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.docker-details__section-header[_ngcontent-%COMP%]{padding:12px 16px}.docker-details__form[_ngcontent-%COMP%], .form-container[_ngcontent-%COMP%]{padding:16px}.docker-details__symbol-row[_ngcontent-%COMP%]{flex-direction:column}.docker-details__symbol-btn[_ngcontent-%COMP%]{width:100%}.docker-details__actions[_ngcontent-%COMP%]{flex-direction:column}.docker-details__cancel-btn[_ngcontent-%COMP%], .docker-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var hre=(n,i)=>i.template_id;function fre(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences")}}function gre(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/docker/addtemplate")}}function _re(n,i){n&1&&R(0,"app-empty-templates-list")}function vre(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"developer_board"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"a",15)(11,"mat-icon"),d(12,"edit"),l(),s(13,"span"),d(14,"Edit"),l()(),s(15,"button",16),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.copyTemplate(o))}),s(16,"mat-icon"),d(17,"content_copy"),l(),s(18,"span"),d(19,"Copy"),l()(),s(20,"button",16),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(21,"mat-icon"),d(22,"delete"),l(),s(23,"span"),d(24,"Delete"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(5),C("routerLink",e.template_id)}}function Cre(n,i){if(n&1&&(s(0,"nav",8),Y(1,vre,25,4,"div",10,hre),l()),n&2){let e=v();m(),Z(e.dockerTemplates)}}var N0=(()=>{class n{route=f(lt);controllerService=f(Je);dockerService=f(ds);toasterService=f(te);router=f(ht);cd=f(Q);controller;dockerTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.dockerService.getTemplates(this.controller).subscribe({next:e=>{this.dockerTemplates=e.filter(t=>t.template_type==="docker"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}copyTemplate(e){this.router.navigate(["/controller",this.controller.id,"preferences","docker","templates",e.template_id,"copy"])}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-docker-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"docker-templates"],[1,"docker-templates__header"],["mat-icon-button","",1,"docker-templates__back-btn",3,"routerLink"],[1,"docker-templates__title"],["matTooltip","Add Docker container template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"docker-templates__add-btn",3,"routerLink"],[1,"docker-templates__content"],[1,"docker-templates__list"],[3,"deleteEvent","controller"],[1,"docker-templates__list-item",3,"routerLink"],[1,"docker-templates__list-icon"],[1,"docker-templates__list-name"],["mat-icon-button","",1,"docker-templates__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"routerLink"],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,fre,3,1,"button",4),s(3,"h1",5),d(4,"Docker container templates"),l(),A(5,gre,3,1,"button",6),l(),s(6,"main",7),A(7,_re,1,0,"app-empty-templates-list"),A(8,Cre,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.dockerTemplates.length?-1:7),m(),O(o.dockerTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.docker-templates__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.docker-templates__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.docker-templates__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.docker-templates__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.docker-templates__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.docker-templates__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.docker-templates__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.docker-templates__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.docker-templates__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.docker-templates__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.docker-templates__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.docker-templates__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.docker-templates__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.docker-templates__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.docker-templates__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.docker-templates__back-btn[_ngcontent-%COMP%], .docker-templates__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.docker-templates__title[_ngcontent-%COMP%]{font-size:24px}.docker-templates__content[_ngcontent-%COMP%]{padding:0 16px 16px}.docker-templates__list-item[_ngcontent-%COMP%]{padding:14px 16px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var hl=(()=>{class n{countSource=new He;currentCount=this.countSource.asObservable();cancelItem=new He;currentCancelItemDetails=this.cancelItem.asObservable();constructor(){}processBarCount(e){this.countSource.next(e)}cancelFileUploading(e){this.cancelItem.next(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function bre(n,i){n&1&&bs(0,"div",2)}var xre=new cn("MAT_PROGRESS_BAR_DEFAULT_OPTIONS");var Rc=(()=>{class n{_elementRef=f(Zt);_ngZone=f(Vi);_changeDetectorRef=f(Q);_renderer=f(Si);_cleanupTransitionEnd;constructor(){let e=h4(),t=f(xre,{optional:!0});this._isNoopAnimation=e==="di-disabled",e==="reduced-motion"&&this._elementRef.nativeElement.classList.add("mat-progress-bar-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),this.mode=t.mode||this.mode)}_isNoopAnimation;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";get value(){return this._value}set value(e){this._value=N8(e||0),this._changeDetectorRef.markForCheck()}_value=0;get bufferValue(){return this._bufferValue||0}set bufferValue(e){this._bufferValue=N8(e||0),this._changeDetectorRef.markForCheck()}_bufferValue=0;animationEnd=new ve;get mode(){return this._mode}set mode(e){this._mode=e,this._changeDetectorRef.markForCheck()}_mode="determinate";ngAfterViewInit(){this._ngZone.runOutsideAngular(()=>{this._cleanupTransitionEnd=this._renderer.listen(this._elementRef.nativeElement,"transitionend",this._transitionendHandler)})}ngOnDestroy(){this._cleanupTransitionEnd?.()}_getPrimaryBarTransform(){return`scaleX(${this._isIndeterminate()?1:this.value/100})`}_getBufferBarFlexBasis(){return`${this.mode==="buffer"?this.bufferValue:100}%`}_isIndeterminate(){return this.mode==="indeterminate"||this.mode==="query"}_transitionendHandler=e=>{this.animationEnd.observers.length===0||!e.target||!e.target.classList.contains("mdc-linear-progress__primary-bar")||(this.mode==="determinate"||this.mode==="buffer")&&this._ngZone.run(()=>this.animationEnd.next({value:this.value}))};static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-progress-bar"]],hostAttrs:["role","progressbar","aria-valuemin","0","aria-valuemax","100","tabindex","-1",1,"mat-mdc-progress-bar","mdc-linear-progress"],hostVars:10,hostBindings:function(t,o){t&2&&(qt("aria-valuenow",o._isIndeterminate()?null:o.value)("mode",o.mode),er("mat-"+o.color),Be("_mat-animation-noopable",o._isNoopAnimation)("mdc-linear-progress--animation-ready",!o._isNoopAnimation)("mdc-linear-progress--indeterminate",o._isIndeterminate()))},inputs:{color:"color",value:[2,"value","value",No],bufferValue:[2,"bufferValue","bufferValue",No],mode:"mode"},outputs:{animationEnd:"animationEnd"},exportAs:["matProgressBar"],decls:7,vars:5,consts:[["aria-hidden","true",1,"mdc-linear-progress__buffer"],[1,"mdc-linear-progress__buffer-bar"],[1,"mdc-linear-progress__buffer-dots"],["aria-hidden","true",1,"mdc-linear-progress__bar","mdc-linear-progress__primary-bar"],[1,"mdc-linear-progress__bar-inner"],["aria-hidden","true",1,"mdc-linear-progress__bar","mdc-linear-progress__secondary-bar"]],template:function(t,o){t&1&&(vo(0,"div",0),bs(1,"div",1),A(2,bre,1,0,"div",2),wo(),vo(3,"div",3),bs(4,"span",4),wo(),vo(5,"div",5),bs(6,"span",4),wo()),t&2&&(m(),nn("flex-basis",o._getBufferBarFlexBasis()),m(),O(o.mode==="buffer"?2:-1),m(),nn("transform",o._getPrimaryBarTransform()))},styles:[`.mat-mdc-progress-bar{--mat-progress-bar-animation-multiplier: 1;display:block;text-align:start}.mat-mdc-progress-bar[mode=query]{transform:scaleX(-1)}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-dots,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__secondary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__bar-inner.mdc-linear-progress__bar-inner{animation:none}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-bar{transition:transform 1ms}.mat-progress-bar-reduced-motion{--mat-progress-bar-animation-multiplier: 2}.mdc-linear-progress{position:relative;width:100%;transform:translateZ(0);outline:1px solid rgba(0,0,0,0);overflow-x:hidden;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);height:max(var(--mat-progress-bar-track-height, 4px),var(--mat-progress-bar-active-indicator-height, 4px))}@media(forced-colors: active){.mdc-linear-progress{outline-color:CanvasText}}.mdc-linear-progress__bar{position:absolute;top:0;bottom:0;margin:auto 0;width:100%;animation:none;transform-origin:top left;transition:transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);height:var(--mat-progress-bar-active-indicator-height, 4px)}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{transition:none}[dir=rtl] .mdc-linear-progress__bar{right:0;transform-origin:center right}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;animation:none;border-top-style:solid;border-color:var(--mat-progress-bar-active-indicator-color, var(--mat-sys-primary));border-top-width:var(--mat-progress-bar-active-indicator-height, 4px)}.mdc-linear-progress__buffer{display:flex;position:absolute;top:0;bottom:0;margin:auto 0;width:100%;overflow:hidden;height:var(--mat-progress-bar-track-height, 4px);border-radius:var(--mat-progress-bar-track-shape, var(--mat-sys-corner-none))}.mdc-linear-progress__buffer-dots{background-image:radial-gradient(circle, var(--mat-progress-bar-track-color, var(--mat-sys-surface-variant)) calc(var(--mat-progress-bar-track-height, 4px) / 2), transparent 0);background-repeat:repeat-x;background-size:calc(calc(var(--mat-progress-bar-track-height, 4px) / 2)*5);background-position:left;flex:auto;transform:rotate(180deg);animation:mdc-linear-progress-buffering calc(250ms*var(--mat-progress-bar-animation-multiplier)) infinite linear}@media(forced-colors: active){.mdc-linear-progress__buffer-dots{background-color:ButtonBorder}}[dir=rtl] .mdc-linear-progress__buffer-dots{animation:mdc-linear-progress-buffering-reverse calc(250ms*var(--mat-progress-bar-animation-multiplier)) infinite linear;transform:rotate(0)}.mdc-linear-progress__buffer-bar{flex:0 1 100%;transition:flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);background-color:var(--mat-progress-bar-track-color, var(--mat-sys-surface-variant))}.mdc-linear-progress__primary-bar{transform:scaleX(0)}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation:mdc-linear-progress-primary-indeterminate-translate calc(2s*var(--mat-progress-bar-animation-multiplier)) infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-primary-indeterminate-scale calc(2s*var(--mat-progress-bar-animation-multiplier)) infinite linear}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation:mdc-linear-progress-secondary-indeterminate-translate calc(2s*var(--mat-progress-bar-animation-multiplier)) infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-secondary-indeterminate-scale calc(2s*var(--mat-progress-bar-animation-multiplier)) infinite linear}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}@keyframes mdc-linear-progress-buffering{from{transform:rotate(180deg) translateX(calc(var(--mat-progress-bar-track-height, 4px) * -2.5))}}@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(-83.67142%)}100%{transform:translateX(-200.611057%)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(-37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(-84.386165%)}100%{transform:translateX(-160.277782%)}}@keyframes mdc-linear-progress-buffering-reverse{from{transform:translateX(-10px)}}
`],encapsulation:2,changeDetection:0})}return n})();function N8(n,i=0,e=100){return Math.max(i,Math.min(e,n))}var ms=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[hi]})}return n})();var fl=(()=>{class n{data;_snackRef=f(O4);_US=f(hl);uploadProgress=ae(0);subscription;upload_file_type;constructor(e){this.data=e}ngOnInit(){this.upload_file_type=this.data.upload_file_type,this.subscription=this._US.currentCount.subscribe(e=>{this.uploadProgress.set(e),(this.uploadProgress()===100||this.uploadProgress()==null)&&this.dismiss()})}dismiss(){this._snackRef.dismiss()}cancelItem(){this._US.cancelFileUploading(!0)}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)(ot(N4))};static \u0275cmp=F({type:n,selectors:[["app-uploading-processbar"]],decls:8,vars:3,consts:[[1,"row","proccessBar-row"],[1,"col-md-9","proccessBar-col"],["mode","determinate","aria-valuemin","0","aria-valuemax","100",3,"value"],[1,"col-md-3","proccessBar-col"],["mat-button","","color","primary",1,"file-button",3,"click"]],template:function(t,o){t&1&&(s(0,"p"),d(1),l(),s(2,"div",0)(3,"div",1),R(4,"mat-progress-bar",2),l(),s(5,"div",3)(6,"button",4),g("click",function(){return o.cancelItem()}),d(7,"Cancel"),l()()()),t&2&&(m(),ui("",o.upload_file_type," Uploading please wait .... ",o.uploadProgress,"%"),m(3),C("value",o.uploadProgress))},dependencies:[W,pe,ms,Rc],styles:[".mat-snack-bar-container[_ngcontent-%COMP%]{min-width:450px}.proccessBar-row[_ngcontent-%COMP%]{display:flex}.proccessBar-col[_ngcontent-%COMP%]{margin:auto}"],changeDetection:0})}return n})();var Dm=class{auto_delete_disks;builtin;category;chassis;compute_id;console_auto_start;console_type;aux_type;default_name_format;disk0;disk1;exec_area;idlemax;idlepc;idlesleep;image;iomem;mac_addr;mmap;name;nvram;platform;private_config;ram;slot0;slot1;slot2;slot3;slot4;slot5;slot6;slot7;sparsemem;startup_config;symbol;system_id;template_id;template_type;usage;wic0;wic1;wic2;tags};var Pm=(()=>{class n{c2600_nms=["NM-1FE-TX","NM-1E","NM-4E","NM-16ESW"];c3600_nms=["NM-1FE-TX","NM-1E","NM-4E","NM-16ESW","NM-4T"];c3700_nms=["NM-1FE-TX","NM-4T","NM-16ESW"];c7200_pas=["PA-A1","PA-FE-TX","PA-2FE-TX","PA-GE","PA-4T+","PA-8T","PA-4E","PA-8E","PA-POS-OC3"];c7200_io=["C7200-IO-FE","C7200-IO-2FE","C7200-IO-GE-E"];c1700_wics=["WIC-1T","WIC-2T","WIC-1ENET"];c2600_wics=["WIC-1T","WIC-2T"];c3700_wics=["WIC-1T","WIC-2T"];getConsoleTypes(){return["telnet","ssh","none"]}getCategories(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getDefaultRamSettings(){return{c1700:160,c2600:160,c2691:192,c3600:192,c3725:128,c3745:256,c7200:512}}getDefaultNvRamSettings(){return{c1700:128,c2600:128,c2691:256,c3600:256,c3725:256,c3745:256,c7200:512}}getAvailablePlatforms(){return["c1700","c2600","c2691","c3725","c3745","c3600","c7200"]}getPlatformsWithEtherSwitchRouterOption(){return{c1700:!1,c2600:!0,c2691:!0,c3725:!0,c3745:!0,c3600:!0,c7200:!1}}getPlatformsWithChassis(){return{c1700:!0,c2600:!0,c2691:!1,c3725:!1,c3745:!1,c3600:!0,c7200:!1}}getChassis(){return{c1700:["1720","1721","1750","1751","1760"],c2600:["2610","2611","2620","2621","2610XM","2611XM","2620XM","2621XM","2650XM","2651XM"],c3600:["3620","3640","3660"]}}getNPETypes(){return["npe-100","npe-150","npe-175","npe-200","npe-225","npe-300","npe-400","npe-g2"]}getMidplaneTypes(){return["std","vxr"]}getAdapterMatrix(){let e={};for(let t of["c1700","c2600","c2691","c3725","c3745","c3600","c7200"])e[t]={};for(let t of["1720","1721","1750","1751","1760"])e.c1700[t]={0:["C1700-MB-1FE"]};for(let t of["1751","1760"])e.c1700[t][1]=["C1700-MB-WIC1"];for(let t of["2620","2610XM","2620XM","2650XM"])e.c2600[t]={0:["C2600-MB-1FE"],1:this.c2600_nms};for(let t of["2621","2611XM","2621XM","2651XM"])e.c2600[t]={0:["C2600-MB-2FE"],1:this.c2600_nms};e.c2600[2610]={0:["C2600-MB-1E"],1:this.c2600_nms},e.c2600[2611]={0:["C2600-MB-2E"],1:this.c2600_nms},e.c2691[""]={0:["GT96100-FE"],1:this.c3700_nms},e.c3600[3620]={};for(let t=0;t<2;t++)e.c3600[3620][t]=this.c3600_nms;e.c3600[3640]={};for(let t=0;t<4;t++)e.c3600[3640][t]=this.c3600_nms;e.c3600[3660]={0:["Leopard-2FE"]};for(let t=1;t<7;t++)e.c3600[3660][t]=this.c3600_nms;e.c3725[""]={0:["GT96100-FE"]};for(let t=1;t<3;t++)e.c3725[""][t]=this.c3700_nms;e.c3745[""]={0:["GT96100-FE"]};for(let t=1;t<5;t++)e.c3745[""][t]=this.c3700_nms;e.c7200[""]={0:this.c7200_io};for(let t=1;t<7;t++)e.c7200[""][t]=this.c7200_pas;return e}getWicMatrix(){let e={};return e.c1700={0:this.c1700_wics,1:this.c1700_wics},e.c2600={0:this.c2600_wics,1:this.c2600_wics,2:this.c2600_wics},e.c2691={0:this.c3700_wics,1:this.c3700_wics,2:this.c3700_wics},e.c3725={0:this.c3700_wics,1:this.c3700_wics,2:this.c3700_wics},e.c3745={0:this.c3700_wics,1:this.c3700_wics,2:this.c3700_wics},e}getIdlepcRegex(){return/^(0x[0-9a-fA-F]+)?$|^$/}getMacAddrRegex(){return/^([0-9a-fA-F]{4}\.){2}[0-9a-fA-F]{4}$|^$/}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ps=(()=>{class n{httpController;constructor(e){this.httpController=e}getImages(e){return this.httpController.get(e,"/images?image_type=ios")}getImagePath(e,t){return`${e.protocol}//${e.host}:${e.port}/${wi.current_version}/images/upload/${t}`}getTemplates(e){return this.httpController.get(e,"/templates")}getTemplate(e,t){return this.httpController.get(e,`/templates/${t}`)}addTemplate(e,t){return this.httpController.post(e,"/templates",t)}saveTemplate(e,t){return this.httpController.put(e,`/templates/${t.template_id}`,t)}findIdlePC(e,t){return this.httpController.post(e,`/computes/${wi.compute_id}/dynamips/auto_idlepc`,t)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var yre=()=>[0,1,2,3,4,5,6],Sre=()=>[0,1,2],wre=(n,i)=>i.filename;function Mre(n,i){if(n&1){let e=z();s(0,"button",6),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function kre(n,i){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),ee(" ",e.filename," ")}}function Tre(n,i){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Ere(n,i){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Dre(n,i){if(n&1){let e=z();s(0,"mat-form-field",18)(1,"mat-label"),d(2,"Chassis"),l(),s(3,"mat-select",39),g("selectionChange",function(o){k(e);let r=v(2);return r.chassis.set(o.value),T(r.onChassisChosen())}),Y(4,Ere,2,2,"mat-option",20,Ae),l()()}if(n&2){let e=v(2);m(3),C("value",e.chassis()),m(),Z(e.chassisOptions()[e.platform()])}}function Pre(n,i){if(n&1){let e=z();s(0,"mat-checkbox",40),g("change",function(o){k(e);let r=v(2);return T(r.isEtherSwitchRouter.set(o.checked))}),d(1," This is an EtherSwitch router "),l()}if(n&2){let e=v(2);C("checked",e.isEtherSwitchRouter())}}function Ire(n,i){n&1&&R(0,"mat-option",20)}function Are(n,i){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Ore(n,i){if(n&1){let e=z();s(0,"mat-form-field",18)(1,"mat-label"),d(2),l(),s(3,"mat-select",41),g("selectionChange",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.onAdapterChange(r,o.value))}),A(4,Ire,1,0,"mat-option",20),Y(5,Are,2,2,"mat-option",20,Ae),l()()}if(n&2){let e=v().$implicit,t=v(3);m(2),ee("Slot ",e),m(),C("placeholder",Ui("Slot ",e))("value",t.networkAdaptersForTemplate()[e]||""),m(),O(t.adapterMatrix()[t.platform()][t.chassis()||""][e].length>1&&!t.adapterMatrix()[t.platform()][t.chassis()||""][e][0].startsWith("C7200")?4:-1),m(),Z(t.adapterMatrix()[t.platform()][t.chassis()||""][e])}}function Nre(n,i){if(n&1&&A(0,Ore,7,5,"mat-form-field",18),n&2){let e=i.$implicit,t=v(3);O(t.adapterMatrix()[t.platform()][t.chassis()||""][e]?0:-1)}}function Fre(n,i){n&1&&(s(0,"div",31),Y(1,Nre,1,1,null,null,Ae),l()),n&2&&(m(),Z(Bt(0,yre)))}function Rre(n,i){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Lre(n,i){if(n&1){let e=z();s(0,"mat-form-field",18)(1,"mat-label"),d(2),l(),s(3,"mat-select",41),g("selectionChange",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.onWicChange(r,o.value))}),s(4,"mat-option",20),d(5),l(),Y(6,Rre,2,2,"mat-option",20,Ae),l()()}if(n&2){let e=v().$implicit,t=v(3);m(2),ee("WIC ",e),m(),C("placeholder",Ui("WIC ",e))("value",t.wicsForTemplate()[e]||""),m(2),ee(" ",""," "),m(),Z(t.wicMatrix()[t.platform()][e])}}function Vre(n,i){if(n&1&&A(0,Lre,8,5,"mat-form-field",18),n&2){let e=i.$implicit,t=v(3);O(t.wicMatrix()[t.platform()]&&t.wicMatrix()[t.platform()][e]?0:-1)}}function Bre(n,i){n&1&&(s(0,"mat-step",32)(1,"div",10)(2,"div",31),Y(3,Vre,1,1,null,null,Ae),l()()()),n&2&&(m(3),Z(Bt(0,Sre)))}function zre(n,i){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"mat-vertical-stepper",8)(3,"mat-step",9)(4,"div",10)(5,"mat-radio-group",11)(6,"mat-radio-button",12),g("click",function(){k(e);let o=v();return T(o.setControllerType("local"))}),d(7," Run this IOS router locally "),l()()()(),s(8,"mat-step",13)(9,"div",10)(10,"input",14,0),g("change",function(o){k(e);let r=v();return T(r.addImage(o))}),l(),s(12,"button",15),g("click",function(){k(e);let o=Pe(11);return T(o.click())}),d(13," Click to add image "),l(),s(14,"span",16),d(15,"or create from existing one"),l(),s(16,"div",17)(17,"mat-form-field",18)(18,"mat-label"),d(19,"Image"),l(),s(20,"mat-select",19),g("selectionChange",function(o){k(e);let r=v();return r.imageName.set(o.value),T(r.onImageChosen())}),Y(21,kre,2,2,"mat-option",20,wre),l()()()()(),s(23,"mat-step",21)(24,"div",10)(25,"div",17)(26,"mat-form-field",18)(27,"mat-label"),d(28,"Name"),l(),s(29,"input",22),g("input",function(o){k(e);let r=v();return T(r.templateName.set(o.target.value))}),l()(),s(30,"mat-form-field",18)(31,"mat-label"),d(32,"Platform"),l(),s(33,"mat-select",23),g("selectionChange",function(o){k(e);let r=v();return r.platform.set(o.value),T(r.onPlatformChosen())}),Y(34,Tre,2,2,"mat-option",20,Ae),l()(),A(36,Dre,6,1,"mat-form-field",18),l(),A(37,Pre,2,1,"mat-checkbox",24),l()(),s(38,"mat-step",25)(39,"div",10)(40,"div",17)(41,"mat-form-field",18)(42,"mat-label"),d(43,"Default RAM"),l(),s(44,"input",26),g("input",function(o){k(e);let r=v();return T(r.memory.set(o.target.value))}),l(),s(45,"span",27),d(46,"MB"),l()(),s(47,"mat-label",28)(48,"a",29),d(49,"Check for minimum and maximum RAM requirement"),l()()()()(),s(50,"mat-step",30)(51,"div",10),A(52,Fre,3,1,"div",31),l()(),A(53,Bre,5,1,"mat-step",32),s(54,"mat-step",33)(55,"div",10)(56,"div",17)(57,"mat-form-field",18)(58,"mat-label"),d(59,"Idle-PC"),l(),s(60,"input",34),g("input",function(o){k(e);let r=v();return T(r.idlepc.set(o.target.value))}),l()(),s(61,"button",35),g("click",function(){k(e);let o=v();return T(o.findIdlePC())}),d(62,"Idle-PC finder"),l()()()()()(),s(63,"div",36)(64,"button",37),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(65,"Cancel"),l(),s(66,"button",38),g("click",function(){k(e);let o=v();return T(o.addTemplate())}),d(67," Add template "),l()()()}if(n&2){let e=v();m(2),C("linear",!0),m(),C("completed",e.isLocalComputerChosen()),m(3),C("checked",!0),m(2),C("completed",e.imageStepCompleted()),m(2),C("uploader",e.uploader()),m(10),C("value",e.imageName()),m(),Z(e.iosImages()),m(2),C("completed",e.namePlatformStepCompleted()),m(6),C("value",e.templateName()),m(4),C("value",e.platform()),m(),Z(e.platforms()),m(2),O(e.chassisOptions()[e.platform()]?36:-1),m(),O(e.platformsWithEtherSwitchRouterOption()[e.iosTemplate().platform]?37:-1),m(),C("completed",e.memoryStepCompleted()),m(6),C("value",e.memory()),m(4),C("href",e.ciscoUrl,Ia),m(4),O(e.platform()&&e.adapterMatrix()[e.platform()]&&e.adapterMatrix()[e.platform()][e.chassis()||""]?52:-1),m(),O(e.platform()&&e.wicMatrix()[e.platform()]?53:-1),m(7),C("value",e.idlepc())}}var Cx=(()=>{class n{route=f(lt);controllerService=f(Je);iosService=f(ps);toasterService=f(te);router=f(ht);templateMocksService=f(xa);iosConfigurationService=f(Pm);computeService=f(ko);uploadServiceService=f(hl);progressService=f(no);snackBar=f(vr);cd=f(Q);controller=ae(void 0);iosTemplate=ae(new Dm);isEtherSwitchRouter=ae(!1);imageName=U("");templateName=U("");platform=U("");chassis=U("");memory=U("");idlepc=U("");iosImages=ae([]);platforms=ae([]);platformsWithEtherSwitchRouterOption=ae({});chassisOptions=ae({});defaultRam=ae({});networkAdaptersForTemplate=ae([]);wicsForTemplate=ae([]);adapterMatrix=ae({});wicMatrix=ae({});ciscoUrl="https://cfn.cloudapps.cisco.com/ITDIT/CFN/jsp/SearchBySoftware.jsp";uploader=ae(void 0);isLocalComputerChosen=ae(!0);subscription;imageStepCompleted=Jt(()=>!!this.imageName());namePlatformStepCompleted=Jt(()=>!!this.templateName()&&!!this.platform());memoryStepCompleted=Jt(()=>!!this.memory());ngOnInit(){this.uploader.set(new $a({url:""})),this.uploader().onAfterAddingFile=t=>{t.withCredentials=!1},this.uploader().onErrorItem=(t,o,r,a)=>{this.toasterService.error("An error occured: "+o)},this.uploader().onSuccessItem=(t,o,r,a)=>{this.getImages(),this.toasterService.success("Image uploaded")},this.uploader().onProgressItem=t=>{this.uploadServiceService.processBarCount(t.progress)},this.subscription=this.uploadServiceService.currentCancelItemDetails.subscribe(t=>{t&&this.cancelUploading()});let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller.set(t),this.getImages(),this.templateMocksService.getIosTemplate().subscribe({next:o=>{this.iosTemplate.set(o),this.platforms.set(this.iosConfigurationService.getAvailablePlatforms()),this.platformsWithEtherSwitchRouterOption.set(this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption()),this.chassisOptions.set(this.iosConfigurationService.getChassis()),this.defaultRam.set(this.iosConfigurationService.getDefaultRamSettings()),this.adapterMatrix.set(this.iosConfigurationService.getAdapterMatrix()),this.wicMatrix.set(this.iosConfigurationService.getWicMatrix())},error:o=>{let r=o.error?.message||o.message||"Failed to load template";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}fillDefaultSlots(){if(!this.platform())return;let t=this.adapterMatrix()[this.platform()];if(!t)return;let o=this.chassisOptions()[this.platform()];if(o&&!this.chassis())return;let r=o?this.chassis():"",a=t[r];if(a)for(let c=0;c<=6;c++){let p=a[c];if(p&&(p.length===1||p[0].startsWith("C7200"))){let u=[...this.networkAdaptersForTemplate()];u[c]=p[0],this.networkAdaptersForTemplate.set(u)}}}setControllerType(e){e==="local"&&this.isLocalComputerChosen.set(!0)}getImages(){this.iosService.getImages(this.controller()).subscribe({next:e=>{this.iosImages.set(e)},error:e=>{let t=e.error?.message||e.message||"Failed to load images";this.toasterService.error(t),this.cd.markForCheck()}})}addImage(e){let t=e.target.files[0].name.split("-")[0];this.templateName.set(t);let o=e.target.files[0].name,r=this.iosService.getImagePath(this.controller(),o);this.uploader().queue.forEach(c=>c.url=r);let a=this.uploader().queue[0];a.options&&(a.options.disableMultipart=!0),a.options.headers=[{name:"Authorization",value:"Bearer "+this.controller().authToken}],this.uploader().uploadItem(a),this.snackBar.openFromComponent(fl,{panelClass:"uplaoding-file-snackabar",data:{upload_file_type:"Image"}})}addTemplate(){if(this.imageName()&&this.templateName()&&this.platform()&&this.memory()){let e=this.iosTemplate();e.template_id=Ai(),e.image=this.imageName(),e.name=this.templateName(),e.platform=this.platform(),this.chassisOptions()[this.platform()]&&(e.chassis=this.chassis()),e.ram=+this.memory(),this.isEtherSwitchRouter()&&(e.symbol="multilayer_switch",e.category="switch"),this.networkAdaptersForTemplate().length>0&&this.completeAdaptersData(e),this.wicsForTemplate().length>0&&this.completeWicsData(e),this.idlepc()&&(e.idlepc=this.idlepc()),e.compute_id="local",this.iosService.addTemplate(this.controller(),e).subscribe({next:t=>{this.goBack()},error:t=>{let o=t.error?.message||t.message||"Failed to add ios template";this.toasterService.error(o),this.cd.markForCheck()}})}else this.toasterService.error("Fill all required fields")}completeAdaptersData(e){let t=this.adapterMatrix();for(let o=0;o<=6;o++)t[e.platform][e.chassis||""][o]&&(this.networkAdaptersForTemplate()[o]===void 0?e[`slot${o}`]="":e[`slot${o}`]=this.networkAdaptersForTemplate()[o])}completeWicsData(e){let t=this.wicMatrix();for(let o=0;o<=3;o++)t[e.platform][o]&&(this.wicsForTemplate()[o]===void 0?e[`wic${o}`]="":e[`wic${o}`]=this.wicsForTemplate()[o])}goBack(){this.router.navigate(["/controller",this.controller().id,"preferences","dynamips","templates"])}onImageChosen(){let e=this.imageName().split("-")[0];this.templateName.set(e);let t=e.substring(1);if(["c1700","c2600","c2691","c3725","c3745","c3600","c7200"].includes(e))this.platform.set(e),e==="c1700"?this.chassis.set("1760"):e==="c2600"?this.chassis.set("2651XM"):this.chassis.set("");else if(e.startsWith("c36")){this.platform.set("c3600");let r=["3620","3640","3660"];r.includes(t)?this.chassis.set(t):(this.chassis.set(""),this.toasterService.warning(`Invalid chassis '${t}' for platform c3600. Please select a valid chassis: ${r.join(", ")}`))}else if(e.startsWith("c17")){this.platform.set("c1700");let r=["1720","1721","1750","1751","1760"];r.includes(t)?this.chassis.set(t):(this.chassis.set(""),this.toasterService.warning(`Invalid chassis '${t}' for platform c1700. Please select a valid chassis: ${r.join(", ")}`))}else e.startsWith("c26")?(this.platform.set("c2600"),["2610","2611","2620","2621","2610XM","2611XM","2620XM","2621XM","2650XM","2651XM"].includes(t)?this.chassis.set(t):(this.chassis.set(""),this.toasterService.warning(`Invalid chassis '${t}' for platform c2600. Please select a valid chassis.`))):(this.platform.set(e),this.chassis.set(""),this.toasterService.warning(`Unknown platform '${e}'. Supported platforms are: c1700, c2600, c2691, c3600, c3725, c3745, c7200. Please verify the platform manually.`));this.memory.set(String(this.defaultRam()[this.platform()])),this.fillDefaultSlots()}onPlatformChosen(){let e=this.iosTemplate();e.chassis="",this.iosTemplate.set(K({},e)),this.networkAdaptersForTemplate.set([]),this.wicsForTemplate.set([]),this.chassisOptions()[this.platform()]||this.fillDefaultSlots()}onChassisChosen(){this.networkAdaptersForTemplate.set([]),this.chassisOptions()[this.platform()]&&this.fillDefaultSlots()}cancelUploading(){this.uploader().clearQueue(),this.uploadServiceService.processBarCount(null),this.toasterService.warning("File upload cancelled")}onAdapterChange(e,t){this.networkAdaptersForTemplate.update(o=>{let r=[...o];return r[e]=t,r})}onWicChange(e,t){this.wicsForTemplate.update(o=>{let r=[...o];return r[e]=t,r})}findIdlePC(){let e={image:this.imageName(),platform:this.platform(),ram:+this.memory()};this.progressService.activate(),this.iosService.findIdlePC(this.controller(),e).subscribe(t=>{this.progressService.deactivate(),t.idlepc!==null&&(this.idlepc.set(t.idlepc),this.toasterService.success(`Idle-PC value found: ${t.idlepc}`))},t=>{this.progressService.deactivate(),this.toasterService.error("Error while finding an idle-PC value")})}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-ios-template"]],inputs:{imageName:[1,"imageName"],templateName:[1,"templateName"],platform:[1,"platform"],chassis:[1,"chassis"],memory:[1,"memory"],idlepc:[1,"idlepc"]},outputs:{imageName:"imageNameChange",templateName:"templateNameChange",platform:"platformChange",chassis:"chassisChange",memory:"memoryChange",idlepc:"idlepcChange"},decls:6,vars:2,consts:[["file",""],[1,"ios-add"],[1,"ios-add__header"],["mat-icon-button","",1,"ios-add__back-btn"],[1,"ios-add__title"],[1,"ios-add__content"],["mat-icon-button","",1,"ios-add__back-btn",3,"click"],[1,"ios-add__stepper-card"],[1,"ios-add__stepper",3,"linear"],["label","Controller type",3,"completed"],[1,"ios-add__step-content"],[1,"ios-add__radio-group"],["value","1",1,"ios-add__radio",3,"click","checked"],["label","IOS image",3,"completed"],["type","file","accept",".bin, .image","ng2FileSelect","",1,"ios-add__file-input",3,"change","uploader"],["mat-raised-button","","color","primary",1,"ios-add__upload-btn",3,"click"],[1,"ios-add__or-text"],[1,"ios-add__form"],["appearance","fill",1,"ios-add__field"],["placeholder","Image",3,"selectionChange","value"],[3,"value"],["label","Name and platform",3,"completed"],["matInput","","type","text","placeholder","Name",3,"input","value"],["placeholder","Platform",3,"selectionChange","value"],[1,"ios-add__checkbox",3,"checked"],["label","Memory",3,"completed"],["matInput","","type","number","placeholder","Default RAM",3,"input","value"],["matSuffix",""],[1,"ios-add__ram-link"],[3,"href"],["label","Network adapters"],[1,"ios-add__adapters"],["label","WIC modules"],["label","Idle-PC"],["matInput","","type","text","placeholder","Idle-PC",3,"input","value"],["mat-button","",1,"ios-add__action-btn",3,"click"],[1,"ios-add__actions"],["mat-button","",1,"ios-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"ios-add__submit-btn",3,"click"],["placeholder","Chassis",3,"selectionChange","value"],[1,"ios-add__checkbox",3,"change","checked"],[3,"selectionChange","placeholder","value"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,Mre,3,0,"button",3),s(3,"h1",4),d(4,"New IOS router template"),l()(),A(5,zre,68,17,"main",5),l()),t&2&&(m(2),O(o.controller()?2:-1),m(3),O(o.iosTemplate()?5:-1))},dependencies:[ne,Xe,dt,ie,de,W,pe,je,Mt,io,xo,ho,we,Me,et,Mi,Se,Ee,vt,At,_t,ul,Hl,Ul,sl,Ac],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ios-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ios-add__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ios-add__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ios-add__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ios-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ios-add__stepper-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.ios-add__stepper[_ngcontent-%COMP%]{background:transparent}.ios-add__step-content[_ngcontent-%COMP%]{padding:16px 24px 24px;display:flex;flex-direction:column;gap:16px}.ios-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.ios-add__radio[_ngcontent-%COMP%]{font-size:16px}.ios-add__file-input[_ngcontent-%COMP%]{display:none}.ios-add__upload-btn[_ngcontent-%COMP%]{align-self:flex-start}.ios-add__or-text[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant)}.ios-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ios-add__field[_ngcontent-%COMP%]{width:100%}.ios-add__checkbox[_ngcontent-%COMP%]{margin-top:8px}.ios-add__ram-link[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-primary)}.ios-add__ram-link[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--mat-sys-primary);text-decoration:none}.ios-add__ram-link[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.ios-add__adapters[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}.ios-add__action-btn[_ngcontent-%COMP%]{align-self:flex-start;text-transform:none}.ios-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.ios-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.ios-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ios-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ios-add__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ios-add__title[_ngcontent-%COMP%]{font-size:24px}.ios-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ios-add__step-content[_ngcontent-%COMP%]{padding:12px 16px 20px}.ios-add__adapters[_ngcontent-%COMP%]{grid-template-columns:1fr}.ios-add__actions[_ngcontent-%COMP%]{flex-direction:column}.ios-add__cancel-btn[_ngcontent-%COMP%], .ios-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();function jre(n,i){if(n&1){let e=z();s(0,"button",12),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var bx=(()=>{class n{route=f(lt);controllerService=f(Je);iosService=f(ps);toasterService=f(te);router=f(ht);formBuilder=f(Vn);cd=f(Q);controller;templateName="";iosTemplate;formGroup;constructor(){this.formGroup=this.formBuilder.group({templateName:new Ye("",Ue.required)})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.iosService.getTemplate(this.controller,t).subscribe({next:r=>{this.iosTemplate=r,this.templateName=`Copy of ${this.iosTemplate.name}`,this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","dynamips","templates"])}addTemplate(){this.formGroup.invalid?this.toasterService.error("Fill all required fields"):(this.iosTemplate.template_id=Ai(),this.iosTemplate.name=this.formGroup.get("templateName").value,this.iosService.addTemplate(this.controller,this.iosTemplate).subscribe({next:e=>{this.goBack()},error:e=>{let t=e.error?.message||e.message||"Failed to copy ios template";this.toasterService.error(t),this.cd.markForCheck()}}))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-copy-ios-template"]],decls:17,vars:2,consts:[[1,"ios-copy"],[1,"ios-copy__header"],["mat-icon-button","",1,"ios-copy__back-btn"],[1,"ios-copy__title"],[1,"ios-copy__content"],[1,"ios-copy__form-card"],[1,"ios-copy__form",3,"formGroup"],["appearance","fill",1,"ios-copy__field"],["matInput","","type","text","placeholder","Name","formControlName","templateName"],[1,"ios-copy__actions"],["mat-button","",1,"ios-copy__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"ios-copy__submit-btn",3,"click"],["mat-icon-button","",1,"ios-copy__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,jre,3,0,"button",2),s(3,"h1",3),d(4,"Copy IOS router template"),l()(),s(5,"main",4)(6,"section",5)(7,"form",6)(8,"mat-form-field",7)(9,"mat-label"),d(10,"Template name"),l(),R(11,"input",8),l()()(),s(12,"div",9)(13,"button",10),g("click",function(){return o.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),g("click",function(){return o.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(5),C("formGroup",o.formGroup))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,dt,ie,de,W,pe,je,Mt,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ios-copy__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ios-copy__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ios-copy__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ios-copy__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ios-copy__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ios-copy__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.ios-copy__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ios-copy__field[_ngcontent-%COMP%]{width:100%}.ios-copy__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.ios-copy__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.ios-copy__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ios-copy__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ios-copy__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ios-copy__title[_ngcontent-%COMP%]{font-size:24px}.ios-copy__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ios-copy__form-card[_ngcontent-%COMP%]{padding:16px}.ios-copy__actions[_ngcontent-%COMP%]{flex-direction:column}.ios-copy__cancel-btn[_ngcontent-%COMP%], .ios-copy__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var $re=()=>["c1700","c2600","c2691","c3600","c3725","c3745"],Hre=()=>[0,1,2,3,4,5,6],Ure=()=>[0,1,2];function Gre(n,i){if(n&1){let e=z();s(0,"button",6),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Wre(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),j(e[0])}}function qre(n,i){if(n&1&&(s(0,"div",27)(1,"span",28),d(2,"Chassis"),l(),s(3,"span",29),d(4),l()()),n&2){let e=v(3);m(4),j(e.iosTemplate.chassis)}}function Qre(n,i){if(n&1){let e=z();s(0,"mat-chip",35),g("removed",function(){let o=k(e).$implicit,r=v(3);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",36),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function Xre(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function Kre(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function Yre(n,i){if(n&1){let e=z();s(0,"div",11)(1,"div",16)(2,"mat-form-field",17)(3,"mat-label"),d(4,"Template name"),l(),s(5,"input",18),g("input",function(o){k(e);let r=v(2);return T(r.templateName.set(o.target.value))}),l()(),s(6,"mat-form-field",17)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",19),g("input",function(o){k(e);let r=v(2);return T(r.defaultName.set(o.target.value))}),l()()(),s(10,"div",20)(11,"mat-form-field",21)(12,"mat-label"),d(13,"Category"),l(),s(14,"mat-select",22),g("valueChange",function(o){k(e);let r=v(2);return T(r.iosTemplate.category=o)}),Y(15,Wre,2,2,"mat-option",23,Ae),l()(),s(17,"mat-form-field",24)(18,"mat-label"),d(19,"Symbol"),l(),s(20,"input",25),g("input",function(o){k(e);let r=v(2);return T(r.symbol.set(o.target.value))}),l()(),s(21,"button",26),g("click",function(){k(e);let o=v(2);return T(o.chooseSymbol())}),d(22,"Choose symbol"),l()(),s(23,"div",27)(24,"span",28),d(25,"Platform"),l(),s(26,"span",29),d(27),l()(),A(28,qre,5,1,"div",27),s(29,"mat-form-field",17)(30,"mat-label"),d(31,"Tags"),l(),s(32,"mat-chip-grid",null,0),Y(34,Qre,4,1,"mat-chip",null,Ae),l(),s(36,"input",30),g("matChipInputTokenEnd",function(o){k(e);let r=v(2);return T(r.addTag(o))}),l()(),s(37,"mat-form-field",17)(38,"mat-label"),d(39,"IOS image path"),l(),s(40,"input",31),g("input",function(o){k(e);let r=v(2);return T(r.imagePath.set(o.target.value))}),l()(),s(41,"mat-form-field",17)(42,"mat-label"),d(43,"Initial startup-config"),l(),s(44,"input",32),g("input",function(o){k(e);let r=v(2);return T(r.initialConfig.set(o.target.value))}),l(),s(45,"mat-hint"),d(46,"Filename only (e.g. ios-startup-config.txt)"),l()(),s(47,"mat-form-field",17)(48,"mat-label"),d(49,"Initial private-config"),l(),s(50,"input",33),g("input",function(o){k(e);let r=v(2);return T(r.iosTemplate.private_config=o.target.value)}),l(),s(51,"mat-hint"),d(52,"Filename only (e.g. ios-private-config.txt)"),l()(),s(53,"div",16)(54,"mat-form-field",17)(55,"mat-label"),d(56,"Console type"),l(),s(57,"mat-select",22),g("valueChange",function(o){k(e);let r=v(2);return T(r.iosTemplate.console_type=o)}),Y(58,Xre,2,2,"mat-option",23,Ae),l()(),s(60,"mat-form-field",17)(61,"mat-label"),d(62,"Auxiliary console type"),l(),s(63,"mat-select",22),g("valueChange",function(o){k(e);let r=v(2);return T(r.iosTemplate.aux_type=o)}),Y(64,Kre,2,2,"mat-option",23,Ae),l()()(),s(66,"mat-checkbox",34),g("change",function(o){k(e);let r=v(2);return T(r.iosTemplate.console_auto_start=o.checked)}),d(67,"Auto start console"),l()()}if(n&2){let e=Pe(33),t=v(2);m(5),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.iosTemplate.category),m(),Z(t.categories),m(5),C("value",t.symbol()),m(7),j(t.iosTemplate.platform),m(),O(t.iosTemplate.chassis?28:-1),m(6),Z(t.iosTemplate==null?null:t.iosTemplate.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.imagePath()),m(4),C("value",t.initialConfig()),m(6),C("value",t.iosTemplate.private_config),m(7),C("value",t.iosTemplate.console_type),m(),Z(t.consoleTypes),m(5),C("value",t.iosTemplate.aux_type),m(),Z(t.consoleTypes),m(2),C("checked",t.iosTemplate.console_auto_start)}}function Zre(n,i){if(n&1){let e=z();s(0,"mat-form-field",17)(1,"mat-label"),d(2,"I/O memory"),l(),s(3,"input",45),g("input",function(o){k(e);let r=v(3);return T(r.iomemory.set(o.target.value))}),l(),s(4,"mat-hint"),d(5,"Percentage of RAM for I/O memory"),l()()}if(n&2){let e=v(3);m(3),C("value",e.iomemory())}}function Jre(n,i){if(n&1){let e=z();s(0,"div",11)(1,"h6",37),d(2,"Memory"),l(),s(3,"div",38)(4,"mat-form-field",17)(5,"mat-label"),d(6,"RAM size"),l(),s(7,"input",39),g("input",function(o){k(e);let r=v(2);return T(r.ram.set(o.target.value))}),l(),s(8,"span",40),d(9,"MB"),l()(),s(10,"mat-form-field",17)(11,"mat-label"),d(12,"NVRAM size"),l(),s(13,"input",41),g("input",function(o){k(e);let r=v(2);return T(r.nvram.set(o.target.value))}),l(),s(14,"span",40),d(15,"KB"),l()(),A(16,Zre,6,1,"mat-form-field",17),l(),s(17,"h6",37),d(18,"Disk"),l(),s(19,"div",38)(20,"mat-form-field",17)(21,"mat-label"),d(22,"PCMCIA disk0"),l(),s(23,"input",42),g("input",function(o){k(e);let r=v(2);return T(r.disk0.set(o.target.value))}),l()(),s(24,"mat-form-field",17)(25,"mat-label"),d(26,"PCMCIA disk1"),l(),s(27,"input",43),g("input",function(o){k(e);let r=v(2);return T(r.disk1.set(o.target.value))}),l()()(),s(28,"mat-checkbox",44),d(29,"Automatically delete NVRAM and disk files"),l()()}if(n&2){let e=v(2);m(7),C("value",e.ram()),m(6),C("value",e.nvram()),m(3),O(Bt(5,$re).includes(e.iosTemplate.platform)?16:-1),m(7),C("value",e.disk0()),m(4),C("value",e.disk1())}}function eae(n,i){n&1&&(s(0,"mat-option",23),d(1),l()),n&2&&(m(),j(""))}function tae(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function nae(n,i){if(n&1){let e=z();s(0,"mat-form-field",17)(1,"mat-label"),d(2),l(),s(3,"mat-select",46),g("selectionChange",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.networkAdaptersForTemplate[r]=o.value)}),A(4,eae,2,1,"mat-option",23),Y(5,tae,2,2,"mat-option",23,Ae),l()()}if(n&2){let e=v().$implicit,t=v(3);m(2),ee("Slot ",e),m(),C("placeholder",Ui("Slot ",e))("value",t.networkAdaptersForTemplate[e]),m(),O(t.adapterMatrix[t.iosTemplate.platform][t.iosTemplate.chassis||""][e].length>1&&!t.adapterMatrix[t.iosTemplate.platform][t.iosTemplate.chassis||""][e][0].startsWith("C7200")?4:-1),m(),Z(t.adapterMatrix[t.iosTemplate.platform][t.iosTemplate.chassis||""][e])}}function iae(n,i){if(n&1&&A(0,nae,7,5,"mat-form-field",17),n&2){let e=i.$implicit,t=v(3);O(t.adapterMatrix[t.iosTemplate.platform]&&t.adapterMatrix[t.iosTemplate.platform][t.iosTemplate.chassis||""]&&t.adapterMatrix[t.iosTemplate.platform][t.iosTemplate.chassis||""][e]?0:-1)}}function oae(n,i){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function rae(n,i){if(n&1){let e=z();s(0,"mat-form-field",17)(1,"mat-label"),d(2),l(),s(3,"mat-select",46),g("selectionChange",function(o){k(e);let r=v().$implicit,a=v(4);return T(a.wicsForTemplate[r]=o.value)}),s(4,"mat-option",23),d(5),l(),Y(6,oae,2,2,"mat-option",23,Ae),l()()}if(n&2){let e=v().$implicit,t=v(4);m(2),ee("WIC ",e),m(),C("placeholder",Ui("WIC ",e))("value",t.wicsForTemplate[e]),m(2),j(""),m(),Z(t.wicMatrix[t.iosTemplate.platform][e])}}function aae(n,i){if(n&1&&A(0,rae,8,5,"mat-form-field",17),n&2){let e=i.$implicit,t=v(4);O(t.wicMatrix[t.iosTemplate.platform]&&t.wicMatrix[t.iosTemplate.platform][e]?0:-1)}}function sae(n,i){n&1&&(s(0,"h6",37),d(1,"WICs"),l(),s(2,"div",38),Y(3,aae,1,1,null,null,Ae),l()),n&2&&(m(3),Z(Bt(0,Ure)))}function lae(n,i){if(n&1&&(s(0,"div",11)(1,"h6",37),d(2,"Adapters"),l(),s(3,"div",38),Y(4,iae,1,1,null,null,Ae),l(),A(6,sae,5,1),l()),n&2){let e=v(2);m(4),Z(Bt(1,Hre)),m(2),O(e.wicMatrix[e.iosTemplate.platform]?6:-1)}}function cae(n,i){if(n&1){let e=z();s(0,"div",11)(1,"mat-form-field",17)(2,"mat-label"),d(3,"System ID"),l(),s(4,"input",47),g("input",function(o){k(e);let r=v(2);return T(r.systemId.set(o.target.value))}),l()(),s(5,"div",20)(6,"mat-form-field",24)(7,"mat-label"),d(8,"Base MAC (format: xxxx.xxxx.xxxx)"),l(),s(9,"input",48),g("input",function(o){k(e);let r=v(2);return T(r.baseMac.set(o.target.value))}),l(),s(10,"mat-hint"),d(11,"Example: aaaa.bbbb.cccc (leave empty to let the server allocate a MAC address)."),l()(),s(12,"button",49),g("click",function(){k(e);let o=v(2);return T(o.generateBaseMAC())}),d(13,"Generate Base MAC"),l()(),s(14,"div",20)(15,"mat-form-field",24)(16,"mat-label"),d(17,"Idle-PC"),l(),s(18,"input",50),g("input",function(o){k(e);let r=v(2);return T(r.idlepc.set(o.target.value))}),l()(),s(19,"button",49),g("click",function(){k(e);let o=v(2);return T(o.findIdlePC())}),d(20,"Idle-PC finder"),l()(),s(21,"div",51)(22,"mat-form-field",17)(23,"mat-label"),d(24,"Idlemax"),l(),s(25,"input",52),g("input",function(o){k(e);let r=v(2);return T(r.idlemax.set(o.target.value))}),l()(),s(26,"mat-form-field",17)(27,"mat-label"),d(28,"Idlesleep"),l(),s(29,"input",53),g("input",function(o){k(e);let r=v(2);return T(r.idlesleep.set(o.target.value))}),l()(),s(30,"mat-form-field",17)(31,"mat-label"),d(32,"Exec area"),l(),s(33,"input",54),g("input",function(o){k(e);let r=v(2);return T(r.execArea.set(o.target.value))}),l()()(),s(34,"div",16)(35,"mat-checkbox",34),g("change",function(o){k(e);let r=v(2);return T(r.mmap.set(o.checked))}),d(36,"Enable mmap support"),l(),s(37,"mat-checkbox",34),g("change",function(o){k(e);let r=v(2);return T(r.sparsemem.set(o.checked))}),d(38,"Enable sparse memory support"),l()()()}if(n&2){let e=v(2);m(4),C("value",e.systemId()),m(5),C("value",e.baseMac()),m(9),C("value",e.idlepc()),m(7),C("value",e.idlemax()),m(4),C("value",e.idlesleep()),m(4),C("value",e.execArea()),m(2),C("checked",e.mmap()),m(2),C("checked",e.sparsemem())}}function dae(n,i){if(n&1){let e=z();s(0,"div",12)(1,"mat-form-field",55)(2,"mat-label"),d(3,"Usage"),l(),s(4,"textarea",56),g("input",function(o){k(e);let r=v(2);return T(r.usage.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function mae(n,i){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("general"))}),s(3,"h3",9),d(4,"General settings"),l(),s(5,"mat-icon",10),d(6),l()(),A(7,Yre,68,14,"div",11),l(),s(8,"section",7)(9,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("memory"))}),s(10,"h3",9),d(11,"Memories and disks"),l(),s(12,"mat-icon",10),d(13),l()(),A(14,Jre,30,6,"div",11),l(),s(15,"section",7)(16,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("slots"))}),s(17,"h3",9),d(18,"Slots"),l(),s(19,"mat-icon",10),d(20),l()(),A(21,lae,7,2,"div",11),l(),s(22,"section",7)(23,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("advanced"))}),s(24,"h3",9),d(25,"Advanced"),l(),s(26,"mat-icon",10),d(27),l()(),A(28,cae,39,8,"div",11),l(),s(29,"section",7)(30,"div",8),g("click",function(){k(e);let o=v();return T(o.toggleSection("usage"))}),s(31,"h3",9),d(32,"Usage"),l(),s(33,"mat-icon",10),d(34),l()(),A(35,dae,5,1,"div",12),l(),s(36,"div",13)(37,"button",14),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(38,"Cancel"),l(),s(39,"button",15),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(40,"Save"),l()()()}if(n&2){let e=v();m(6),j(e.generalSettingsExpanded?"expand_less":"expand_more"),m(),O(e.generalSettingsExpanded?7:-1),m(6),j(e.memoryExpanded?"expand_less":"expand_more"),m(),O(e.memoryExpanded?14:-1),m(6),j(e.slotsExpanded?"expand_less":"expand_more"),m(),O(e.slotsExpanded?21:-1),m(6),j(e.advancedExpanded?"expand_less":"expand_more"),m(),O(e.advancedExpanded?28:-1),m(6),j(e.usageExpanded?"expand_less":"expand_more"),m(),O(e.usageExpanded?35:-1)}}var xx=(()=>{class n{route=f(lt);controllerService=f(Je);iosService=f(ps);toasterService=f(te);iosConfigurationService=f(Pm);progressService=f(no);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);validationService=f(P0);controller;iosTemplate;platforms=[];consoleTypes=[];categories=[];platformsWithEtherSwitchRouterOption={};platformsWithChassis={};chassis={};defaultRam={};defaultNvram={};networkAdaptersForTemplate=[];wicsForTemplate=[];adapterMatrix={};wicMatrix={};separatorKeysCodes=[13,188];generalSettingsExpanded=!1;memoryExpanded=!1;slotsExpanded=!1;advancedExpanded=!1;usageExpanded=!1;templateName=U("");defaultName=U("");symbol=U("");imagePath=U("");initialConfig=U("");ram=U("");nvram=U("");iomemory=U("");disk0=U("");disk1=U("");systemId=U("");idlemax=U("");idlesleep=U("");execArea=U("");idlepc=U("");baseMac=U("");mmap=U(!0);sparsemem=U(!0);usage=U("");ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.getConfiguration(),this.iosService.getTemplate(this.controller,t).subscribe({next:r=>{this.iosTemplate=r,this.iosTemplate.tags||(this.iosTemplate.tags=[]),this.fillSlotsData(),this.populateForms(),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}getConfiguration(){this.platforms=this.iosConfigurationService.getAvailablePlatforms(),this.platformsWithEtherSwitchRouterOption=this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption(),this.platformsWithChassis=this.iosConfigurationService.getPlatformsWithChassis(),this.chassis=this.iosConfigurationService.getChassis(),this.defaultRam=this.iosConfigurationService.getDefaultRamSettings(),this.consoleTypes=this.iosConfigurationService.getConsoleTypes(),this.categories=this.iosConfigurationService.getCategories(),this.adapterMatrix=this.iosConfigurationService.getAdapterMatrix(),this.wicMatrix=this.iosConfigurationService.getWicMatrix()}findIdlePC(){let e={image:this.iosTemplate.image,platform:this.iosTemplate.platform,ram:this.iosTemplate.ram};this.progressService.activate(),this.iosService.findIdlePC(this.controller,e).subscribe(t=>{this.progressService.deactivate(),t.idlepc!==null&&(this.iosTemplate.idlepc=t.idlepc,this.idlepc.set(t.idlepc),this.toasterService.success(`Idle-PC value found: ${t.idlepc}`))},t=>{this.progressService.deactivate(),this.toasterService.error("Error while finding an idle-PC value")})}generateBaseMAC(){let e="0123456789abcdef",t=new Uint8Array(6);crypto.getRandomValues(t);let o="";for(let r=0;r<3;r++){for(let a=0;a<4;a++){let c=r*2+Math.floor(a/2),p=a%2,u=t[c]>>p*4&15;o+=e[u]}r<2&&(o+=".")}this.iosTemplate.mac_addr=o,this.baseMac.set(o),this.toasterService.success(`Base MAC generated: ${o}`)}fillSlotsData(){for(let e=0;e<=6;e++)this.iosTemplate[`slot${e}`]&&(this.networkAdaptersForTemplate[e]=this.iosTemplate[`slot${e}`]);for(let e=0;e<=3;e++)this.iosTemplate[`wic${e}`]&&(this.wicsForTemplate[e]=this.iosTemplate[`wic${e}`])}populateForms(){this.templateName.set(this.iosTemplate.name||""),this.defaultName.set(this.iosTemplate.default_name_format||""),this.symbol.set(this.iosTemplate.symbol||""),this.imagePath.set(this.iosTemplate.image||""),this.initialConfig.set(this.iosTemplate.startup_config||""),this.ram.set(this.iosTemplate.ram?.toString()||""),this.nvram.set(this.iosTemplate.nvram?.toString()||""),this.iomemory.set(this.iosTemplate.iomem?.toString()||""),this.disk0.set(this.iosTemplate.disk0?.toString()||""),this.disk1.set(this.iosTemplate.disk1?.toString()||""),this.systemId.set(this.iosTemplate.system_id||""),this.idlemax.set(this.iosTemplate.idlemax?.toString()||""),this.idlesleep.set(this.iosTemplate.idlesleep?.toString()||""),this.execArea.set(this.iosTemplate.exec_area?.toString()||""),this.idlepc.set(this.iosTemplate.idlepc||""),this.baseMac.set(this.iosTemplate.mac_addr||""),this.mmap.set(this.iosTemplate.mmap??!0),this.sparsemem.set(this.iosTemplate.sparsemem??!0),this.usage.set(this.iosTemplate.usage||"")}saveSlotsData(){for(let e=0;e<=6;e++)this.adapterMatrix?.[this.iosTemplate.platform]?.[this.iosTemplate.chassis||""]?.[e]?this.networkAdaptersForTemplate[e]===void 0?this.iosTemplate[`slot${e}`]="":this.iosTemplate[`slot${e}`]=this.networkAdaptersForTemplate[e]:delete this.iosTemplate[`slot${e}`];for(let e=0;e<=3;e++)this.wicMatrix?.[this.iosTemplate.platform]?.[e]?this.wicsForTemplate[e]===void 0?this.iosTemplate[`wic${e}`]="":this.iosTemplate[`wic${e}`]=this.wicsForTemplate[e]:delete this.iosTemplate[`wic${e}`]}onSave(){let e=this.validationService.validateName(this.templateName());if(!e.isValid){this.toasterService.error(e.errorMessage);return}let t=this.validationService.validateImagePath(this.imagePath());if(!t.isValid){this.toasterService.error(t.errorMessage);return}let o=this.iosTemplate.platform,r=this.validationService.validateRamForPlatform(this.ram(),o);if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.validateNvramForPlatform(this.nvram(),o);if(!a.isValid){this.toasterService.error(a.errorMessage);return}let c=this.validationService.validateMacAddress(this.baseMac());if(!c.isValid){this.toasterService.error(c.errorMessage);return}let p=this.validationService.validateIdlepc(this.idlepc());if(!p.isValid){this.toasterService.error(p.errorMessage);return}this.saveSlotsData(),this.iosTemplate.name=this.templateName(),this.iosTemplate.default_name_format=this.defaultName(),this.iosTemplate.symbol=this.symbol(),this.iosTemplate.image=this.imagePath(),this.iosTemplate.startup_config=this.initialConfig(),this.iosTemplate.ram=parseInt(this.ram(),10)||0,this.iosTemplate.nvram=parseInt(this.nvram(),10)||0,this.iosTemplate.iomem=this.iomemory()?parseInt(this.iomemory(),10):void 0,this.iosTemplate.disk0=parseInt(this.disk0(),10)||0,this.iosTemplate.disk1=parseInt(this.disk1(),10)||0,this.iosTemplate.system_id=this.systemId(),this.iosTemplate.idlemax=parseInt(this.idlemax(),10)||0,this.iosTemplate.idlesleep=parseInt(this.idlesleep(),10)||0,this.iosTemplate.exec_area=parseInt(this.execArea(),10)||0,this.iosTemplate.idlepc=this.idlepc(),this.iosTemplate.mac_addr=this.baseMac(),this.iosTemplate.mmap=this.mmap(),this.iosTemplate.sparsemem=this.sparsemem(),this.iosTemplate.usage=this.usage(),this.iosService.saveTemplate(this.controller,this.iosTemplate).subscribe({next:()=>{this.toasterService.success("Changes saved")},error:u=>{let h=u.error?.message||u.message||"Failed to save template";this.toasterService.error(h),this.cd.markForCheck()}})}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","dynamips","templates"])}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.iosTemplate.symbol}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&(this.iosTemplate.symbol=o,this.symbol.set(o))})}addTag(e){let t=(e.value||"").trim();t&&this.iosTemplate&&(this.iosTemplate.tags||(this.iosTemplate.tags=[]),this.iosTemplate.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.iosTemplate.tags)return;let t=this.iosTemplate.tags.indexOf(e);t>=0&&this.iosTemplate.tags.splice(t,1)}toggleSection(e){switch(e){case"general":this.generalSettingsExpanded=!this.generalSettingsExpanded;break;case"memory":this.memoryExpanded=!this.memoryExpanded;break;case"slots":this.slotsExpanded=!this.slotsExpanded;break;case"advanced":this.advancedExpanded=!this.advancedExpanded;break;case"usage":this.usageExpanded=!this.usageExpanded;break}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ios-template-details"]],inputs:{templateName:[1,"templateName"],defaultName:[1,"defaultName"],symbol:[1,"symbol"],imagePath:[1,"imagePath"],initialConfig:[1,"initialConfig"],ram:[1,"ram"],nvram:[1,"nvram"],iomemory:[1,"iomemory"],disk0:[1,"disk0"],disk1:[1,"disk1"],systemId:[1,"systemId"],idlemax:[1,"idlemax"],idlesleep:[1,"idlesleep"],execArea:[1,"execArea"],idlepc:[1,"idlepc"],baseMac:[1,"baseMac"],mmap:[1,"mmap"],sparsemem:[1,"sparsemem"],usage:[1,"usage"]},outputs:{templateName:"templateNameChange",defaultName:"defaultNameChange",symbol:"symbolChange",imagePath:"imagePathChange",initialConfig:"initialConfigChange",ram:"ramChange",nvram:"nvramChange",iomemory:"iomemoryChange",disk0:"disk0Change",disk1:"disk1Change",systemId:"systemIdChange",idlemax:"idlemaxChange",idlesleep:"idlesleepChange",execArea:"execAreaChange",idlepc:"idlepcChange",baseMac:"baseMacChange",mmap:"mmapChange",sparsemem:"sparsememChange",usage:"usageChange"},decls:6,vars:2,consts:[["chipList",""],[1,"ios-details"],[1,"ios-details__header"],["mat-icon-button","",1,"ios-details__back-btn"],[1,"ios-details__title"],[1,"ios-details__content"],["mat-icon-button","",1,"ios-details__back-btn",3,"click"],[1,"ios-details__form-card"],[1,"ios-details__section-header",3,"click"],[1,"ios-details__section-title"],[1,"ios-details__expand-icon"],[1,"ios-details__form"],[1,"preferences__usage-form"],[1,"ios-details__actions"],["mat-button","",1,"ios-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"ios-details__save-btn",3,"click"],[1,"two-column-grid"],["appearance","fill",1,"ios-details__field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],[1,"ios-details__symbol-row"],["appearance","fill",1,"ios-details__field","ios-details__field--category"],[3,"valueChange","value"],[3,"value"],["appearance","fill",1,"ios-details__field","ios-details__field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"ios-details__symbol-btn",3,"click"],[1,"ios-details__info-row"],[1,"ios-details__info-label"],[1,"ios-details__info-value"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],["matInput","","type","text","placeholder","IOS image path",3,"input","value"],["matInput","","type","text","placeholder","Initial startup-config",3,"input","value"],["matInput","","type","text","placeholder","Initial private-config",3,"input","value"],[1,"ios-details__checkbox",3,"change","checked"],[3,"removed"],["matChipRemove",""],[1,"ios-details__section-subtitle"],[1,"ios-details__adapters"],["matInput","","type","text","min","32","step","32","placeholder","RAM size",3,"input","value"],["matSuffix",""],["matInput","","type","text","min","32","step","32","placeholder","NVRAM size",3,"input","value"],["matInput","","type","text","min","0","step","4","placeholder","PCMCIA disk0",3,"input","value"],["matInput","","type","text","min","0","step","4","placeholder","PCMCIA disk1",3,"input","value"],[1,"ios-details__checkbox"],["matInput","","type","text","min","0","max","100","step","5","placeholder","I/O memory",3,"input","value"],[3,"selectionChange","placeholder","value"],["matInput","","type","text","placeholder","System ID",3,"input","value"],["matInput","","type","text","placeholder","Base MAC",3,"input","value"],["mat-button","",1,"ios-details__action-btn",3,"click"],["matInput","","type","text","placeholder","Idle-PC",3,"input","value"],[1,"three-column-grid"],["matInput","","type","text","min","100","step","100","placeholder","Idlemax",3,"input","value"],["matInput","","type","text","min","1","step","10","placeholder","Idlesleep",3,"input","value"],["matInput","","type","text","min","0","step","4","placeholder","Exec area",3,"input","value"],["appearance","fill",1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,Gre,3,0,"button",3),s(3,"h1",4),d(4,"IOS router template configuration"),l()(),A(5,mae,41,10,"main",5),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.iosTemplate?5:-1))},dependencies:[ne,Xe,dt,ti,Jn,vi,Ci,mi,we,Me,et,MC,Mi,Se,Ee,vt,At,_t,W,pe,je,ie,de,cl,Ot,Gt],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ios-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ios-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ios-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ios-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ios-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ios-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.ios-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px}.ios-details__section-header[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s ease;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.ios-details__section-header[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.ios-details__section-title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.ios-details__expand-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:transform .2s ease}.ios-details__form[_ngcontent-%COMP%]{padding:16px 24px 24px;display:flex;flex-direction:column;gap:16px}.ios-details__form[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:16px}.ios-details__form[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%] .grid-span-2[_ngcontent-%COMP%]{grid-column:1/-1}.ios-details__field[_ngcontent-%COMP%]{width:100%}.ios-details__field--flex[_ngcontent-%COMP%]{flex:1}.ios-details__field--category[_ngcontent-%COMP%]{flex:0 0 150px}.three-column-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}.ios-details__field--full[_ngcontent-%COMP%]{width:100%;padding:0 24px 24px}.ios-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.ios-details__symbol-btn[_ngcontent-%COMP%], .ios-details__action-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.ios-details__info-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:8px 0}.ios-details__info-label[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface-variant);min-width:100px}.ios-details__info-value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.ios-details__section-subtitle[_ngcontent-%COMP%]{font-size:12px;font-weight:600;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px;margin:8px 0}.ios-details__adapters[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.ios-details__checkbox[_ngcontent-%COMP%]{margin-top:8px}.ios-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.ios-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.ios-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ios-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ios-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ios-details__title[_ngcontent-%COMP%]{font-size:22px}.ios-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ios-details__section-header[_ngcontent-%COMP%]{padding:12px 16px}.ios-details__form[_ngcontent-%COMP%]{padding:16px}.ios-details__field--full[_ngcontent-%COMP%]{padding:0 16px 16px}.ios-details__symbol-row[_ngcontent-%COMP%]{flex-direction:column}.ios-details__symbol-btn[_ngcontent-%COMP%], .ios-details__action-btn[_ngcontent-%COMP%]{width:100%}.ios-details__adapters[_ngcontent-%COMP%]{grid-template-columns:1fr}.ios-details__actions[_ngcontent-%COMP%]{flex-direction:column}.ios-details__cancel-btn[_ngcontent-%COMP%], .ios-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var pae=(n,i)=>i.template_id;function uae(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences")}}function hae(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/dynamips/templates/addtemplate")}}function fae(n,i){n&1&&R(0,"app-empty-templates-list")}function gae(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"router"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(11,"mat-icon"),d(12,"delete"),l(),s(13,"span"),d(14,"Delete"),l()(),s(15,"button",15),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.copyTemplate(o))}),s(16,"mat-icon"),d(17,"content_copy"),l(),s(18,"span"),d(19,"Copy"),l()(),s(20,"a",16)(21,"mat-icon"),d(22,"edit"),l(),s(23,"span"),d(24,"Edit"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(15),C("routerLink",e.template_id)}}function _ae(n,i){if(n&1&&(s(0,"nav",8),Y(1,gae,25,4,"div",10,pae),l()),n&2){let e=v();m(),Z(e.iosTemplates)}}var yx=(()=>{class n{route=f(lt);controllerService=f(Je);iosService=f(ps);toasterService=f(te);router=f(ht);cd=f(Q);controller;iosTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.iosService.getTemplates(this.controller).subscribe({next:e=>{this.iosTemplates=e.filter(t=>t.template_type==="dynamips"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}copyTemplate(e){this.router.navigate(["/controller",this.controller.id,"preferences","dynamips","templates",e.template_id,"copy"])}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ios-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"ios-templates"],[1,"ios-templates__header"],["mat-icon-button","",1,"ios-templates__back-btn",3,"routerLink"],[1,"ios-templates__title"],["matTooltip","Add IOS router template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"ios-templates__add-btn",3,"routerLink"],[1,"ios-templates__content"],[1,"ios-templates__list"],[3,"deleteEvent","controller"],[1,"ios-templates__list-item",3,"routerLink"],[1,"ios-templates__list-icon"],[1,"ios-templates__list-name"],["mat-icon-button","",1,"ios-templates__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,uae,3,1,"button",4),s(3,"h1",5),d(4,"IOS router templates"),l(),A(5,hae,3,1,"button",6),l(),s(6,"main",7),A(7,fae,1,0,"app-empty-templates-list"),A(8,_ae,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.iosTemplates.length?-1:7),m(),O(o.iosTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.ios-templates__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.ios-templates__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.ios-templates__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.ios-templates__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.ios-templates__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.ios-templates__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.ios-templates__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.ios-templates__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.ios-templates__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.ios-templates__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.ios-templates__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.ios-templates__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.ios-templates__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.ios-templates__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.ios-templates__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.ios-templates__back-btn[_ngcontent-%COMP%], .ios-templates__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.ios-templates__title[_ngcontent-%COMP%]{font-size:24px}.ios-templates__content[_ngcontent-%COMP%]{padding:0 16px 16px}.ios-templates__list-item[_ngcontent-%COMP%]{padding:14px 16px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Im=class{builtin;category;compute_id;console_auto_start;console_type;default_name_format;ethernet_adapters;l1_keepalives;name;nvram;path;private_config;ram;serial_adapters;startup_config;symbol;template_id;template_type;usage;use_default_iou_values;tags};var us=(()=>{class n{httpController;constructor(e){this.httpController=e}getTemplates(e){return this.httpController.get(e,"/templates")}getTemplate(e,t){return this.httpController.get(e,`/templates/${t}`)}getImages(e){return this.httpController.get(e,"/images?image_type=iou")}getImagePath(e,t){return`${e.protocol}//${e.host}:${e.port}/${wi.current_version}/images/upload/${t}`}addTemplate(e,t){return this.httpController.post(e,"/templates",t)}saveTemplate(e,t){return this.httpController.put(e,`/templates/${t.template_id}`,t)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var vae=(n,i)=>i.path;function Cae(n,i){if(n&1){let e=z();s(0,"button",23),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function bae(n,i){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function xae(n,i){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=i.$implicit;C("value",e.path),m(),ee(" ",e.path," ")}}function yae(n,i){if(n&1){let e=z();s(0,"mat-form-field",13)(1,"mat-label"),d(2,"IOU image"),l(),s(3,"mat-select",24),g("selectionChange",function(o){k(e);let r=v();return T(r.iouTemplate.update(a=>it(K({},a),{path:o.value})))}),Y(4,xae,2,2,"mat-option",18,vae),l()()}if(n&2){let e=v();m(3),C("value",e.iouTemplate().path),m(),Z(e.iouImages())}}function Sae(n,i){if(n&1){let e=z();s(0,"div",19)(1,"input",25,0),g("change",function(o){k(e);let r=v();return T(r.uploadImageFile(o))}),l(),s(3,"button",26),g("click",function(){k(e);let o=Pe(2);return T(o.click())}),d(4," Browse "),l(),s(5,"mat-form-field",27)(6,"mat-label"),d(7,"IOU image"),l(),s(8,"input",28),g("input",function(o){k(e);let r=v();return T(r.imageName.set(o.target.value))}),l()()()}if(n&2){let e=v();m(),C("uploader",e.uploader()),m(7),C("value",e.imageName())}}var Sx=(()=>{class n{route=f(lt);controllerService=f(Je);iouService=f(us);toasterService=f(te);router=f(ht);templateMocksService=f(xa);computeService=f(ko);uploadServiceService=f(hl);snackBar=f(vr);cd=f(Q);controller=ae(void 0);iouTemplate=ae(new Im);newImageSelected=ae(!1);types=ae(["L2 image","L3 image"]);iouImages=ae([]);uploader=ae(void 0);isLocalComputerChosen=ae(!0);subscription;templateName=U("");imageName=U("");selectedType=U("");nameStepCompleted=Jt(()=>!!this.templateName());ngOnInit(){this.uploader.set(new $a({url:""})),this.uploader().onAfterAddingFile=t=>{t.withCredentials=!1},this.uploader().onErrorItem=(t,o,r,a)=>{this.toasterService.error("An error occured: "+o)},this.uploader().onProgressItem=t=>{this.uploadServiceService.processBarCount(t.progress)},this.uploader().onSuccessItem=(t,o,r,a)=>{this.getImages(),this.toasterService.success("Image uploaded")};let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller.set(t),this.getImages(),this.templateMocksService.getIouTemplate().subscribe({next:o=>{this.iouTemplate.set(o)},error:()=>{this.toasterService.error("Failed to load IOU template"),this.cd.markForCheck()}})},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()}),this.subscription=this.uploadServiceService.currentCancelItemDetails.subscribe(t=>{t&&this.cancelUploading()})}getImages(){this.iouService.getImages(this.controller()).subscribe({next:e=>{this.iouImages.set(e)},error:e=>{let t=e.error?.message||e.message||"Failed to load IOU images";this.toasterService.error(t),this.cd.markForCheck()}})}setControllerType(e){e==="local"&&this.isLocalComputerChosen.set(!0)}setDiskImage(e){this.newImageSelected.set(e==="newImage")}uploadImageFile(e){let t=e.target.files[0].name;this.imageName.set(t);let o=this.iouService.getImagePath(this.controller(),t);this.uploader().queue.forEach(a=>a.url=o);let r=this.uploader().queue[0];r.options&&(r.options.disableMultipart=!0),r.options.headers=[{name:"Authorization",value:"Bearer "+this.controller().authToken}],this.uploader().uploadItem(r),this.snackBar.openFromComponent(fl,{panelClass:"uplaoding-file-snackabar",data:{upload_file_type:"Image"}})}cancelUploading(){this.uploader().clearQueue(),this.uploadServiceService.processBarCount(100),this.toasterService.warning("File upload cancelled")}goBack(){this.router.navigate(["/controller",this.controller().id,"preferences","iou","templates"])}addTemplate(){if(this.templateName()&&(this.newImageSelected()&&this.imageName()||!this.newImageSelected()&&this.iouTemplate().path)){let e=this.iouTemplate();e.template_id=Ai(),e.name=this.templateName(),this.newImageSelected()&&(e.path=this.imageName()),e.compute_id="local",this.selectedType()==="L2 image"?(e.ethernet_adapters=4,e.serial_adapters=0):this.selectedType()==="L3 image"&&(e.ethernet_adapters=2,e.serial_adapters=2),this.iouService.addTemplate(this.controller(),e).subscribe({next:t=>{this.goBack()},error:t=>{let o=t.error?.message||t.message||"Failed to add iou template";this.toasterService.error(o),this.cd.markForCheck()}})}else this.toasterService.error("Fill all required fields")}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-iou-template"]],inputs:{templateName:[1,"templateName"],imageName:[1,"imageName"],selectedType:[1,"selectedType"]},outputs:{templateName:"templateNameChange",imageName:"imageNameChange",selectedType:"selectedTypeChange"},decls:38,vars:11,consts:[["file",""],[1,"iou-add"],[1,"iou-add__header"],["mat-icon-button","",1,"iou-add__back-btn"],[1,"iou-add__title"],[1,"iou-add__content"],[1,"iou-add__form-card"],[1,"iou-add__stepper",3,"linear"],["label","Controller type",3,"completed"],[1,"iou-add__radio-group"],["value","1",1,"iou-add__radio",3,"click","checked"],["label","Name",3,"completed"],[1,"iou-add__form"],["appearance","fill",1,"iou-add__field"],["matInput","","placeholder","Name","type","text",3,"input","value"],["label","Image"],["value","2",1,"iou-add__radio",3,"click","checked"],["placeholder","Type",3,"selectionChange","value"],[3,"value"],[1,"iou-add__file-row"],[1,"iou-add__actions"],["mat-button","",1,"iou-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"iou-add__submit-btn",3,"click"],["mat-icon-button","",1,"iou-add__back-btn",3,"click"],["placeholder","IOU image",3,"selectionChange","value"],["type","file","accept",".bin, .image, .iol","ng2FileSelect","",1,"iou-add__file-input",3,"change","uploader"],["mat-raised-button","","color","primary",1,"iou-add__browse-btn",3,"click"],["appearance","fill",1,"iou-add__field","iou-add__field--flex"],["matInput","","type","text","placeholder","IOU image",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,Cae,3,0,"button",3),s(3,"h1",4),d(4,"New IOU device template"),l()(),s(5,"main",5)(6,"section",6)(7,"mat-vertical-stepper",7)(8,"mat-step",8)(9,"mat-radio-group",9)(10,"mat-radio-button",10),g("click",function(){return o.setControllerType("local")}),d(11," Run this IOU device locally "),l()()(),s(12,"mat-step",11)(13,"div",12)(14,"mat-form-field",13)(15,"mat-label"),d(16,"Template name"),l(),s(17,"input",14),g("input",function(a){return o.templateName.set(a.target.value)}),l()()()(),s(18,"mat-step",15)(19,"div",12)(20,"mat-radio-group",9)(21,"mat-radio-button",10),g("click",function(){return o.setDiskImage("existingImage")}),d(22," Existing image "),l(),s(23,"mat-radio-button",16),g("click",function(){return o.setDiskImage("newImage")}),d(24," New image "),l()(),s(25,"mat-form-field",13)(26,"mat-label"),d(27,"Type"),l(),s(28,"mat-select",17),g("selectionChange",function(a){return o.selectedType.set(a.value)}),Y(29,bae,2,2,"mat-option",18,Ae),l()(),A(31,yae,6,1,"mat-form-field",13),A(32,Sae,9,2,"div",19),l()()()(),s(33,"div",20)(34,"button",21),g("click",function(){return o.goBack()}),d(35,"Cancel"),l(),s(36,"button",22),g("click",function(){return o.addTemplate()}),d(37," Add template "),l()()()()),t&2&&(m(2),O(o.controller()?2:-1),m(5),C("linear",!0),m(),C("completed",o.isLocalComputerChosen()),m(2),C("checked",!0),m(2),C("completed",o.nameStepCompleted()),m(5),C("value",o.templateName()),m(4),C("checked",!o.newImageSelected()),m(2),C("checked",o.newImageSelected()),m(5),C("value",o.selectedType()),m(),Z(o.types()),m(2),O(o.newImageSelected()?-1:31),m(),O(o.newImageSelected()?32:-1))},dependencies:[ne,Xe,dt,ie,de,W,pe,je,Mt,io,xo,ho,we,Me,et,Se,Ee,vt,At,_t,ul,Hl,Ul,sl,Ac],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.iou-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.iou-add__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.iou-add__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.iou-add__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.iou-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.iou-add__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.iou-add__stepper[_ngcontent-%COMP%]{background:transparent}.iou-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.iou-add__radio[_ngcontent-%COMP%]{font-size:16px}.iou-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.iou-add__field[_ngcontent-%COMP%]{width:100%}.iou-add__field--flex[_ngcontent-%COMP%]{flex:1}.iou-add__file-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.iou-add__file-input[_ngcontent-%COMP%]{display:none}.iou-add__browse-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.iou-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.iou-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.iou-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.iou-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.iou-add__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.iou-add__title[_ngcontent-%COMP%]{font-size:24px}.iou-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.iou-add__form-card[_ngcontent-%COMP%]{padding:16px}.iou-add__file-row[_ngcontent-%COMP%], .iou-add__actions[_ngcontent-%COMP%]{flex-direction:column}.iou-add__cancel-btn[_ngcontent-%COMP%], .iou-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();function wae(n,i){if(n&1){let e=z();s(0,"button",12),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var wx=(()=>{class n{route=f(lt);controllerService=f(Je);iouService=f(us);toasterService=f(te);router=f(ht);formBuilder=f(Vn);cd=f(Q);controller;templateName="";iouTemplate;templateNameForm;constructor(){this.templateNameForm=this.formBuilder.group({templateName:new Ye("",Ue.required)})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.iouService.getTemplate(this.controller,t).subscribe({next:r=>{this.iouTemplate=r,this.templateName=`Copy of ${this.iouTemplate.name}`,this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load IOU template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","iou","templates"])}addTemplate(){this.templateNameForm.invalid?this.toasterService.error("Fill all required fields"):(this.iouTemplate.template_id=Ai(),this.iouTemplate.name=this.templateNameForm.get("templateName").value,this.iouService.addTemplate(this.controller,this.iouTemplate).subscribe({next:e=>{this.goBack()},error:e=>{let t=e.error?.message||e.message||"Failed to copy iou template";this.toasterService.error(t),this.cd.markForCheck()}}))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-copy-iou-template"]],decls:17,vars:2,consts:[[1,"iou-copy"],[1,"iou-copy__header"],["mat-icon-button","",1,"iou-copy__back-btn"],[1,"iou-copy__title"],[1,"iou-copy__content"],[1,"iou-copy__form-card"],[1,"iou-copy__form",3,"formGroup"],["appearance","fill",1,"iou-copy__field"],["matInput","","type","text","placeholder","Name","formControlName","templateName"],[1,"iou-copy__actions"],["mat-button","",1,"iou-copy__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"iou-copy__submit-btn",3,"click"],["mat-icon-button","",1,"iou-copy__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,wae,3,0,"button",2),s(3,"h1",3),d(4,"Copy IOU device template"),l()(),s(5,"main",4)(6,"section",5)(7,"form",6)(8,"mat-form-field",7)(9,"mat-label"),d(10,"Template name"),l(),R(11,"input",8),l()()(),s(12,"div",9)(13,"button",10),g("click",function(){return o.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),g("click",function(){return o.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(5),C("formGroup",o.templateNameForm))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,dt,ie,de,W,pe,je,Mt,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.iou-copy__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.iou-copy__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.iou-copy__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.iou-copy__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.iou-copy__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.iou-copy__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.iou-copy__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.iou-copy__field[_ngcontent-%COMP%]{width:100%}.iou-copy__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.iou-copy__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.iou-copy__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.iou-copy__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.iou-copy__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.iou-copy__title[_ngcontent-%COMP%]{font-size:24px}.iou-copy__content[_ngcontent-%COMP%]{padding:0 16px 16px}.iou-copy__form-card[_ngcontent-%COMP%]{padding:16px}.iou-copy__actions[_ngcontent-%COMP%]{flex-direction:column}.iou-copy__cancel-btn[_ngcontent-%COMP%], .iou-copy__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var ef=(()=>{class n{getConsoleTypes(){return["telnet","ssh","none"]}getCategories(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function Mae(n,i){if(n&1){let e=z();s(0,"button",7),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function kae(n,i){if(n&1&&(s(0,"mat-option",24),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),j(e[0])}}function Tae(n,i){if(n&1){let e=z();s(0,"mat-chip",36),g("removed",function(){let o=k(e).$implicit,r=v(3);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",37),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function Eae(n,i){if(n&1&&(s(0,"mat-option",24),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Dae(n,i){if(n&1){let e=z();s(0,"div",17)(1,"mat-form-field",18)(2,"mat-label"),d(3,"RAM size"),l(),s(4,"input",38),g("input",function(o){k(e);let r=v(3);return T(r.ram.set(+o.target.value))}),l(),s(5,"span",39),d(6,"MB"),l()(),s(7,"mat-form-field",18)(8,"mat-label"),d(9,"NVRAM size"),l(),s(10,"input",40),g("input",function(o){k(e);let r=v(3);return T(r.nvram.set(+o.target.value))}),l(),s(11,"span",39),d(12,"KB"),l()()()}if(n&2){let e=v(3);m(4),C("value",e.ram()),m(6),C("value",e.nvram())}}function Pae(n,i){if(n&1){let e=z();s(0,"form",12)(1,"div",17)(2,"mat-form-field",18)(3,"mat-label"),d(4,"Template name"),l(),s(5,"input",19),g("input",function(o){k(e);let r=v(2);return T(r.templateName.set(o.target.value))}),l()(),s(6,"mat-form-field",18)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",20),g("input",function(o){k(e);let r=v(2);return T(r.defaultName.set(o.target.value))}),l()()(),s(10,"div",21)(11,"mat-form-field",22)(12,"mat-label"),d(13,"Category"),l(),s(14,"mat-select",23),g("selectionChange",function(o){k(e);let r=v(2);return T(r.category.set(o.value))}),Y(15,kae,2,2,"mat-option",24,Hi),l()(),s(17,"mat-form-field",25)(18,"mat-label"),d(19,"Symbol"),l(),s(20,"input",26),g("input",function(o){k(e);let r=v(2);return T(r.symbol.set(o.target.value))}),l()(),s(21,"button",27),g("click",function(){k(e);let o=v(2);return T(o.chooseSymbol())}),d(22,"Choose symbol"),l()(),s(23,"mat-form-field",18)(24,"mat-label"),d(25,"Tags"),l(),s(26,"mat-chip-grid",null,0),Y(28,Tae,4,1,"mat-chip",null,Ae),l(),s(30,"input",28),g("matChipInputTokenEnd",function(o){k(e);let r=v(2);return T(r.addTag(o))}),l()(),s(31,"div",29)(32,"input",30,1),g("change",function(o){k(e);let r=v(2);return T(r.uploadImageFile(o))}),l(),s(34,"button",31),g("click",function(){k(e);let o=Pe(33);return T(o.click())}),d(35," Browse "),l(),s(36,"mat-form-field",25)(37,"mat-label"),d(38,"IOU image path"),l(),s(39,"input",32),g("input",function(o){k(e);let r=v(2);return T(r.path.set(o.target.value))}),l()()(),s(40,"mat-form-field",18)(41,"mat-label"),d(42,"Startup config"),l(),s(43,"input",33),g("input",function(o){k(e);let r=v(2);return T(r.initialConfig.set(o.target.value))}),l()(),s(44,"mat-form-field",18)(45,"mat-label"),d(46,"Private config"),l(),s(47,"input",34),g("input",function(o){k(e);let r=v(2);return T(r.privateConfig.set(o.target.value))}),l()(),s(48,"mat-form-field",18)(49,"mat-label"),d(50,"Console type"),l(),s(51,"mat-select",23),g("selectionChange",function(o){k(e);let r=v(2);return T(r.consoleType.set(o.value))}),Y(52,Eae,2,2,"mat-option",24,Ae),l()(),s(54,"mat-checkbox",35),g("change",function(o){k(e);let r=v(2);return T(r.consoleAutoStart.set(o.checked))}),d(55," Auto start console "),l(),s(56,"mat-checkbox",35),g("change",function(o){k(e);let r=v(2);return T(r.l1Keepalives.set(o.checked))}),d(57," Enable layer 1 keepalive messages (non-functional) "),l(),s(58,"mat-checkbox",35),g("change",function(o){k(e);let r=v(2);return T(r.useDefaultIouValues.set(o.checked))}),d(59," Use default IOU values for memories "),l(),A(60,Dae,13,2,"div",17),l()}if(n&2){let e=Pe(27),t=v(2);m(5),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.category()),m(),Z(t.categories),m(5),C("value",t.symbol()),m(8),Z(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(9),C("value",t.path()),m(4),C("value",t.initialConfig()),m(4),C("value",t.privateConfig()),m(4),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(2),C("checked",t.l1Keepalives()),m(2),C("checked",t.useDefaultIouValues()),m(2),O(t.useDefaultIouValues()?-1:60)}}function Iae(n,i){if(n&1){let e=z();s(0,"form",12)(1,"mat-form-field",18)(2,"mat-label"),d(3,"Ethernet adapters"),l(),s(4,"input",41),g("input",function(o){k(e);let r=v(2);return T(r.ethernetAdapters.set(+o.target.value))}),l()(),s(5,"mat-form-field",18)(6,"mat-label"),d(7,"Serial adapters"),l(),s(8,"input",42),g("input",function(o){k(e);let r=v(2);return T(r.serialAdapters.set(+o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.ethernetAdapters()),m(4),C("value",e.serialAdapters())}}function Aae(n,i){if(n&1){let e=z();s(0,"div",13)(1,"mat-form-field",43)(2,"mat-label"),d(3,"Usage notes"),l(),s(4,"textarea",44),g("input",function(o){k(e);let r=v(2);return T(r.usage.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function Oae(n,i){if(n&1){let e=z();s(0,"main",6)(1,"section",8)(2,"div",9),g("click",function(){k(e);let o=v();return T(o.toggleSection("general"))}),s(3,"h3",10),d(4,"General settings"),l(),s(5,"mat-icon",11),d(6),l()(),A(7,Pae,61,14,"form",12),l(),s(8,"section",8)(9,"div",9),g("click",function(){k(e);let o=v();return T(o.toggleSection("network"))}),s(10,"h3",10),d(11,"Network"),l(),s(12,"mat-icon",11),d(13),l()(),A(14,Iae,9,2,"form",12),l(),s(15,"section",8)(16,"div",9),g("click",function(){k(e);let o=v();return T(o.toggleSection("usage"))}),s(17,"h3",10),d(18,"Usage"),l(),s(19,"mat-icon",11),d(20),l()(),A(21,Aae,5,1,"div",13),l(),s(22,"div",14)(23,"button",15),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(24,"Cancel"),l(),s(25,"button",16),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(26,"Save"),l()()()}if(n&2){let e=v();m(6),j(e.generalSettingsExpanded()?"expand_less":"expand_more"),m(),O(e.generalSettingsExpanded()?7:-1),m(6),j(e.networkExpanded()?"expand_less":"expand_more"),m(),O(e.networkExpanded()?14:-1),m(6),j(e.usageExpanded()?"expand_less":"expand_more"),m(),O(e.usageExpanded()?21:-1)}}var Mx=(()=>{class n{route=f(lt);controllerService=f(Je);iouService=f(us);toasterService=f(te);configurationService=f(ef);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);validationService=f(I0);controller;iouTemplate;separatorKeysCodes=[13,188];consoleTypes=[];categories=[];templateName=U("");defaultName=U("");symbol=U("");path=U("");initialConfig=U("");privateConfig=U("");category=U("");consoleType=U("");consoleAutoStart=U(!1);l1Keepalives=U(!1);useDefaultIouValues=U(!1);ram=U(256);nvram=U(128);ethernetAdapters=U(0);serialAdapters=U(0);usage=U("");tags=U([]);generalSettingsExpanded=U(!1);networkExpanded=U(!1);usageExpanded=U(!1);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.getConfiguration(),this.iouService.getTemplate(this.controller,t).subscribe({next:r=>{this.iouTemplate=r,this.iouTemplate.tags||(this.iouTemplate.tags=[]),this.templateName.set(r.name||""),this.defaultName.set(r.default_name_format||""),this.symbol.set(r.symbol||""),this.path.set(r.path||""),this.initialConfig.set(r.startup_config||""),this.privateConfig.set(r.private_config||""),this.category.set(r.category||""),this.consoleType.set(r.console_type||""),this.consoleAutoStart.set(r.console_auto_start||!1),this.l1Keepalives.set(r.l1_keepalives||!1),this.useDefaultIouValues.set(r.use_default_iou_values!==!1),this.ram.set(r.ram||256),this.nvram.set(r.nvram||128),this.ethernetAdapters.set(r.ethernet_adapters||0),this.serialAdapters.set(r.serial_adapters||0),this.usage.set(r.usage||""),this.tags.set(r.tags||[]),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load IOU template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}getConfiguration(){this.consoleTypes=this.configurationService.getConsoleTypes(),this.categories=this.configurationService.getCategories()}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","iou","templates"])}onSave(){let e=this.validationService.validateName(this.templateName());if(!e.isValid){this.toasterService.error(e.errorMessage);return}let t=this.validationService.validatePath(this.path());if(!t.isValid){this.toasterService.error(t.errorMessage);return}this.iouTemplate.name=this.templateName(),this.iouTemplate.default_name_format=this.defaultName(),this.iouTemplate.symbol=this.symbol(),this.iouTemplate.path=this.path(),this.iouTemplate.startup_config=this.initialConfig(),this.iouTemplate.private_config=this.privateConfig(),this.iouTemplate.category=this.category(),this.iouTemplate.console_type=this.consoleType(),this.iouTemplate.console_auto_start=this.consoleAutoStart(),this.iouTemplate.l1_keepalives=this.l1Keepalives(),this.iouTemplate.use_default_iou_values=this.useDefaultIouValues(),this.iouTemplate.ram=this.ram(),this.iouTemplate.nvram=this.nvram(),this.iouTemplate.ethernet_adapters=this.ethernetAdapters(),this.iouTemplate.serial_adapters=this.serialAdapters(),this.iouTemplate.usage=this.usage(),this.iouTemplate.tags=this.tags(),this.iouService.saveTemplate(this.controller,this.iouTemplate).subscribe({next:()=>{this.toasterService.success("Changes saved")},error:o=>{let r=o.error?.message||o.message||"Failed to save IOU template";this.toasterService.error(r),this.cd.markForCheck()}})}uploadImageFile(e){let t=e.target;t.files&&t.files.length>0&&this.path.set(t.files[0].name)}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.symbol()}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&this.symbol.set(o)})}addTag(e){let t=(e.value||"").trim(),o=this.tags();t&&this.tags.set([...o,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),o=t.indexOf(e);if(o>=0){let r=[...t];r.splice(o,1),this.tags.set(r)}}toggleSection(e){switch(e){case"general":this.generalSettingsExpanded.set(!this.generalSettingsExpanded());break;case"network":this.networkExpanded.set(!this.networkExpanded());break;case"usage":this.usageExpanded.set(!this.usageExpanded());break}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-iou-template-details"]],inputs:{templateName:[1,"templateName"],defaultName:[1,"defaultName"],symbol:[1,"symbol"],path:[1,"path"],initialConfig:[1,"initialConfig"],privateConfig:[1,"privateConfig"],category:[1,"category"],consoleType:[1,"consoleType"],consoleAutoStart:[1,"consoleAutoStart"],l1Keepalives:[1,"l1Keepalives"],useDefaultIouValues:[1,"useDefaultIouValues"],ram:[1,"ram"],nvram:[1,"nvram"],ethernetAdapters:[1,"ethernetAdapters"],serialAdapters:[1,"serialAdapters"],usage:[1,"usage"],tags:[1,"tags"],generalSettingsExpanded:[1,"generalSettingsExpanded"],networkExpanded:[1,"networkExpanded"],usageExpanded:[1,"usageExpanded"]},outputs:{templateName:"templateNameChange",defaultName:"defaultNameChange",symbol:"symbolChange",path:"pathChange",initialConfig:"initialConfigChange",privateConfig:"privateConfigChange",category:"categoryChange",consoleType:"consoleTypeChange",consoleAutoStart:"consoleAutoStartChange",l1Keepalives:"l1KeepalivesChange",useDefaultIouValues:"useDefaultIouValuesChange",ram:"ramChange",nvram:"nvramChange",ethernetAdapters:"ethernetAdaptersChange",serialAdapters:"serialAdaptersChange",usage:"usageChange",tags:"tagsChange",generalSettingsExpanded:"generalSettingsExpandedChange",networkExpanded:"networkExpandedChange",usageExpanded:"usageExpandedChange"},decls:6,vars:2,consts:[["chipList",""],["file",""],[1,"iou-template-details"],[1,"iou-template-details__header"],["mat-icon-button","",1,"iou-template-details__back-btn"],[1,"iou-template-details__title"],[1,"iou-template-details__content"],["mat-icon-button","",1,"iou-template-details__back-btn",3,"click"],[1,"iou-template-details__form-card"],[1,"iou-template-details__section-header",3,"click"],[1,"iou-template-details__section-title"],[1,"iou-template-details__expand-icon"],[1,"iou-template-details__form"],[1,"preferences__usage-form"],[1,"iou-template-details__actions"],["mat-button","",1,"iou-template-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"iou-template-details__save-btn",3,"click"],[1,"two-column-grid"],["appearance","fill",1,"iou-template-details__field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],[1,"iou-template-details__symbol-row"],["appearance","fill",1,"iou-template-details__field","iou-template-details__field--category"],[3,"selectionChange","value"],[3,"value"],["appearance","fill",1,"iou-template-details__field","iou-template-details__field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"iou-template-details__symbol-btn",3,"click"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"iou-template-details__file-row"],["type","file","accept",".bin, .image, .iol",1,"iou-template-details__file-input",3,"change"],["mat-raised-button","","color","primary",1,"iou-template-details__browse-btn",3,"click"],["matInput","","type","text","placeholder","IOU image path",3,"input","value"],["matInput","","type","text","placeholder","Startup config",3,"input","value"],["matInput","","type","text","placeholder","Private config",3,"input","value"],[3,"change","checked"],[3,"removed"],["matChipRemove",""],["matInput","","type","number","min","1","placeholder","RAM size",3,"input","value"],["matSuffix",""],["matInput","","type","number","min","1","placeholder","NVRAM size",3,"input","value"],["matInput","","type","number","placeholder","Ethernet adapters",3,"input","value"],["matInput","","type","number","placeholder","Serial adapters",3,"input","value"],["appearance","fill",1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,Mae,3,0,"button",4),s(3,"h1",5),d(4,"IOU device template configuration"),l()(),A(5,Oae,27,6,"main",6),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.iouTemplate?5:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,ie,de,W,pe,je,we,Me,et,Mi,Se,Ee,vt,At,_t,ti,Jn,vi,Ci,mi,Ot,Gt],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.iou-template-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.iou-template-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.iou-template-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.iou-template-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.iou-template-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.iou-template-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.iou-template-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px}.iou-template-details__form[_ngcontent-%COMP%]{padding:24px;display:flex;flex-direction:column;gap:16px}.iou-template-details__form[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:16px}.iou-template-details__field[_ngcontent-%COMP%]{width:100%}.iou-template-details__field--flex[_ngcontent-%COMP%]{flex:1}.iou-template-details__field--category[_ngcontent-%COMP%]{flex:0 0 150px}.iou-template-details__field--full[_ngcontent-%COMP%]{width:100%}.iou-template-details__section-title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.iou-template-details__section-header[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s ease;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.iou-template-details__section-header[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.iou-template-details__expand-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:transform .2s ease}.iou-template-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.iou-template-details__symbol-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.iou-template-details__file-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.iou-template-details__file-input[_ngcontent-%COMP%]{display:none}.iou-template-details__browse-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.iou-template-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.iou-template-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.iou-template-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.iou-template-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.iou-template-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.iou-template-details__title[_ngcontent-%COMP%]{font-size:22px}.iou-template-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.iou-template-details__form[_ngcontent-%COMP%]{padding:16px}.iou-template-details__section-header[_ngcontent-%COMP%]{padding:12px 16px}.iou-template-details__symbol-row[_ngcontent-%COMP%], .iou-template-details__file-row[_ngcontent-%COMP%], .iou-template-details__actions[_ngcontent-%COMP%]{flex-direction:column}.iou-template-details__cancel-btn[_ngcontent-%COMP%], .iou-template-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Nae=(n,i)=>i.template_id;function Fae(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences")}}function Rae(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/iou/addtemplate")}}function Lae(n,i){n&1&&R(0,"app-empty-templates-list")}function Vae(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"settings_ethernet"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(11,"mat-icon"),d(12,"delete"),l(),s(13,"span"),d(14,"Delete"),l()(),s(15,"button",15),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.copyTemplate(o))}),s(16,"mat-icon"),d(17,"content_copy"),l(),s(18,"span"),d(19,"Copy"),l()(),s(20,"a",16)(21,"mat-icon"),d(22,"edit"),l(),s(23,"span"),d(24,"Edit"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(15),C("routerLink",e.template_id)}}function Bae(n,i){if(n&1&&(s(0,"nav",8),Y(1,Vae,25,4,"div",10,Nae),l()),n&2){let e=v();m(),Z(e.iouTemplates)}}var kx=(()=>{class n{route=f(lt);controllerService=f(Je);iouService=f(us);toasterService=f(te);router=f(ht);cd=f(Q);controller;iouTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.iouService.getTemplates(this.controller).subscribe({next:e=>{this.iouTemplates=e.filter(t=>t.template_type==="iou"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load IOU templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}copyTemplate(e){this.router.navigate(["/controller",this.controller.id,"preferences","iou","templates",e.template_id,"copy"])}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-iou-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"iou-templates"],[1,"iou-templates__header"],["mat-icon-button","",1,"iou-templates__back-btn",3,"routerLink"],[1,"iou-templates__title"],["matTooltip","Add IOU device template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"iou-templates__add-btn",3,"routerLink"],[1,"iou-templates__content"],[1,"iou-templates__list"],[3,"deleteEvent","controller"],[1,"iou-templates__list-item",3,"routerLink"],[1,"iou-templates__list-icon"],[1,"iou-templates__list-name"],["mat-icon-button","",1,"iou-templates__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,Fae,3,1,"button",4),s(3,"h1",5),d(4,"IOU device templates"),l(),A(5,Rae,3,1,"button",6),l(),s(6,"main",7),A(7,Lae,1,0,"app-empty-templates-list"),A(8,Bae,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.iouTemplates.length?-1:7),m(),O(o.iouTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.iou-templates__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.iou-templates__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.iou-templates__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.iou-templates__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.iou-templates__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.iou-templates__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.iou-templates__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.iou-templates__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.iou-templates__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.iou-templates__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.iou-templates__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.iou-templates__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.iou-templates__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.iou-templates__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.iou-templates__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.iou-templates__back-btn[_ngcontent-%COMP%], .iou-templates__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.iou-templates__title[_ngcontent-%COMP%]{font-size:24px}.iou-templates__content[_ngcontent-%COMP%]{padding:0 16px 16px}.iou-templates__list-item[_ngcontent-%COMP%]{padding:14px 16px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Tx=(()=>{class n{controllerId="";route=f(lt);ngOnInit(){this.controllerId=this.route.snapshot.paramMap.get("controller_id")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-preferences"]],decls:33,vars:14,consts:[[1,"preferences"],[1,"preferences__header"],["mat-icon-button","",1,"preferences__back-btn",3,"routerLink"],[1,"preferences__title"],[1,"preferences__content"],[1,"preferences__nav-list"],["mat-list-item","",1,"preferences__nav-item",3,"routerLink"],[1,"preferences__nav-icon"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1)(2,"button",2)(3,"mat-icon"),d(4,"arrow_back"),l()(),s(5,"h1",3),d(6,"Template preferences"),l()(),s(7,"main",4)(8,"nav",5)(9,"a",6)(10,"mat-icon",7),d(11,"settings"),l(),d(12," Built-in "),l(),s(13,"a",6)(14,"mat-icon",7),d(15,"router"),l(),d(16," Dynamips "),l(),s(17,"a",6)(18,"mat-icon",7),d(19,"keyboard"),l(),d(20," IOS on Unix "),l(),s(21,"a",6)(22,"mat-icon",7),d(23,"computer"),l(),d(24," VPCS "),l(),s(25,"a",6)(26,"mat-icon",7),d(27,"memory"),l(),d(28," QEMU "),l(),s(29,"a",6)(30,"mat-icon",7),d(31,"dns"),l(),d(32," Docker "),l()()()()),t&2&&(m(2),C("routerLink",Ui("/controller/",o.controllerId,"/projects")),m(7),C("routerLink",Ui("/controller/",o.controllerId,"/preferences/builtin")),m(4),C("routerLink",Ui("/controller/",o.controllerId,"/preferences/dynamips/templates")),m(4),C("routerLink",Ui("/controller/",o.controllerId,"/preferences/iou/templates")),m(4),C("routerLink",Ui("/controller/",o.controllerId,"/preferences/vpcs/templates")),m(4),C("routerLink",Ui("/controller/",o.controllerId,"/preferences/qemu/templates")),m(4),C("routerLink",Ui("/controller/",o.controllerId,"/preferences/docker/templates")))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Wd],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Am=class{adapter_type;adapters;bios_image;boot_priority;builtin;category;cdrom_image;compute_id;console_auto_start;console_type;aux_type;cpu_throttling;cpus;maxcpus;create_config_disk;custom_adapters;default_name_format;first_port_name;hda_disk_image;hda_disk_interface;hdb_disk_image;hdb_disk_interface;hdc_disk_image;hdc_disk_interface;hdd_disk_image;hdd_disk_interface;initrd;kernel_command_line;kernel_image;linked_clone;mac_address;name;on_close;options;platform;port_name_format;port_segment_size;process_priority;qemu_path;ram;symbol;template_id;template_type;usage;replicate_network_connection_state;tpm;uefi;tags};var Om=(()=>{class n{getPlatform(){return["x86_64","aarch64","alpha","arm","cris","i386","lm32","m68k","microblaze","microblazeel","mips","mips64","mips64el","mipsel","moxie","or32","ppc","ppc64","ppcemb","s390x","sh4","sh4eb","sparc","sparc64","tricore","unicore32","xtensa","xtensaeb"]}getConsoleTypes(){return["telnet","ssh","vnc","spice","spice+agent","none"]}getAuxConsoleTypes(){return["telnet","ssh","none"]}getDiskInterfaces(){return["ide","sata","scsi","sd","mtd","floppy","pflash","virtio","nvme","none"]}getNetworkTypes(){return[{value:"e1000",name:"Intel Gigabit Ethernet"},{value:"e1000-82544gc",name:"Intel 82544GC Gigabit Ethernet"},{value:"e1000-82545em",name:"Intel 82545EM Gigabit Ethernet"},{value:"e1000e",name:"Intel PCIe Gigabit Ethernet"},{value:"i82550",name:"Intel i82550 Ethernet"},{value:"i82551",name:"Intel i82551 Ethernet"},{value:"i82557a",name:"Intel i82557A Ethernet"},{value:"i82557b",name:"Intel i82557B Ethernet"},{value:"i82557c",name:"Intel i82557C Ethernet"},{value:"i82558a",name:"Intel i82558A Ethernet"},{value:"i82558b",name:"Intel i82558B Ethernet"},{value:"i82559a",name:"Intel i82559A Ethernet"},{value:"i82559b",name:"Intel i82559B Ethernet"},{value:"i82559c",name:"Intel i82559C Ethernet"},{value:"i82559er",name:"Intel i82559ER Ethernet"},{value:"i82562",name:"Intel i82562 Ethernet"},{value:"i82801",name:"Intel i82801 Ethernet"},{value:"igb",name:"Intel I350 Gigabit Ethernet"},{value:"ne2k_pci",name:"NE2000 Ethernet"},{value:"pcnet",name:"AMD PCNet Ethernet"},{value:"rocker",name:"Rocker L2 switch device"},{value:"rtl8139",name:"Realtek 8139 Ethernet"},{value:"virtio",name:"Virtio network"},{value:"virtio-net-pci",name:"Virtio network PCI"},{value:"vmxnet3",name:"VMWare Paravirtualized Ethernet v3"}]}getBootPriorities(){return[["HDD","c"],["CD/DVD-ROM","d"],["Network","n"],["HDD or Network","cn"],["HDD or CD/DVD-ROM","cd"]]}getOnCloseOptions(){return[["Power off the VM","power_off"],["Send the shutdown signal (ACPI)","shutdown_signal"],["Save the VM state","save_vm_state"]]}getCategories(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getPriorities(){return["realtime","very high","high","normal","low","very low"]}getMacAddrRegex(){return/^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$/}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Kr=(()=>{class n{httpController;constructor(e){this.httpController=e}getTemplates(e){return this.httpController.get(e,"/templates")}getTemplate(e,t){return this.httpController.get(e,`/templates/${t}`)}getImagePath(e,t){return`${e.protocol}//${e.host}:${e.port}/${wi.current_version}/images/upload/${t}`}getImages(e){return this.httpController.get(e,"/images?image_type=qemu")}createDiskImage(e,t,o,r,a){return this.httpController.post(e,`/projects/${t}/nodes/${o}/qemu/disk_image/${r}`,a)}addTemplate(e,t){let o=this.prepareTemplate(t);return this.httpController.post(e,"/templates",o)}saveTemplate(e,t){let o=this.prepareTemplate(t);return this.httpController.put(e,`/templates/${t.template_id}`,o)}prepareTemplate(e){return it(K({},e),{custom_adapters:e.custom_adapters||[]})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var zae=(n,i)=>i.filename;function jae(n,i){if(n&1){let e=z();s(0,"button",30),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function $ae(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Hae(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Uae(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Gae(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e.filename," ")}}function Wae(n,i){if(n&1){let e=z();s(0,"mat-form-field",13)(1,"mat-label"),d(2,"Disk image (hda)"),l(),s(3,"mat-select",31),g("selectionChange",function(o){k(e);let r=v();return T(r.selectedImage.set(o.value))}),Y(4,Gae,2,2,"mat-option",17,zae),l()()}if(n&2){let e=v();m(3),C("value",e.selectedImage()),m(),Z(e.qemuImages())}}function qae(n,i){if(n&1){let e=z();s(0,"div",26)(1,"input",32,0),g("change",function(o){k(e);let r=v();return T(r.uploadImageFile(o))}),l(),s(3,"button",33),g("click",function(){k(e);let o=Pe(2);return T(o.click())}),d(4," Browse "),l(),s(5,"mat-form-field",34)(6,"mat-label"),d(7,"Image name"),l(),s(8,"input",35),g("input",function(o){k(e);let r=v();return T(r.fileName.set(o.target.value))}),l()()()}if(n&2){let e=v();m(),C("uploader",e.uploader()),m(7),C("value",e.fileName())}}var Ex=(()=>{class n{route=f(lt);controllerService=f(Je);qemuService=f(Kr);toasterService=f(te);router=f(ht);templateMocksService=f(xa);configurationService=f(Om);computeService=f(ko);snackBar=f(vr);uploadServiceService=f(hl);cd=f(Q);subscription;controller=ae(void 0);selectPlatform=ae([]);consoleTypes=ae([]);auxConsoleTypes=ae([]);newImageSelected=ae(!1);qemuImages=ae([]);selectedImage=ae(void 0);chosenImage=ae("");qemuTemplate=ae(new Am);uploader=ae(void 0);isLocalComputerChosen=ae(!0);templateName=U("");ramMemory=U(256);fileName=U("");selectedPlatform=U("");consoleType=U("");auxConsoleType=U("");nameStepCompleted=Jt(()=>!!this.templateName());platformStepCompleted=Jt(()=>!!this.ramMemory()&&!!this.selectedPlatform());consoleStepCompleted=Jt(()=>!!this.consoleType());auxConsoleStepCompleted=Jt(()=>!!this.auxConsoleType());ngOnInit(){this.uploader.set(new $a({url:""})),this.uploader().onAfterAddingFile=t=>{t.withCredentials=!1},this.uploader().onErrorItem=(t,o,r,a)=>{this.toasterService.error("An error occured: "+o)},this.uploader().onSuccessItem=(t,o,r,a)=>{this.qemuService.getImages(this.controller()).subscribe(c=>{this.qemuImages.set(c)}),this.toasterService.success("Image uploaded")},this.uploader().onProgressItem=t=>{this.uploadServiceService.processBarCount(t.progress)};let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller.set(t),this.templateMocksService.getQemuTemplate().subscribe({next:o=>{this.qemuTemplate.set(o)},error:()=>{this.toasterService.error("Failed to load QEMU template"),this.cd.markForCheck()}}),this.qemuService.getImages(this.controller()).subscribe({next:o=>{this.qemuImages.set(o)},error:o=>{let r=o.error?.message||o.message||"Failed to load QEMU images";this.toasterService.error(r),this.cd.markForCheck()}}),this.selectPlatform.set(this.configurationService.getPlatform()),this.selectedPlatform.set(this.selectPlatform()[0]),this.consoleTypes.set(this.configurationService.getConsoleTypes()),this.auxConsoleTypes.set(this.configurationService.getAuxConsoleTypes())},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()}),this.subscription=this.uploadServiceService.currentCancelItemDetails.subscribe(t=>{t&&this.cancelUploading()})}setControllerType(e){e==="local"&&this.isLocalComputerChosen.set(!0)}setDiskImage(e){this.newImageSelected.set(e==="newImage")}uploadImageFile(e){let t=e.target.files[0].name;this.fileName.set(t),this.chosenImage.set(t);let o=this.qemuService.getImagePath(this.controller(),t);this.uploader().queue.forEach(a=>a.url=o);let r=this.uploader().queue[0];r.options&&(r.options.disableMultipart=!0),r.options.headers=[{name:"Authorization",value:"Bearer "+this.controller().authToken}],this.uploader().uploadItem(r),this.snackBar.openFromComponent(fl,{panelClass:"uplaoding-file-snackabar",data:{upload_file_type:"Image"}})}cancelUploading(){this.uploader().clearQueue(),this.uploadServiceService.processBarCount(null),this.toasterService.warning("Image Uploading canceled"),this.uploadServiceService.cancelFileUploading(!1)}goBack(){this.router.navigate(["/controller",this.controller().id,"preferences","qemu","templates"])}addTemplate(){if(this.templateName()&&this.ramMemory()&&(this.selectedImage()||this.chosenImage())){let e=this.qemuTemplate();e.ram=this.ramMemory(),e.platform=this.selectedPlatform(),this.newImageSelected()?e.hda_disk_image=this.fileName():e.hda_disk_image=this.selectedImage().path,e.template_id=Ai(),e.name=this.templateName(),e.compute_id="local",e.console_type=this.consoleType(),e.aux_type=this.auxConsoleType(),this.qemuService.addTemplate(this.controller(),e).subscribe({next:t=>{this.goBack()},error:t=>{let o=t.error?.message||t.message||"Failed to add qemu template";this.toasterService.error(o),this.cd.markForCheck()}})}else this.toasterService.error("Fill all required fields")}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-qemu-virtual-machine-template"]],inputs:{templateName:[1,"templateName"],ramMemory:[1,"ramMemory"],fileName:[1,"fileName"],selectedPlatform:[1,"selectedPlatform"],consoleType:[1,"consoleType"],auxConsoleType:[1,"auxConsoleType"]},outputs:{templateName:"templateNameChange",ramMemory:"ramMemoryChange",fileName:"fileNameChange",selectedPlatform:"selectedPlatformChange",consoleType:"consoleTypeChange",auxConsoleType:"auxConsoleTypeChange"},decls:60,vars:17,consts:[["file",""],[1,"qemu-add"],[1,"qemu-add__header"],["mat-icon-button","",1,"qemu-add__back-btn"],[1,"qemu-add__title"],[1,"qemu-add__content"],[1,"qemu-add__form-card"],[1,"qemu-add__stepper",3,"linear"],["label","Controller type",3,"completed"],[1,"qemu-add__radio-group"],["value","1",1,"qemu-add__radio",3,"click","checked"],["label","QEMU VM Name",3,"completed"],[1,"qemu-add__form"],["appearance","fill",1,"qemu-add__field"],["matInput","","type","text","placeholder","Please choose a descriptive name for your new QEMU virtual machine",3,"input","value"],["label","Platform and memory",3,"completed"],["placeholder","Platform",3,"selectionChange","value"],[3,"value"],["matInput","","type","number","min","1","placeholder","RAM",3,"input","value"],["matSuffix",""],["label","Console type",3,"completed"],["placeholder","Console type",3,"selectionChange","value"],["label","Auxiliary console type",3,"completed"],["placeholder","Auxiliary console type",3,"selectionChange","value"],["label","Disk image"],["value","2",1,"qemu-add__radio",3,"click","checked"],[1,"qemu-add__file-row"],[1,"qemu-add__actions"],["mat-button","",1,"qemu-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"qemu-add__submit-btn",3,"click"],["mat-icon-button","",1,"qemu-add__back-btn",3,"click"],["placeholder","Disk image (hda)",3,"selectionChange","value"],["type","file","accept",".qcow2","ng2FileSelect","",1,"qemu-add__file-input",3,"change","uploader"],["mat-raised-button","","color","primary",1,"qemu-add__browse-btn",3,"click"],["appearance","fill",1,"qemu-add__field","qemu-add__field--flex"],["matInput","","type","text","placeholder","Please enter name",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,jae,3,0,"button",3),s(3,"h1",4),d(4,"New QEMU VM template"),l()(),s(5,"main",5)(6,"section",6)(7,"mat-vertical-stepper",7)(8,"mat-step",8)(9,"mat-radio-group",9)(10,"mat-radio-button",10),g("click",function(){return o.setControllerType("local")}),d(11," Run this QEMU VM locally "),l()()(),s(12,"mat-step",11)(13,"div",12)(14,"mat-form-field",13)(15,"mat-label"),d(16,"Template name"),l(),s(17,"input",14),g("input",function(a){return o.templateName.set(a.target.value)}),l()()()(),s(18,"mat-step",15)(19,"div",12)(20,"mat-form-field",13)(21,"mat-label"),d(22,"Platform"),l(),s(23,"mat-select",16),g("selectionChange",function(a){return o.selectedPlatform.set(a.value)}),Y(24,$ae,2,2,"mat-option",17,Ae),l()(),s(26,"mat-form-field",13)(27,"mat-label"),d(28,"RAM"),l(),s(29,"input",18),g("input",function(a){return o.ramMemory.set(+a.target.value)}),l(),s(30,"span",19),d(31,"MB"),l()()()(),s(32,"mat-step",20)(33,"mat-form-field",13)(34,"mat-label"),d(35,"Console type"),l(),s(36,"mat-select",21),g("selectionChange",function(a){return o.consoleType.set(a.value)}),Y(37,Hae,2,2,"mat-option",17,Ae),l()()(),s(39,"mat-step",22)(40,"mat-form-field",13)(41,"mat-label"),d(42,"Auxiliary console type"),l(),s(43,"mat-select",23),g("selectionChange",function(a){return o.auxConsoleType.set(a.value)}),Y(44,Uae,2,2,"mat-option",17,Ae),l()()(),s(46,"mat-step",24)(47,"div",12)(48,"mat-radio-group",9)(49,"mat-radio-button",10),g("click",function(){return o.setDiskImage("existingImage")}),d(50," Existing image "),l(),s(51,"mat-radio-button",25),g("click",function(){return o.setDiskImage("newImage")}),d(52," New image "),l()(),A(53,Wae,6,1,"mat-form-field",13),A(54,qae,9,2,"div",26),l()()()(),s(55,"div",27)(56,"button",28),g("click",function(){return o.goBack()}),d(57,"Cancel"),l(),s(58,"button",29),g("click",function(){return o.addTemplate()}),d(59," Add template "),l()()()()),t&2&&(m(2),O(o.controller()?2:-1),m(5),C("linear",!0),m(),C("completed",o.isLocalComputerChosen()),m(2),C("checked",!0),m(2),C("completed",o.nameStepCompleted()),m(5),C("value",o.templateName()),m(),C("completed",o.platformStepCompleted()),m(5),C("value",o.selectedPlatform()),m(),Z(o.selectPlatform()),m(5),C("value",o.ramMemory()),m(3),C("completed",o.consoleStepCompleted()),m(4),C("value",o.consoleType()),m(),Z(o.consoleTypes()),m(2),C("completed",o.auxConsoleStepCompleted()),m(4),C("value",o.auxConsoleType()),m(),Z(o.auxConsoleTypes()),m(5),C("checked",!o.newImageSelected()),m(2),C("checked",o.newImageSelected()),m(2),O(o.newImageSelected()?-1:53),m(),O(o.newImageSelected()?54:-1))},dependencies:[ne,Xe,dt,ie,de,W,pe,je,Mt,io,xo,ho,we,Me,et,Mi,Se,Ee,vt,At,_t,ul,Hl,Ul,sl,Ac],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.qemu-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.qemu-add__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.qemu-add__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.qemu-add__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.qemu-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.qemu-add__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.qemu-add__stepper[_ngcontent-%COMP%]{background:transparent}.qemu-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.qemu-add__radio[_ngcontent-%COMP%]{font-size:16px}.qemu-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.qemu-add__field[_ngcontent-%COMP%]{width:100%}.qemu-add__field--flex[_ngcontent-%COMP%]{flex:1}.qemu-add__file-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.qemu-add__file-input[_ngcontent-%COMP%]{display:none}.qemu-add__browse-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.qemu-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.qemu-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.qemu-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.qemu-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.qemu-add__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.qemu-add__title[_ngcontent-%COMP%]{font-size:24px}.qemu-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.qemu-add__form-card[_ngcontent-%COMP%]{padding:16px}.qemu-add__file-row[_ngcontent-%COMP%], .qemu-add__actions[_ngcontent-%COMP%]{flex-direction:column}.qemu-add__cancel-btn[_ngcontent-%COMP%], .qemu-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();function Qae(n,i){if(n&1){let e=z();s(0,"button",12),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Dx=(()=>{class n{route=f(lt);controllerService=f(Je);qemuService=f(Kr);toasterService=f(te);router=f(ht);formBuilder=f(Vn);cd=f(Q);controller;templateName="";qemuTemplate;nameForm;constructor(){this.nameForm=this.formBuilder.group({templateName:new Ye("",Ue.required)})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.qemuService.getTemplate(this.controller,t).subscribe({next:r=>{this.qemuTemplate=r,this.templateName=`Copy of ${this.qemuTemplate.name}`,this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load QEMU template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","qemu","templates"])}addTemplate(){this.nameForm.invalid?this.toasterService.error("Fill all required fields"):(this.qemuTemplate.template_id=Ai(),this.qemuTemplate.name=this.nameForm.get("templateName").value,this.qemuService.addTemplate(this.controller,this.qemuTemplate).subscribe({next:e=>{this.goBack()},error:e=>{let t=e.error?.message||e.message||"Failed to copy qemu template";this.toasterService.error(t),this.cd.markForCheck()}}))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-copy-qemu-virtual-machine-template"]],decls:17,vars:2,consts:[[1,"qemu-copy"],[1,"qemu-copy__header"],["mat-icon-button","",1,"qemu-copy__back-btn"],[1,"qemu-copy__title"],[1,"qemu-copy__content"],[1,"qemu-copy__form-card"],[1,"qemu-copy__form",3,"formGroup"],["appearance","fill",1,"qemu-copy__field"],["matInput","","type","text","placeholder","Name","formControlName","templateName"],[1,"qemu-copy__actions"],["mat-button","",1,"qemu-copy__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"qemu-copy__submit-btn",3,"click"],["mat-icon-button","",1,"qemu-copy__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,Qae,3,0,"button",2),s(3,"h1",3),d(4,"Copy QEMU VM template"),l()(),s(5,"main",4)(6,"section",5)(7,"form",6)(8,"mat-form-field",7)(9,"mat-label"),d(10,"Template name"),l(),R(11,"input",8),l()()(),s(12,"div",9)(13,"button",10),g("click",function(){return o.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),g("click",function(){return o.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(5),C("formGroup",o.nameForm))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,dt,ie,de,W,pe,je,Mt,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.qemu-copy__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.qemu-copy__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.qemu-copy__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.qemu-copy__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.qemu-copy__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.qemu-copy__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.qemu-copy__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.qemu-copy__field[_ngcontent-%COMP%]{width:100%}.qemu-copy__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.qemu-copy__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.qemu-copy__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.qemu-copy__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.qemu-copy__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.qemu-copy__title[_ngcontent-%COMP%]{font-size:24px}.qemu-copy__content[_ngcontent-%COMP%]{padding:0 16px 16px}.qemu-copy__form-card[_ngcontent-%COMP%]{padding:16px}.qemu-copy__actions[_ngcontent-%COMP%]{flex-direction:column}.qemu-copy__cancel-btn[_ngcontent-%COMP%], .qemu-copy__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Xae=["panel"],Kae=["*"];function Yae(n,i){if(n&1&&(vo(0,"div",1,0),on(2),wo()),n&2){let e=i.id,t=v();er(t._classList),Be("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),Wo("id",t.id),qt("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e))}}var sP=class{source;option;constructor(i,e){this.source=i,this.option=e}},F8=new cn("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1})}),Sa=(()=>{class n{_changeDetectorRef=f(Q);_elementRef=f(Zt);_defaults=f(F8);_animationsDisabled=qo();_activeOptionChanges=So.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=!1;optionSelected=new ve;opened=new ve;closed=new ve;optionActivated=new ve;set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}id=f(Mo).getId("mat-autocomplete-");inertGroups;constructor(){let e=f($s);this.inertGroups=e?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new m4(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){let t=new sP(this,e);this.optionSelected.emit(t)}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return!1}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-autocomplete"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,_t,5)(r,D4,5),t&2){let a;mt(a=pt())&&(o.options=a),mt(a=pt())&&(o.optionGroups=a)}},viewQuery:function(t,o){if(t&1&&xn(Oo,7)(Xae,5),t&2){let r;mt(r=pt())&&(o.template=r.first),mt(r=pt())&&(o.panel=r.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",Ct],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",Ct],requireSelection:[2,"requireSelection","requireSelection",Ct],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",Ct],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",Ct]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[fn([{provide:E4,useExisting:n}])],ngContentSelectors:Kae,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,o){t&1&&(ii(),ju(0,Yae,3,17,"ng-template"))},styles:[`div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden,.cdk-overlay-pane:has(>.mat-mdc-autocomplete-hidden){visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}
`],encapsulation:2,changeDetection:0})}return n})();var Zae={provide:ud,useExisting:ad(()=>Ko),multi:!0};var Jae=new cn("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let n=f(Jo);return()=>pC(n)}}),Ko=(()=>{class n{_environmentInjector=f(SO);_element=f(Zt);_injector=f(Jo);_viewContainerRef=f(oo);_zone=f(Vi);_changeDetectorRef=f(Q);_dir=f(Ka,{optional:!0});_formField=f(Zu,{optional:!0,host:!0});_viewportRuler=f(dd);_scrollStrategy=f(Jae);_renderer=f(Si);_animationsDisabled=qo();_defaults=f(F8,{optional:!0});_overlayRef=null;_portal;_componentDestroyed=!1;_initialized=new He;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=So.EMPTY;_breakpointObserver=f(xC);_handsetLandscapeSubscription=So.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new He;_overlayPanelClass=JO(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=!1;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&SC(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Hn(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(ai(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(ai(()=>this._overlayAttached)):Nn()).pipe(Lt(e=>e instanceof P4?e:null))}optionSelections=gO(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(pi(e),Un(()=>Hn(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(Un(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new Dr(e=>{let t=r=>{let a=Cp(r),c=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,p=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&a!==this._element.nativeElement&&!this._hasFocus()&&(!c||!c.contains(a))&&(!p||!p.contains(a))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(a)&&e.next(r)},o=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return()=>{o.forEach(r=>r())}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let t=e,o=t.keyCode,r=fa(t);if(o===27&&!r&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&o===13&&this.panelOpen&&!r)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let a=this.autocomplete._keyManager.activeItem,c=o===38||o===40;o===9||c&&!r&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):c&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(c||this.autocomplete._keyManager.activeItem!==a)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let t=e.target,o=t.value;if(t.type==="number"&&(o=o==""?null:parseFloat(o)),this._previousValue!==o){if(this._previousValue=o,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(o),!o)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let r=this.autocomplete.options?.find(a=>a.selected);if(r){let a=this._getDisplayValue(r.value);o!==a&&r.deselect(!1)}}if(this._canOpen()&&this._hasFocus()){let r=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(r)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return lC()===this._element.nativeElement}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new Dr(o=>{Xa(()=>{o.next()},{injector:this._environmentInjector})}),t=this.autocomplete.options?.changes.pipe(Qi(()=>this._positionStrategy.reapplyLastPosition()),bO(0))??Nn();return Hn(e,t).pipe(Un(()=>this._zone.run(()=>{let o=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),o!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Ao(1)).subscribe(o=>this._setValueAndClose(o))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(t??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let t=this.autocomplete,o=e?e.source:this._pendingAutoselectedOption;o?(this._clearPreviousSelectedOption(o),this._assignOptionValue(o.value),this._onChange(o.value),t._emitSelectEvent(o),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(o=>{o!==e&&o.selected&&o.deselect(t)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let t=this.autocomplete.id;dk(this._trackedModal,"aria-owns",t)}}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new pd(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=fC(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(hd.HandsetLandscape).subscribe(r=>{r.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let o=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&o!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!fa(e)||e.keyCode===38&&fa(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0}_getOverlayConfig(){return new uC({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=hC(this._injector,this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],o=this._aboveClass,r=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:o},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:o}],a;this.position==="above"?a=r:this.position==="below"?a=t:a=[...t,...r],e.withPositions(a)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let o=0;o<e.options.length;o++)if(!e.options.get(o).disabled){t=o;break}e._keyManager.setActiveItem(t)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,o=I4(e,t.options,t.optionGroups);if(e===0&&o===1)t._setScrollTop(0);else if(t.panel){let r=t.options.toArray()[e];if(r){let a=r._getHostElement(),c=A4(a.offsetTop,a.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(c)}}}_trackedModal=null;_applyModalPanelOwnership(){let e=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=this.autocomplete.id;this._trackedModal&&SC(this._trackedModal,"aria-owns",t),dk(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;SC(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,o){t&1&&g("focusin",function(){return o._handleFocus()})("blur",function(){return o._onTouched()})("input",function(a){return o._handleInput(a)})("keydown",function(a){return o._handleKeydown(a)})("click",function(){return o._handleClick()}),t&2&&qt("autocomplete",o.autocompleteAttribute)("role",o.autocompleteDisabled?null:"combobox")("aria-autocomplete",o.autocompleteDisabled?null:"list")("aria-activedescendant",o.panelOpen&&o.activeOption?o.activeOption.id:null)("aria-expanded",o.autocompleteDisabled?null:o.panelOpen.toString())("aria-controls",o.autocompleteDisabled||!o.panelOpen||o.autocomplete==null?null:o.autocomplete.id)("aria-haspopup",o.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",Ct]},exportAs:["matAutocompleteTrigger"],features:[fn([Zae]),bn]})}return n})(),Yr=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[Qu,Fo,md,Fo,hi]})}return n})();var Lc=(()=>{class n{httpController;constructor(e){this.httpController=e}getImages(e){return this.httpController.get(e,"/images")}getImagePath(e,t,o){return`${e.protocol}//${e.host}:${e.port}/${wi.current_version}/images/upload/${o}?install_appliances=${t}`}uploadedImage(e,t,o,r){return this.httpController.post(e,`/images/upload/${o}?install_appliances=${t}`,r)}deleteFile(e,t){return this.httpController.delete(e,`/images/${t}`)}pruneImages(e){return this.httpController.delete(e,"/images/prune")}installImages(e){return this.httpController.post(e,"/images/install",{})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var tse=(n,i)=>i.adapter_number,nse=(n,i)=>i.value;function ise(n,i){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),j(e.name)}}function ose(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v().$implicit,t=v();m(),j(t.getMacErrorMessage(e.mac_address))}}function rse(n,i){if(n&1){let e=z();s(0,"div",7)(1,"span",14),d(2),l(),s(3,"mat-form-field",15)(4,"input",16),g("input",function(o){let r=k(e).$implicit,a=v();return T(a.onPortNameChange(r.adapter_number,o.target.value))}),l()(),s(5,"mat-form-field",15)(6,"mat-select",17),g("selectionChange",function(o){let r=k(e).$implicit,a=v();return T(a.onAdapterTypeChange(r.adapter_number,o.value))}),Y(7,ise,2,2,"mat-option",18,nse),l()(),s(9,"mat-form-field",15)(10,"input",19),g("input",function(o){let r=k(e).$implicit,a=v();return T(a.onMacAddressChange(r.adapter_number,o.target.value))}),l(),A(11,ose,2,1,"mat-error"),l(),s(12,"button",20),g("click",function(){let o=k(e).$implicit,r=v();return T(r.delete(o))}),s(13,"mat-icon"),d(14,"delete"),l()()()}if(n&2){let e=i.$implicit,t=i.$index,o=v();m(2),ee("Adapter ",e.adapter_number),m(2),C("name",Ui("port_name_",t))("value",e.port_name),m(2),C("name",Ui("adapter_type_",t))("value",e.adapter_type),m(),Z(o.networkTypes),m(3),C("name",Ui("mac_address_",t))("value",e.mac_address),m(),O(e.mac_address&&!o.isValidMacAddress(e.mac_address)?11:-1)}}var Vc=(()=>{class n{data;dialogRef=f(Ie);cd=f(Q);toasterService=f(te);adapters=U([]);numberOfAdapters;constructor(e){this.data=e,this.adapters.set(e.adapters?[...e.adapters]:[])}get networkTypes(){return this.data.networkTypes||[]}onAdd(){let e=this.adapters(),o=(e.length>0?Math.max(...e.map(u=>u.adapter_number)):-1)+1,r=this.data.portNameFormat||"Ethernet{0}",a=this.data.portSegmentSize||0,c;if(a>0){let u=Math.floor(o/a),h=o%a;c=r.replace("{0}",String(u*a+h))}else c=r.replace("{0}",String(o));let p={adapter_number:o,adapter_type:this.networkTypes[0]?.value||"e1000",port_name:c,mac_address:""};this.adapters.set([...e,p])}delete(e){this.adapters.set(this.adapters().filter(t=>t!==e))}onPortNameChange(e,t){this.adapters.update(o=>o.map(r=>r.adapter_number===e?it(K({},r),{port_name:t}):r)),this.cd.markForCheck()}onAdapterTypeChange(e,t){this.adapters.update(o=>o.map(r=>r.adapter_number===e?it(K({},r),{adapter_type:t}):r)),this.cd.markForCheck()}onMacAddressChange(e,t){let o=this.formatMacAddress(t);this.adapters.update(r=>r.map(a=>a.adapter_number===e?it(K({},a),{mac_address:o}):a)),this.cd.markForCheck()}formatMacAddress(e){if(!e)return e;let t=e.replace(/[^0-9A-Fa-f]/g,"");return t.length!==12?e:t.match(/.{1,2}/g)?.join(":")||e}isValidMacAddress(e){return e?/^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$/.test(e):!0}hasInvalidMacAddresses(){return this.adapters().some(e=>e.mac_address&&!this.isValidMacAddress(e.mac_address))}getMacErrorMessage(e){if(!e)return" ";let t=e.replace(/[^0-9A-Fa-f]/g,"");return t.length===0?"Invalid MAC address format":t.length<12?`Too short (${t.length}/12 hex digits)`:t.length>12?`Too long (${t.length}/12 hex digits)`:"Invalid MAC address format (12 hex digits required)"}cancelConfigureCustomAdapters(){this.dialogRef.close()}configureCustomAdapters(){if(this.hasInvalidMacAddresses()){let u=this.adapters().filter(h=>h.mac_address&&!this.isValidMacAddress(h.mac_address)).map(h=>{let _=this.getMacErrorMessage(h.mac_address);return`Adapter ${h.adapter_number}: ${_}`});this.toasterService.error(`Invalid MAC addresses:
`+u.join(`
`));return}let e=this.data.portNameFormat||"Ethernet{0}",t=this.data.portSegmentSize||0,o=this.data.defaultAdapterType||"e1000",r=[];for(let p of this.adapters()){let u;if(t>0){let x=Math.floor(p.adapter_number/t),b=p.adapter_number%t;u=e.replace("{0}",String(x*t+b))}else u=e.replace("{0}",String(p.adapter_number));let h=p.port_name!==u,_=p.adapter_type!==o,S=p.mac_address&&p.mac_address.length>0;(h||_||S)&&r.push({adapter_number:p.adapter_number,port_name:h?p.port_name:u,adapter_type:p.adapter_type,mac_address:p.mac_address||null})}let a=this.adapters().length,c={adapters:r,requiredAdapters:a};this.dialogRef.close(c)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-custom-adapters"]],inputs:{adapters:[1,"adapters"]},outputs:{adapters:"adaptersChange"},decls:28,vars:0,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"content"],[1,"adapter-form"],[1,"adapter-header"],[1,"adapter-header-label"],[1,"adapter-header-field"],[1,"adapter-header-actions"],[1,"adapter-item"],[1,"add-adapter-row"],["mat-button","",1,"add-btn",3,"click"],[1,"info-note-text"],["mat-dialog-actions","","align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click"],[1,"adapter-label"],["appearance","fill","subscriptSizing","dynamic",1,"adapter-field"],["matInput","",3,"input","value","name"],[3,"selectionChange","value","name"],[3,"value"],["matInput","","placeholder","Paste any MAC format",3,"input","value","name"],["mat-icon-button","","matTooltip","Delete",1,"adapter-actions",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Custom adapters configuration"),l(),s(2,"div",1)(3,"div",2)(4,"div",3)(5,"span",4),d(6,"Adapter"),l(),s(7,"span",5),d(8,"Port name"),l(),s(9,"span",5),d(10,"Type"),l(),s(11,"span",5),d(12,"MAC address"),l(),R(13,"span",6),l(),Y(14,rse,15,11,"div",7,tse),l(),s(16,"div",8)(17,"button",9),g("click",function(){return o.onAdd()}),s(18,"mat-icon"),d(19,"add"),l(),d(20," Add adapter "),l(),s(21,"div",10),d(22," Deleting an adapter reduces the total number of adapters. Adapter numbers will be renumbered when reopened. Adapters without custom configuration will use default settings. "),l()()(),s(23,"div",11)(24,"button",12),g("click",function(){return o.cancelConfigureCustomAdapters()}),d(25,"Cancel"),l(),s(26,"button",13),g("click",function(){return o.configureCustomAdapters()}),d(27,"Apply"),l()()),t&2&&(m(14),Z(o.adapters()))},dependencies:[W,pe,je,we,Me,fi,ie,de,Se,Ee,vt,At,_t,wt,It,_e,Ne,Fe,bt],styles:["[_nghost-%COMP%]{display:block}.adapter-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;max-height:500px;overflow-y:auto}.adapter-item[_ngcontent-%COMP%]{display:grid;grid-template-columns:100px 1fr 2fr 1.5fr auto;gap:12px;align-items:center;padding:12px 16px;background:var(--mat-sys-surface-container-lowest);border-radius:12px;border:1px solid color-mix(in srgb,var(--mat-sys-outline) 15%,transparent)}.adapter-item[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.adapter-label[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface);text-align:center}.adapter-header[_ngcontent-%COMP%]{display:grid;grid-template-columns:100px 1fr 2fr 1.5fr auto;gap:12px;align-items:center;padding:8px 16px;margin-bottom:8px;border-bottom:2px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent);position:sticky;top:0;z-index:10;background:var(--mat-sys-surface);box-shadow:0 2px 4px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.adapter-header-label[_ngcontent-%COMP%], .adapter-header-field[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px;text-align:center}.adapter-header-actions[_ngcontent-%COMP%]{width:40px;text-align:center}.adapter-field[_ngcontent-%COMP%], .adapter-actions[_ngcontent-%COMP%]{margin:0;text-align:center}.add-btn[_ngcontent-%COMP%]{flex-shrink:0;width:auto;margin-top:12px;height:48px;border-radius:12px;font-size:14px;font-weight:500;text-transform:none;border:2px dashed color-mix(in srgb,var(--mat-sys-outline) 40%,transparent);color:var(--mat-sys-on-surface-variant)}.add-btn[_ngcontent-%COMP%]:hover{border-color:var(--mat-sys-primary);color:var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 8%,transparent)}"],changeDetection:0})}return n})();var R8=(n,i)=>i[1],Fm=(n,i)=>i.filename,ase=(n,i)=>i.value;function sse(n,i){if(n&1){let e=z();s(0,"button",18),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function lse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),j(e[0])}}function cse(n,i){if(n&1){let e=z();s(0,"mat-chip",47),g("removed",function(){let o=k(e).$implicit,r=v(3);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",48),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function dse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function mse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),j(e[0])}}function pse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function use(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function hse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function fse(n,i){if(n&1){let e=z();s(0,"form",23)(1,"div",30)(2,"mat-form-field",31)(3,"mat-label"),d(4,"Template name"),l(),s(5,"input",32),g("input",function(o){k(e);let r=v(2);return T(r.templateName.set(o.target.value))}),l()(),s(6,"mat-form-field",31)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",33),g("input",function(o){k(e);let r=v(2);return T(r.defaultName.set(o.target.value))}),l()()(),s(10,"div",34)(11,"mat-form-field",35)(12,"mat-label"),d(13,"Category"),l(),s(14,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.category.set(o.value))}),Y(15,lse,2,2,"mat-option",37,Hi),l()(),s(17,"mat-form-field",38)(18,"mat-label"),d(19,"Symbol"),l(),s(20,"input",39),g("input",function(o){k(e);let r=v(2);return T(r.symbol.set(o.target.value))}),l()(),s(21,"button",40),g("click",function(){k(e);let o=v(2);return T(o.chooseSymbol())}),d(22,"Choose symbol"),l()(),s(23,"mat-form-field",31)(24,"mat-label"),d(25,"Tags"),l(),s(26,"mat-chip-grid",null,0),Y(28,cse,4,1,"mat-chip",null,Ae),l(),s(30,"input",41),g("matChipInputTokenEnd",function(o){k(e);let r=v(2);return T(r.addTag(o))}),l()(),s(31,"div",42)(32,"mat-form-field",31)(33,"mat-label"),d(34,"Platform"),l(),s(35,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.platform.set(o.value))}),Y(36,dse,2,2,"mat-option",37,Ae),l()(),s(38,"mat-form-field",31)(39,"mat-label"),d(40,"RAM"),l(),s(41,"input",43),g("input",function(o){k(e);let r=v(2);return T(r.ram.set(+o.target.value))}),l(),s(42,"span",44),d(43,"MB"),l()(),s(44,"mat-form-field",31)(45,"mat-label"),d(46,"vCPUs"),l(),s(47,"input",45),g("input",function(o){k(e);let r=v(2);return T(r.cpus.set(+o.target.value))}),l()(),s(48,"mat-form-field",31)(49,"mat-label"),d(50,"Boot priority"),l(),s(51,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.bootPriority.set(o.value))}),Y(52,mse,2,2,"mat-option",37,R8),l()()(),s(54,"mat-form-field",31)(55,"mat-label"),d(56,"On close"),l(),s(57,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.onClose.set(o.value))}),Y(58,pse,2,2,"mat-option",37,R8),l()(),s(60,"div",30)(61,"mat-form-field",31)(62,"mat-label"),d(63,"Console type"),l(),s(64,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.consoleType.set(o.value))}),Y(65,use,2,2,"mat-option",37,Ae),l()(),s(67,"mat-form-field",31)(68,"mat-label"),d(69,"Auxiliary console type"),l(),s(70,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.auxConsoleType.set(o.value))}),Y(71,hse,2,2,"mat-option",37,Ae),l()()(),s(73,"mat-checkbox",46),g("change",function(o){k(e);let r=v(2);return T(r.consoleAutoStart.set(o.checked))}),d(74,"Auto start console"),l()()}if(n&2){let e=Pe(27),t=v(2);m(5),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.category()),m(),Z(t.categories),m(5),C("value",t.symbol()),m(8),Z(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(5),C("value",t.platform()),m(),Z(t.selectPlatform),m(5),C("value",t.ram()),m(6),C("value",t.cpus()),m(4),C("value",t.bootPriority()),m(),Z(t.bootPriorities),m(5),C("value",t.onClose()),m(),Z(t.onCloseOptions),m(6),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(5),C("value",t.auxConsoleType()),m(),Z(t.auxConsoleTypes),m(2),C("checked",t.consoleAutoStart())}}function gse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function _se(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,gse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredImages)}}function vse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Cse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function bse(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,Cse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredImages)}}function xse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function yse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function Sse(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,yse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredImages)}}function wse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Mse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function kse(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,Mse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredImages)}}function Tse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function Ese(n,i){if(n&1){let e=z();s(0,"div",24)(1,"div",49)(2,"h4",50),d(3,"HDA (Primary Master)"),l(),s(4,"mat-form-field",31)(5,"mat-label"),d(6,"Disk image"),l(),s(7,"input",51),g("input",function(o){k(e);let r=v(2);return r.onHdaImageInput(o),T(r.hdaDiskImage.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshQemuImages())}),l(),s(8,"mat-autocomplete",52,1),g("optionSelected",function(o){k(e);let r=v(2);return T(r.hdaDiskImage.set(o.option.value))}),A(10,_se,3,0,"mat-optgroup",53),l()(),s(11,"mat-form-field",31)(12,"mat-label"),d(13,"Disk interface"),l(),s(14,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.hdaDiskInterface.set(o.value))}),Y(15,vse,2,2,"mat-option",37,Ae),l()()(),s(17,"div",49)(18,"h4",50),d(19,"HDB (Primary Slave)"),l(),s(20,"mat-form-field",31)(21,"mat-label"),d(22,"Disk image"),l(),s(23,"input",51),g("input",function(o){k(e);let r=v(2);return r.onHdbImageInput(o),T(r.hdbDiskImage.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshQemuImages())}),l(),s(24,"mat-autocomplete",52,2),g("optionSelected",function(o){k(e);let r=v(2);return T(r.hdbDiskImage.set(o.option.value))}),A(26,bse,3,0,"mat-optgroup",53),l()(),s(27,"mat-form-field",31)(28,"mat-label"),d(29,"Disk interface"),l(),s(30,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.hdbDiskInterface.set(o.value))}),Y(31,xse,2,2,"mat-option",37,Ae),l()()(),s(33,"div",49)(34,"h4",50),d(35,"HDC (Secondary Master)"),l(),s(36,"mat-form-field",31)(37,"mat-label"),d(38,"Disk image"),l(),s(39,"input",51),g("input",function(o){k(e);let r=v(2);return r.onHdcImageInput(o),T(r.hdcDiskImage.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshQemuImages())}),l(),s(40,"mat-autocomplete",52,3),g("optionSelected",function(o){k(e);let r=v(2);return T(r.hdcDiskImage.set(o.option.value))}),A(42,Sse,3,0,"mat-optgroup",53),l()(),s(43,"mat-form-field",31)(44,"mat-label"),d(45,"Disk interface"),l(),s(46,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.hdcDiskInterface.set(o.value))}),Y(47,wse,2,2,"mat-option",37,Ae),l()()(),s(49,"div",49)(50,"h4",50),d(51,"HDD (Secondary Slave)"),l(),s(52,"mat-form-field",31)(53,"mat-label"),d(54,"Disk image"),l(),s(55,"input",51),g("input",function(o){k(e);let r=v(2);return r.onHddImageInput(o),T(r.hddDiskImage.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshQemuImages())}),l(),s(56,"mat-autocomplete",52,4),g("optionSelected",function(o){k(e);let r=v(2);return T(r.hddDiskImage.set(o.option.value))}),A(58,kse,3,0,"mat-optgroup",53),l()(),s(59,"mat-form-field",31)(60,"mat-label"),d(61,"Disk interface"),l(),s(62,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.hddDiskInterface.set(o.value))}),Y(63,Tse,2,2,"mat-option",37,Ae),l()()()()}if(n&2){let e=Pe(9),t=Pe(25),o=Pe(41),r=Pe(57),a=v(2);m(7),C("value",a.hdaDiskImage())("matAutocomplete",e),m(3),O(a.filteredImages.length?10:-1),m(4),C("value",a.hdaDiskInterface()),m(),Z(a.diskInterfaces),m(8),C("value",a.hdbDiskImage())("matAutocomplete",t),m(3),O(a.filteredImages.length?26:-1),m(4),C("value",a.hdbDiskInterface()),m(),Z(a.diskInterfaces),m(8),C("value",a.hdcDiskImage())("matAutocomplete",o),m(3),O(a.filteredImages.length?42:-1),m(4),C("value",a.hdcDiskInterface()),m(),Z(a.diskInterfaces),m(8),C("value",a.hddDiskImage())("matAutocomplete",r),m(3),O(a.filteredImages.length?58:-1),m(4),C("value",a.hddDiskInterface()),m(),Z(a.diskInterfaces)}}function Dse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function Pse(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,Dse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredGlobalImages)}}function Ise(n,i){if(n&1){let e=z();s(0,"div",25)(1,"input",54,5),g("change",function(o){k(e);let r=v(2);return T(r.uploadCdromImageFile(o))}),l(),s(3,"button",55),g("click",function(){k(e);let o=Pe(2);return T(o.click())}),d(4," Upload "),l(),s(5,"mat-form-field",38)(6,"mat-label"),d(7,"Image"),l(),s(8,"input",56),g("input",function(o){k(e);let r=v(2);return r.onCdromInput(o),T(r.cdromImage.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshGlobalImages())}),l(),s(9,"mat-autocomplete",null,6),A(11,Pse,3,0,"mat-optgroup",53),l()()()}if(n&2){let e=Pe(10),t=v(2);m(8),C("value",t.cdromImage())("matAutocomplete",e),m(3),O(t.filteredGlobalImages.length?11:-1)}}function Ase(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ui("",e.name," (",e.value,")")}}function Ose(n,i){if(n&1){let e=z();s(0,"form",23)(1,"mat-form-field",31)(2,"mat-label"),d(3,"Adapters"),l(),s(4,"input",57),g("input",function(o){k(e);let r=v(2);return T(r.adapters.set(+o.target.value))}),l()(),s(5,"mat-form-field",31)(6,"mat-label"),d(7,"First port name"),l(),s(8,"input",58),g("input",function(o){k(e);let r=v(2);return T(r.firstPortName.set(o.target.value))}),l()(),s(9,"mat-form-field",31)(10,"mat-label"),d(11,"Name format"),l(),s(12,"input",59),g("input",function(o){k(e);let r=v(2);return T(r.portNameFormat.set(o.target.value))}),l()(),s(13,"mat-form-field",31)(14,"mat-label"),d(15,"Segment size"),l(),s(16,"input",60),g("input",function(o){k(e);let r=v(2);return T(r.portSegmentSize.set(+o.target.value))}),l()(),s(17,"mat-form-field",31)(18,"mat-label"),d(19,"Base MAC"),l(),s(20,"input",61),g("input",function(o){k(e);let r=v(2);return T(r.macAddress.set(o.target.value))}),l()(),s(21,"mat-form-field",31)(22,"mat-label"),d(23,"Type"),l(),s(24,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.networkType.set(o.value))}),Y(25,Ase,2,3,"mat-option",37,ase),l()(),s(27,"button",62),g("click",function(){k(e);let o=v(2);return T(o.openCustomAdaptersDialog())}),d(28," Configure custom adapters "),l(),s(29,"mat-checkbox",46),g("change",function(o){k(e);let r=v(2);return T(r.replicateNetworkConnectionState.set(o.checked))}),d(30,"Replicate network connection state"),l()()}if(n&2){let e=v(2);m(4),C("value",e.adapters()),m(4),C("value",e.firstPortName()),m(4),C("value",e.portNameFormat()),m(4),C("value",e.portSegmentSize()),m(4),C("value",e.macAddress()),m(4),C("value",e.networkType()),m(),Z(e.networkTypes),m(4),C("checked",e.replicateNetworkConnectionState())}}function Nse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function Fse(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,Nse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredAdvancedImages)}}function Rse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function Lse(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,Rse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredAdvancedImages)}}function Vse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function Bse(n,i){if(n&1&&(s(0,"mat-optgroup",53),Y(1,Vse,2,2,"mat-option",37,Fm),l()),n&2){let e=v(3);m(),Z(e.filteredAdvancedImages)}}function zse(n,i){if(n&1){let e=z();s(0,"mat-form-field",31)(1,"mat-label"),d(2,"Perecentage of CPU allowed"),l(),s(3,"input",74),g("input",function(o){k(e);let r=v(3);return T(r.cpuThrottling.set(+o.target.value))}),l()()}if(n&2){let e=v(3);m(3),C("value",e.cpuThrottling())}}function jse(n,i){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function $se(n,i){if(n&1){let e=z();s(0,"div",23)(1,"div",63)(2,"h4",64),d(3,"Linux boot specific settings"),l(),s(4,"div",25)(5,"input",65,7),g("change",function(o){k(e);let r=v(2);return T(r.uploadInitrdFile(o))}),l(),s(7,"button",55),g("click",function(){k(e);let o=Pe(6);return T(o.click())}),d(8," Upload "),l(),s(9,"mat-form-field",38)(10,"mat-label"),d(11,"Initial RAM disk (initrd)"),l(),s(12,"input",66),g("input",function(o){k(e);let r=v(2);return r.onAdvancedInput(o),T(r.initrd.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshQemuImages())}),l(),s(13,"mat-autocomplete",null,8),A(15,Fse,3,0,"mat-optgroup",53),l()()(),s(16,"div",25)(17,"input",65,9),g("change",function(o){k(e);let r=v(2);return T(r.uploadKernelImageFile(o))}),l(),s(19,"button",55),g("click",function(){k(e);let o=Pe(18);return T(o.click())}),d(20," Upload "),l(),s(21,"mat-form-field",38)(22,"mat-label"),d(23,"Kernel image"),l(),s(24,"input",67),g("input",function(o){k(e);let r=v(2);return r.onAdvancedInput(o),T(r.kernelImage.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshQemuImages())}),l(),s(25,"mat-autocomplete",null,10),A(27,Lse,3,0,"mat-optgroup",53),l()()(),s(28,"mat-form-field",31)(29,"mat-label"),d(30,"Kernel command line"),l(),s(31,"input",68),g("input",function(o){k(e);let r=v(2);return T(r.kernelCommandLine.set(o.target.value))}),l()()(),s(32,"div",63)(33,"h4",64),d(34,"Bios"),l(),s(35,"div",25)(36,"input",65,11),g("change",function(o){k(e);let r=v(2);return T(r.uploadBiosFile(o))}),l(),s(38,"button",55),g("click",function(){k(e);let o=Pe(37);return T(o.click())}),d(39," Upload "),l(),s(40,"mat-form-field",38)(41,"mat-label"),d(42,"Bios image"),l(),s(43,"input",69),g("input",function(o){k(e);let r=v(2);return r.onAdvancedInput(o),T(r.biosImage.set(o.target.value))})("focus",function(){k(e);let o=v(2);return T(o.refreshQemuImages())}),l(),s(44,"mat-autocomplete",null,12),A(46,Bse,3,0,"mat-optgroup",53),l()()()(),s(47,"div",63)(48,"h4",64),d(49,"Optimization"),l(),s(50,"mat-checkbox",46),g("change",function(o){k(e);let r=v(2);return T(r.activateCpuThrottling.set(o.checked))}),d(51,"Activate CPU throttling"),l(),A(52,zse,4,1,"mat-form-field",31),s(53,"mat-form-field",31)(54,"mat-label"),d(55,"Process priority"),l(),s(56,"mat-select",36),g("selectionChange",function(o){k(e);let r=v(2);return T(r.processPriority.set(o.value))}),Y(57,jse,2,2,"mat-option",37,Ae),l()()(),s(59,"div",63)(60,"h4",64),d(61,"Additional settings"),l(),s(62,"mat-form-field",31)(63,"mat-label"),d(64,"Custom Qemu binary path"),l(),s(65,"input",70),g("input",function(o){k(e);let r=v(2);return T(r.qemuPath.set(o.target.value))}),l()(),s(66,"mat-form-field",31)(67,"mat-label"),d(68,"Options"),l(),s(69,"input",71),g("input",function(o){k(e);let r=v(2);return T(r.options.set(o.target.value))}),l()(),s(70,"mat-checkbox",46),g("change",function(o){k(e);let r=v(2);return T(r.linkedClone.set(o.checked))}),d(71,"Use as a linked base VM"),l(),s(72,"mat-checkbox",46),g("change",function(o){k(e);let r=v(2);return T(r.tpm.set(o.checked))}),d(73,"Enable the Trusted Platform Module (TPM)"),l(),s(74,"mat-checkbox",46),g("change",function(o){k(e);let r=v(2);return T(r.uefi.set(o.checked))}),d(75,"Enable the UEFI boot mode"),l(),s(76,"div",72)(77,"mat-form-field",31)(78,"mat-label"),d(79,"Max CPUs (hot-plug)"),l(),s(80,"input",73),g("input",function(o){k(e);let r=v(2);return T(r.maxcpus.set(+o.target.value))}),l()(),s(81,"mat-checkbox",46),g("change",function(o){k(e);let r=v(2);return T(r.createConfigDisk.set(o.checked))}),d(82,"Auto-create config disk"),l()()()()}if(n&2){let e=Pe(14),t=Pe(26),o=Pe(45),r=v(2);m(12),C("value",r.initrd())("matAutocomplete",e),m(3),O(r.filteredAdvancedImages.length?15:-1),m(9),C("value",r.kernelImage())("matAutocomplete",t),m(3),O(r.filteredAdvancedImages.length?27:-1),m(4),C("value",r.kernelCommandLine()),m(12),C("value",r.biosImage())("matAutocomplete",o),m(3),O(r.filteredAdvancedImages.length?46:-1),m(4),C("checked",r.activateCpuThrottling()),m(2),O(r.activateCpuThrottling()?52:-1),m(4),C("value",r.processPriority()),m(),Z(r.priorities),m(8),C("value",r.qemuPath()),m(4),C("value",r.options()),m(),C("checked",r.linkedClone()),m(2),C("checked",r.tpm()),m(2),C("checked",r.uefi()),m(6),C("value",r.maxcpus()),m(),C("checked",r.createConfigDisk())}}function Hse(n,i){if(n&1){let e=z();s(0,"div",26)(1,"mat-form-field",75)(2,"mat-label"),d(3,"Usage notes"),l(),s(4,"textarea",76),g("input",function(o){k(e);let r=v(2);return T(r.usage.set(o.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function Use(n,i){if(n&1){let e=z();s(0,"main",17)(1,"section",19)(2,"div",20),g("click",function(){k(e);let o=v();return T(o.toggleSection("general"))}),s(3,"h3",21),d(4,"General settings"),l(),s(5,"mat-icon",22),d(6),l()(),A(7,fse,75,14,"form",23),l(),s(8,"section",19)(9,"div",20),g("click",function(){k(e);let o=v();return T(o.toggleSection("hdd"))}),s(10,"h3",21),d(11,"HDD"),l(),s(12,"mat-icon",22),d(13),l()(),A(14,Ese,65,16,"div",24),l(),s(15,"section",19)(16,"div",20),g("click",function(){k(e);let o=v();return T(o.toggleSection("cddvd"))}),s(17,"h3",21),d(18,"CD/DVD"),l(),s(19,"mat-icon",22),d(20),l()(),A(21,Ise,12,3,"div",25),l(),s(22,"section",19)(23,"div",20),g("click",function(){k(e);let o=v();return T(o.toggleSection("network"))}),s(24,"h3",21),d(25,"Network"),l(),s(26,"mat-icon",22),d(27),l()(),A(28,Ose,31,7,"form",23),l(),s(29,"section",19)(30,"div",20),g("click",function(){k(e);let o=v();return T(o.toggleSection("advanced"))}),s(31,"h3",21),d(32,"Advanced"),l(),s(33,"mat-icon",22),d(34),l()(),A(35,$se,83,20,"div",23),l(),s(36,"section",19)(37,"div",20),g("click",function(){k(e);let o=v();return T(o.toggleSection("usage"))}),s(38,"h3",21),d(39,"Usage"),l(),s(40,"mat-icon",22),d(41),l()(),A(42,Hse,5,1,"div",26),l(),s(43,"div",27)(44,"button",28),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(45,"Cancel"),l(),s(46,"button",29),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(47,"Save"),l()()()}if(n&2){let e=v();m(6),j(e.generalSettingsExpanded?"expand_less":"expand_more"),m(),O(e.generalSettingsExpanded?7:-1),m(6),j(e.hddExpanded?"expand_less":"expand_more"),m(),O(e.hddExpanded?14:-1),m(6),j(e.cdDvdExpanded?"expand_less":"expand_more"),m(),O(e.cdDvdExpanded?21:-1),m(6),j(e.networkExpanded?"expand_less":"expand_more"),m(),O(e.networkExpanded?28:-1),m(6),j(e.advancedExpanded?"expand_less":"expand_more"),m(),O(e.advancedExpanded?35:-1),m(6),j(e.usageExpanded?"expand_less":"expand_more"),m(),O(e.usageExpanded?42:-1)}}var Px=(()=>{class n{route=f(lt);controllerService=f(Je);qemuService=f(Kr);toasterService=f(te);configurationService=f(Om);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);validationService=f(iP);imageManagerService=f(Lc);controller;qemuTemplate;consoleTypes=[];auxConsoleTypes=[];diskInterfaces=[];networkTypes=[];bootPriorities=[];onCloseOptions=[];categories=[];priorities=[];displayedColumns=["adapter_number","port_name","adapter_type","mac_address","actions"];selectPlatform=[];qemuImages=[];filteredImages=[];globalImages=[];filteredGlobalImages=[];filteredAdvancedImages=[];separatorKeysCodes=[13,188];generalSettingsExpanded=!1;hddExpanded=!1;cdDvdExpanded=!1;networkExpanded=!1;advancedExpanded=!1;usageExpanded=!1;templateName=U("");defaultName=U("");symbol=U("");category=U("");platform=U("");ram=U(256);cpus=U(1);bootPriority=U("");onClose=U("");consoleType=U("");auxConsoleType=U("");consoleAutoStart=U(!1);hdaDiskImage=U("");hdaDiskInterface=U("");hdbDiskImage=U("");hdbDiskInterface=U("");hdcDiskImage=U("");hdcDiskInterface=U("");hddDiskImage=U("");hddDiskInterface=U("");cdromImage=U("");adapters=U(0);firstPortName=U("");portNameFormat=U("");portSegmentSize=U(0);macAddress=U("");networkType=U("");replicateNetworkConnectionState=U(!1);initrd=U("");kernelImage=U("");kernelCommandLine=U("");biosImage=U("");activateCpuThrottling=U(!1);cpuThrottling=U(0);maxcpus=U(1);createConfigDisk=U(!1);processPriority=U("");qemuPath=U("");options=U("");linkedClone=U(!1);tpm=U(!1);uefi=U(!1);usage=U("");tags=U([]);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.getConfiguration(),this.qemuService.getImages(this.controller).subscribe({next:r=>{let a=r.filter((c,p,u)=>u.findIndex(h=>h.filename===c.filename)===p);this.qemuImages=a,this.filteredImages=a,this.filteredAdvancedImages=a,this.cd.markForCheck()},error:r=>{this.toasterService.error(r.error?.message||r.message||"Failed to load images")}}),this.imageManagerService.getImages(this.controller).subscribe({next:r=>{this.globalImages=r,this.filteredGlobalImages=r,this.cd.markForCheck()},error:r=>{this.toasterService.error(r.error?.message||r.message||"Failed to load global images")}}),this.qemuService.getTemplate(this.controller,t).subscribe({next:r=>{this.qemuTemplate=r,this.qemuTemplate.tags||(this.qemuTemplate.tags=[]),this.initFormFromTemplate(),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load QEMU template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()}),this.selectPlatform=this.configurationService.getPlatform()}initFormFromTemplate(){this.templateName.set(this.qemuTemplate.name||""),this.defaultName.set(this.qemuTemplate.default_name_format||""),this.symbol.set(this.qemuTemplate.symbol||""),this.category.set(this.qemuTemplate.category||""),this.platform.set(this.qemuTemplate.platform||""),this.ram.set(this.qemuTemplate.ram||256),this.cpus.set(this.qemuTemplate.cpus||1),this.bootPriority.set(this.qemuTemplate.boot_priority||""),this.onClose.set(this.qemuTemplate.on_close||""),this.consoleType.set(this.qemuTemplate.console_type||""),this.auxConsoleType.set(this.qemuTemplate.aux_type||""),this.consoleAutoStart.set(this.qemuTemplate.console_auto_start||!1),this.hdaDiskImage.set(this.qemuTemplate.hda_disk_image||""),this.hdaDiskInterface.set(this.qemuTemplate.hda_disk_interface||""),this.hdbDiskImage.set(this.qemuTemplate.hdb_disk_image||""),this.hdbDiskInterface.set(this.qemuTemplate.hdb_disk_interface||""),this.hdcDiskImage.set(this.qemuTemplate.hdc_disk_image||""),this.hdcDiskInterface.set(this.qemuTemplate.hdc_disk_interface||""),this.hddDiskImage.set(this.qemuTemplate.hdd_disk_image||""),this.hddDiskInterface.set(this.qemuTemplate.hdd_disk_interface||""),this.cdromImage.set(this.qemuTemplate.cdrom_image||""),this.adapters.set(this.qemuTemplate.adapters||0),this.firstPortName.set(this.qemuTemplate.first_port_name||""),this.portNameFormat.set(this.qemuTemplate.port_name_format||""),this.portSegmentSize.set(this.qemuTemplate.port_segment_size||0),this.macAddress.set(this.qemuTemplate.mac_address||""),this.networkType.set(this.qemuTemplate.adapter_type||""),this.replicateNetworkConnectionState.set(this.qemuTemplate.replicate_network_connection_state||!1),this.initrd.set(this.qemuTemplate.initrd||""),this.kernelImage.set(this.qemuTemplate.kernel_image||""),this.kernelCommandLine.set(this.qemuTemplate.kernel_command_line||""),this.biosImage.set(this.qemuTemplate.bios_image||""),this.activateCpuThrottling.set(this.qemuTemplate.cpu_throttling!==void 0&&this.qemuTemplate.cpu_throttling>0),this.cpuThrottling.set(this.qemuTemplate.cpu_throttling||0),this.maxcpus.set(this.qemuTemplate.maxcpus||1),this.createConfigDisk.set(this.qemuTemplate.create_config_disk??!1),this.processPriority.set(this.qemuTemplate.process_priority||""),this.qemuPath.set(this.qemuTemplate.qemu_path||""),this.options.set(this.qemuTemplate.options||""),this.linkedClone.set(this.qemuTemplate.linked_clone||!1),this.tpm.set(this.qemuTemplate.tpm||!1),this.uefi.set(this.qemuTemplate.uefi||!1),this.usage.set(this.qemuTemplate.usage||""),this.tags.set(this.qemuTemplate.tags||[])}getConfiguration(){this.consoleTypes=this.configurationService.getConsoleTypes(),this.auxConsoleTypes=this.configurationService.getAuxConsoleTypes(),this.diskInterfaces=this.configurationService.getDiskInterfaces(),this.networkTypes=this.configurationService.getNetworkTypes(),this.bootPriorities=this.configurationService.getBootPriorities(),this.onCloseOptions=this.configurationService.getOnCloseOptions(),this.categories=this.configurationService.getCategories(),this.priorities=this.configurationService.getPriorities()}uploadFile(e,t){let o=e.name;this.imageManagerService.uploadedImage(this.controller,!1,o,e).subscribe({next:()=>{t.set(o),this.refreshGlobalImages(),this.toasterService.success(`Uploaded ${o}`),this.cd.markForCheck()},error:r=>{this.toasterService.error(r.error?.message||r.message||"Failed to upload")}})}refreshGlobalImages(){this.imageManagerService.getImages(this.controller).subscribe({next:e=>{this.globalImages=e,this.filteredGlobalImages=e,this.cd.markForCheck()}})}refreshQemuImages(){this.qemuService.getImages(this.controller).subscribe({next:e=>{let t=e.filter((o,r,a)=>a.findIndex(c=>c.filename===o.filename)===r);this.qemuImages=t,this.filteredImages=t,this.filteredAdvancedImages=t,this.cd.markForCheck()}})}uploadCdromImageFile(e){let t=e.target;t.files&&t.files.length>0&&this.uploadFile(t.files[0],this.cdromImage)}uploadInitrdFile(e){let t=e.target;t.files&&t.files.length>0&&this.uploadFile(t.files[0],this.initrd)}uploadKernelImageFile(e){let t=e.target;t.files&&t.files.length>0&&this.uploadFile(t.files[0],this.kernelImage)}uploadBiosFile(e){let t=e.target;t.files&&t.files.length>0&&this.uploadFile(t.files[0],this.biosImage)}openCustomAdaptersDialog(){let e=this.portNameFormat()||"Ethernet{0}",t=this.portSegmentSize()||0,o=this.networkType()||"e1000",r=this.adapters(),a=this.qemuTemplate.custom_adapters||[],c=[];for(let u=0;u<r;u++){let h=a.find(_=>_.adapter_number===u);if(h)c.push({adapter_number:h.adapter_number,adapter_type:h.adapter_type,port_name:h.port_name,mac_address:h.mac_address||""});else{let _;if(t>0){let S=Math.floor(u/t),x=u%t;_=e.replace("{0}",String(S*t+x))}else _=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:o,port_name:_,mac_address:""})}}this.dialog.open(Vc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:o,currentAdapters:r}}).afterClosed().subscribe(u=>{u&&(this.qemuTemplate.custom_adapters=u.adapters,u.requiredAdapters!==void 0&&this.adapters.set(u.requiredAdapters),this.cd.markForCheck())})}onCdromInput(e){let t=e.target.value.toLowerCase(),o=this.globalImages.filter(r=>r.filename.toLowerCase().includes(t));this.filteredGlobalImages=o}onAdvancedInput(e){let t=e.target.value.toLowerCase();this.filteredAdvancedImages=this.qemuImages.filter(o=>o.filename.toLowerCase().includes(t))}filterImages(e){let t=e.target.value.toLowerCase();return this.qemuImages.filter(o=>o.filename.toLowerCase().includes(t))}onHdaImageInput(e){this.filteredImages=this.filterImages(e)}onHdbImageInput(e){this.filteredImages=this.filterImages(e)}onHdcImageInput(e){this.filteredImages=this.filterImages(e)}onHddImageInput(e){this.filteredImages=this.filterImages(e)}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","qemu","templates"])}onSave(){let e=this.validationService.validateName(this.templateName());if(!e.isValid){this.toasterService.error(e.errorMessage);return}let t=this.validationService.validatePortNameFormat(this.portNameFormat());if(!t.isValid){this.toasterService.error(t.errorMessage);return}let o=this.validationService.validateFirstPortName(this.firstPortName());if(!o.isValid){this.toasterService.error(o.errorMessage);return}let r=this.validationService.validatePortSegmentSize(this.portSegmentSize().toString());if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.validateMacAddress(this.macAddress());if(!a.isValid){this.toasterService.error(a.errorMessage);return}this.qemuTemplate.name=this.templateName(),this.qemuTemplate.default_name_format=this.defaultName(),this.qemuTemplate.symbol=this.symbol(),this.qemuTemplate.category=this.category(),this.qemuTemplate.platform=this.platform(),this.qemuTemplate.ram=this.ram(),this.qemuTemplate.cpus=this.cpus(),this.qemuTemplate.boot_priority=this.bootPriority(),this.qemuTemplate.on_close=this.onClose(),this.qemuTemplate.console_type=this.consoleType(),this.qemuTemplate.aux_type=this.auxConsoleType(),this.qemuTemplate.console_auto_start=this.consoleAutoStart(),this.qemuTemplate.hda_disk_image=this.hdaDiskImage(),this.qemuTemplate.hda_disk_interface=this.hdaDiskInterface(),this.qemuTemplate.hdb_disk_image=this.hdbDiskImage(),this.qemuTemplate.hdb_disk_interface=this.hdbDiskInterface(),this.qemuTemplate.hdc_disk_image=this.hdcDiskImage(),this.qemuTemplate.hdc_disk_interface=this.hdcDiskInterface(),this.qemuTemplate.hdd_disk_image=this.hddDiskImage(),this.qemuTemplate.hdd_disk_interface=this.hddDiskInterface(),this.qemuTemplate.cdrom_image=this.cdromImage(),this.qemuTemplate.adapters=this.adapters(),this.qemuTemplate.first_port_name=this.firstPortName(),this.qemuTemplate.port_name_format=this.portNameFormat(),this.qemuTemplate.port_segment_size=this.portSegmentSize(),this.qemuTemplate.mac_address=this.macAddress(),this.qemuTemplate.adapter_type=this.networkType(),this.qemuTemplate.replicate_network_connection_state=this.replicateNetworkConnectionState(),this.qemuTemplate.initrd=this.initrd(),this.qemuTemplate.kernel_image=this.kernelImage(),this.qemuTemplate.kernel_command_line=this.kernelCommandLine(),this.qemuTemplate.bios_image=this.biosImage(),this.qemuTemplate.cpu_throttling=this.activateCpuThrottling()?this.cpuThrottling():0,this.qemuTemplate.maxcpus=this.maxcpus(),this.qemuTemplate.create_config_disk=this.createConfigDisk(),this.qemuTemplate.process_priority=this.processPriority(),this.qemuTemplate.qemu_path=this.qemuPath(),this.qemuTemplate.options=this.options(),this.qemuTemplate.linked_clone=this.linkedClone(),this.qemuTemplate.tpm=this.tpm(),this.qemuTemplate.uefi=this.uefi(),this.qemuTemplate.usage=this.usage(),this.qemuTemplate.tags=this.tags(),this.qemuService.saveTemplate(this.controller,this.qemuTemplate).subscribe({next:c=>{this.toasterService.success("Changes saved"),this.qemuTemplate=c,this.initFormFromTemplate(),this.cd.markForCheck()},error:c=>{let p=c.error?.message||c.message||"Failed to save QEMU template";this.toasterService.error(p),this.cd.markForCheck()}})}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.symbol()}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&this.symbol.set(o)})}addTag(e){let t=(e.value||"").trim(),o=this.tags();t&&this.tags.set([...o,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),o=t.indexOf(e);if(o>=0){let r=[...t];r.splice(o,1),this.tags.set(r)}}toggleSection(e){switch(e){case"general":this.generalSettingsExpanded=!this.generalSettingsExpanded;break;case"hdd":this.hddExpanded=!this.hddExpanded;break;case"cddvd":this.cdDvdExpanded=!this.cdDvdExpanded;break;case"network":this.networkExpanded=!this.networkExpanded;break;case"advanced":this.advancedExpanded=!this.advancedExpanded;break;case"usage":this.usageExpanded=!this.usageExpanded;break}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-qemu-virtual-machine-template-details"]],inputs:{templateName:[1,"templateName"],defaultName:[1,"defaultName"],symbol:[1,"symbol"],category:[1,"category"],platform:[1,"platform"],ram:[1,"ram"],cpus:[1,"cpus"],bootPriority:[1,"bootPriority"],onClose:[1,"onClose"],consoleType:[1,"consoleType"],auxConsoleType:[1,"auxConsoleType"],consoleAutoStart:[1,"consoleAutoStart"],hdaDiskImage:[1,"hdaDiskImage"],hdaDiskInterface:[1,"hdaDiskInterface"],hdbDiskImage:[1,"hdbDiskImage"],hdbDiskInterface:[1,"hdbDiskInterface"],hdcDiskImage:[1,"hdcDiskImage"],hdcDiskInterface:[1,"hdcDiskInterface"],hddDiskImage:[1,"hddDiskImage"],hddDiskInterface:[1,"hddDiskInterface"],cdromImage:[1,"cdromImage"],adapters:[1,"adapters"],firstPortName:[1,"firstPortName"],portNameFormat:[1,"portNameFormat"],portSegmentSize:[1,"portSegmentSize"],macAddress:[1,"macAddress"],networkType:[1,"networkType"],replicateNetworkConnectionState:[1,"replicateNetworkConnectionState"],initrd:[1,"initrd"],kernelImage:[1,"kernelImage"],kernelCommandLine:[1,"kernelCommandLine"],biosImage:[1,"biosImage"],activateCpuThrottling:[1,"activateCpuThrottling"],cpuThrottling:[1,"cpuThrottling"],maxcpus:[1,"maxcpus"],createConfigDisk:[1,"createConfigDisk"],processPriority:[1,"processPriority"],qemuPath:[1,"qemuPath"],options:[1,"options"],linkedClone:[1,"linkedClone"],tpm:[1,"tpm"],uefi:[1,"uefi"],usage:[1,"usage"],tags:[1,"tags"]},outputs:{templateName:"templateNameChange",defaultName:"defaultNameChange",symbol:"symbolChange",category:"categoryChange",platform:"platformChange",ram:"ramChange",cpus:"cpusChange",bootPriority:"bootPriorityChange",onClose:"onCloseChange",consoleType:"consoleTypeChange",auxConsoleType:"auxConsoleTypeChange",consoleAutoStart:"consoleAutoStartChange",hdaDiskImage:"hdaDiskImageChange",hdaDiskInterface:"hdaDiskInterfaceChange",hdbDiskImage:"hdbDiskImageChange",hdbDiskInterface:"hdbDiskInterfaceChange",hdcDiskImage:"hdcDiskImageChange",hdcDiskInterface:"hdcDiskInterfaceChange",hddDiskImage:"hddDiskImageChange",hddDiskInterface:"hddDiskInterfaceChange",cdromImage:"cdromImageChange",adapters:"adaptersChange",firstPortName:"firstPortNameChange",portNameFormat:"portNameFormatChange",portSegmentSize:"portSegmentSizeChange",macAddress:"macAddressChange",networkType:"networkTypeChange",replicateNetworkConnectionState:"replicateNetworkConnectionStateChange",initrd:"initrdChange",kernelImage:"kernelImageChange",kernelCommandLine:"kernelCommandLineChange",biosImage:"biosImageChange",activateCpuThrottling:"activateCpuThrottlingChange",cpuThrottling:"cpuThrottlingChange",maxcpus:"maxcpusChange",createConfigDisk:"createConfigDiskChange",processPriority:"processPriorityChange",qemuPath:"qemuPathChange",options:"optionsChange",linkedClone:"linkedCloneChange",tpm:"tpmChange",uefi:"uefiChange",usage:"usageChange",tags:"tagsChange"},decls:6,vars:2,consts:[["chipList",""],["hdaAuto","matAutocomplete"],["hdbAuto","matAutocomplete"],["hdcAuto","matAutocomplete"],["hddAuto","matAutocomplete"],["filecdrom",""],["cdromAuto","matAutocomplete"],["fileinitrd",""],["initrdAuto","matAutocomplete"],["filekernelimage",""],["kernelAuto","matAutocomplete"],["filebios",""],["biosAuto","matAutocomplete"],[1,"qemu-template-details"],[1,"qemu-template-details__header"],["mat-icon-button","",1,"qemu-template-details__back-btn"],[1,"qemu-template-details__title"],[1,"qemu-template-details__content"],["mat-icon-button","",1,"qemu-template-details__back-btn",3,"click"],[1,"qemu-template-details__form-card"],[1,"qemu-template-details__section-header",3,"click"],[1,"qemu-template-details__section-title"],[1,"qemu-template-details__expand-icon"],[1,"qemu-template-details__form"],[1,"qemu-template-details__disk-grid"],[1,"qemu-template-details__file-row"],[1,"preferences__usage-form"],[1,"qemu-template-details__actions"],["mat-button","",1,"qemu-template-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"qemu-template-details__save-btn",3,"click"],[1,"two-column-grid"],["appearance","fill",1,"qemu-template-details__field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],[1,"qemu-template-details__symbol-row"],["appearance","fill",1,"qemu-template-details__field","qemu-template-details__field--category"],[3,"selectionChange","value"],[3,"value"],["appearance","fill",1,"qemu-template-details__field","qemu-template-details__field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"qemu-template-details__symbol-btn",3,"click"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"four-column-grid"],["matInput","","type","text","placeholder","RAM",3,"input","value"],["matSuffix",""],["matInput","","type","text","placeholder","vCPUs",3,"input","value"],[3,"change","checked"],[3,"removed"],["matChipRemove",""],[1,"qemu-template-details__disk-item"],[1,"qemu-template-details__disk-title"],["matInput","","placeholder","Disk image",3,"input","focus","value","matAutocomplete"],[3,"optionSelected"],["label","Global images"],["type","file","accept",".iso",1,"qemu-template-details__file-input",3,"change"],["mat-raised-button","","color","primary",1,"qemu-template-details__browse-btn",3,"click"],["matInput","","type","text","placeholder","Image",3,"input","focus","value","matAutocomplete"],["matInput","","type","number","min","0","placeholder","Adapters",3,"input","value"],["matInput","","type","text","placeholder","First port name",3,"input","value"],["matInput","","type","text","placeholder","Name format",3,"input","value"],["matInput","","type","number","min","0","placeholder","Segment size",3,"input","value"],["matInput","","type","text","placeholder","Base MAC",3,"input","value"],["mat-button","","type","button",1,"qemu-template-details__config-btn",3,"click"],[1,"qemu-template-details__subsection"],[1,"qemu-template-details__subsection-title"],["type","file",1,"qemu-template-details__file-input",3,"change"],["matInput","","type","text","placeholder","Initial RAM disk (initrd)",3,"input","focus","value","matAutocomplete"],["matInput","","type","text","placeholder","Kernel image",3,"input","focus","value","matAutocomplete"],["matInput","","type","text","placeholder","Kernel command line",3,"input","value"],["matInput","","type","text","placeholder","Bios image",3,"input","focus","value","matAutocomplete"],["matInput","","type","text","placeholder","Custom Qemu binary path",3,"input","value"],["matInput","","type","text","placeholder","Options",3,"input","value"],[1,"two-column-grid",2,"margin-top","12px"],["matInput","","type","text","placeholder","Max CPUs",3,"input","value"],["matInput","","type","number","placeholder","Perecentage of CPU allowed",3,"input","value"],["appearance","fill",1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",13)(1,"header",14),A(2,sse,3,0,"button",15),s(3,"h1",16),d(4,"QEMU VM template configuration"),l()(),A(5,Use,48,12,"main",17),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.qemuTemplate?5:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,ie,de,W,pe,je,we,Me,et,Mi,Se,Ee,vt,At,_t,EC,ti,Jn,vi,Ci,mi,Ot,Gt,Yr,Sa,Ko],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.qemu-template-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.qemu-template-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.qemu-template-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.qemu-template-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.qemu-template-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.qemu-template-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.qemu-template-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px}.qemu-template-details__form[_ngcontent-%COMP%]{padding:16px 24px 24px;display:flex;flex-direction:column;gap:16px}.qemu-template-details__form[_ngcontent-%COMP%] .two-column-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:16px}.qemu-template-details__field[_ngcontent-%COMP%]{width:100%}.qemu-template-details__field--flex[_ngcontent-%COMP%]{flex:1}.qemu-template-details__field--category[_ngcontent-%COMP%]{flex:0 0 150px}.four-column-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:16px}.qemu-template-details__field--full[_ngcontent-%COMP%]{width:100%}.qemu-template-details__section-title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.qemu-template-details__section-header[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background-color .2s ease;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.qemu-template-details__section-header[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.qemu-template-details__expand-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:transform .2s ease}.qemu-template-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.qemu-template-details__symbol-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.qemu-template-details__file-row[_ngcontent-%COMP%]{padding:16px 24px;display:flex;align-items:flex-start;gap:16px}.qemu-template-details__file-input[_ngcontent-%COMP%]{display:none}.qemu-template-details__browse-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.qemu-template-details__config-btn[_ngcontent-%COMP%]{margin-top:8px}.qemu-template-details__disk-grid[_ngcontent-%COMP%]{padding:16px 24px 24px;display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.qemu-template-details__disk-item[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--mat-sys-surface-variant) 50%,transparent);border-radius:12px;padding:16px}.qemu-template-details__disk-title[_ngcontent-%COMP%]{margin:0 0 12px;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.qemu-template-details__subsection[_ngcontent-%COMP%]{padding-top:16px;border-top:1px solid color-mix(in srgb,var(--mat-sys-outline) 20%,transparent)}.qemu-template-details__subsection[_ngcontent-%COMP%]:first-child{padding-top:0;border-top:none}.qemu-template-details__subsection-title[_ngcontent-%COMP%]{margin:0 0 12px;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.qemu-template-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.qemu-template-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.qemu-template-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.qemu-template-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.qemu-template-details__section-header[_ngcontent-%COMP%]{padding:12px 16px}.qemu-template-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.qemu-template-details__title[_ngcontent-%COMP%]{font-size:22px}.qemu-template-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.qemu-template-details__form[_ngcontent-%COMP%]{padding:16px}.qemu-template-details__symbol-row[_ngcontent-%COMP%]{flex-direction:column}.qemu-template-details__file-row[_ngcontent-%COMP%]{flex-direction:column;padding:16px}.qemu-template-details__disk-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.qemu-template-details__actions[_ngcontent-%COMP%]{flex-direction:column}.qemu-template-details__cancel-btn[_ngcontent-%COMP%], .qemu-template-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Gse=(n,i)=>i.template_id;function Wse(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences")}}function qse(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/qemu/addtemplate")}}function Qse(n,i){n&1&&R(0,"app-empty-templates-list")}function Xse(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"memory"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"a",15)(11,"mat-icon"),d(12,"edit"),l(),s(13,"span"),d(14,"Edit"),l()(),s(15,"button",16),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.copyTemplate(o))}),s(16,"mat-icon"),d(17,"content_copy"),l(),s(18,"span"),d(19,"Copy"),l()(),s(20,"button",16),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(21,"mat-icon"),d(22,"delete"),l(),s(23,"span"),d(24,"Delete"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(5),C("routerLink",e.template_id)}}function Kse(n,i){if(n&1&&(s(0,"nav",8),Y(1,Xse,25,4,"div",10,Gse),l()),n&2){let e=v();m(),Z(e.qemuTemplates)}}var Ix=(()=>{class n{route=f(lt);controllerService=f(Je);qemuService=f(Kr);toasterService=f(te);router=f(ht);cd=f(Q);controller;qemuTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.qemuService.getTemplates(this.controller).subscribe({next:e=>{this.qemuTemplates=e.filter(t=>t.template_type==="qemu"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load QEMU templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}copyTemplate(e){this.router.navigate(["/controller",this.controller.id,"preferences","qemu","templates",e.template_id,"copy"])}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-qemu-virtual-machines-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"qemu-vm-templates"],[1,"qemu-vm-templates__header"],["mat-icon-button","",1,"qemu-vm-templates__back-btn",3,"routerLink"],[1,"qemu-vm-templates__title"],["matTooltip","Add QEMU VM template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"qemu-vm-templates__add-btn",3,"routerLink"],[1,"qemu-vm-templates__content"],[1,"qemu-vm-templates__list"],[3,"deleteEvent","controller"],[1,"qemu-vm-templates__list-item",3,"routerLink"],[1,"qemu-vm-templates__list-icon"],[1,"qemu-vm-templates__list-name"],["mat-icon-button","",1,"qemu-vm-templates__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"routerLink"],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,Wse,3,1,"button",4),s(3,"h1",5),d(4,"QEMU VM templates"),l(),A(5,qse,3,1,"button",6),l(),s(6,"main",7),A(7,Qse,1,0,"app-empty-templates-list"),A(8,Kse,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.qemuTemplates.length?-1:7),m(),O(o.qemuTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.qemu-vm-templates__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.qemu-vm-templates__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.qemu-vm-templates__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.qemu-vm-templates__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.qemu-vm-templates__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.qemu-vm-templates__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.qemu-vm-templates__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.qemu-vm-templates__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.qemu-vm-templates__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.qemu-vm-templates__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.qemu-vm-templates__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.qemu-vm-templates__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.qemu-vm-templates__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.qemu-vm-templates__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.qemu-vm-templates__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.qemu-vm-templates__back-btn[_ngcontent-%COMP%], .qemu-vm-templates__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.qemu-vm-templates__title[_ngcontent-%COMP%]{font-size:24px}.qemu-vm-templates__content[_ngcontent-%COMP%]{padding:0 16px 16px}.qemu-vm-templates__list-item[_ngcontent-%COMP%]{padding:14px 16px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Rm=(()=>{class n{httpController;constructor(e){this.httpController=e}getTemplates(e){return this.httpController.get(e,"/templates")}getTemplate(e,t){return this.httpController.get(e,`/templates/${t}`)}addTemplate(e,t){return this.httpController.post(e,"/templates",t)}saveTemplate(e,t){return this.httpController.put(e,`/templates/${t.template_id}`,t)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function Yse(n,i){if(n&1){let e=z();s(0,"button",14),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Ax=(()=>{class n{route=f(lt);controllerService=f(Je);vpcsService=f(Rm);router=f(ht);toasterService=f(te);templateMocksService=f(xa);formBuilder=f(Vn);computeService=f(ko);cd=f(Q);controller;templateName="";templateNameForm;isLocalComputerChosen=!0;constructor(){this.templateNameForm=this.formBuilder.group({templateName:new Ye(null,[Ue.required])})}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}setControllerType(e){e==="local"&&(this.isLocalComputerChosen=!0)}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","vpcs","templates"])}addTemplate(){this.templateNameForm.invalid?this.toasterService.error("Fill all required fields"):(this.templateName=this.templateNameForm.get("templateName").value,this.templateMocksService.getVpcsTemplate().subscribe({next:e=>{let t=e;t.template_id=Ai(),t.name=this.templateName,t.compute_id="local",this.vpcsService.addTemplate(this.controller,t).subscribe({next:()=>{this.goBack()},error:o=>{let r=o.error?.message||o.message||"Failed to add vpcs template";this.toasterService.error(r),this.cd.markForCheck()}})},error:e=>{let t=e.error?.message||e.message||"Failed to load VPCS template";this.toasterService.error(t),this.cd.markForCheck()}}))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-vpcs-template"]],decls:20,vars:3,consts:[[1,"vpcs-add"],[1,"vpcs-add__header"],["mat-icon-button","",1,"vpcs-add__back-btn"],[1,"vpcs-add__title"],[1,"vpcs-add__content"],[1,"vpcs-add__form-card"],[1,"vpcs-add__radio-group"],["value","1",1,"vpcs-add__radio",3,"click","checked"],[1,"vpcs-add__form",3,"formGroup"],["appearance","fill",1,"vpcs-add__field"],["matInput","","formControlName","templateName","type","text","placeholder","Template name"],[1,"vpcs-add__actions"],["mat-button","",1,"vpcs-add__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"vpcs-add__submit-btn",3,"click"],["mat-icon-button","",1,"vpcs-add__back-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"header",1),A(2,Yse,3,0,"button",2),s(3,"h1",3),d(4,"New VPCS node template"),l()(),s(5,"main",4)(6,"section",5)(7,"mat-radio-group",6)(8,"mat-radio-button",7),g("click",function(){return o.setControllerType("local")}),d(9," Run the VPCS node locally "),l()(),s(10,"form",8)(11,"mat-form-field",9)(12,"mat-label"),d(13,"Template name"),l(),R(14,"input",10),l()()(),s(15,"div",11)(16,"button",12),g("click",function(){return o.goBack()}),d(17,"Cancel"),l(),s(18,"button",13),g("click",function(){return o.addTemplate()}),d(19," Add template "),l()()()()),t&2&&(m(2),O(o.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",o.templateNameForm))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,dt,ie,de,W,pe,je,Mt,io,xo,ho,we,Me,et,Se,Ee],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.vpcs-add__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.vpcs-add__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.vpcs-add__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.vpcs-add__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.vpcs-add__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.vpcs-add__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);padding:24px}.vpcs-add__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.vpcs-add__radio[_ngcontent-%COMP%]{font-size:16px}.vpcs-add__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.vpcs-add__field[_ngcontent-%COMP%]{width:100%}.vpcs-add__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.vpcs-add__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.vpcs-add__submit-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.vpcs-add__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.vpcs-add__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.vpcs-add__title[_ngcontent-%COMP%]{font-size:24px}.vpcs-add__content[_ngcontent-%COMP%]{padding:0 16px 16px}.vpcs-add__form-card[_ngcontent-%COMP%]{padding:16px}.vpcs-add__actions[_ngcontent-%COMP%]{flex-direction:column}.vpcs-add__cancel-btn[_ngcontent-%COMP%], .vpcs-add__submit-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var Lm=(()=>{class n{getConsoleTypes(){return["telnet","ssh","none"]}getCategories(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function Zse(n,i){if(n&1){let e=z();s(0,"button",6),g("click",function(){k(e);let o=v();return T(o.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Jse(n,i){if(n&1){let e=z();s(0,"mat-chip",28),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",29),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function ele(n,i){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function tle(n,i){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function nle(n,i){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"h3",8),d(3,"General settings"),l(),s(4,"form",9)(5,"mat-form-field",10)(6,"mat-label"),d(7,"Template name"),l(),s(8,"input",11),g("input",function(o){k(e);let r=v();return T(r.templateName.set(o.target.value))}),l()(),s(9,"mat-form-field",10)(10,"mat-label"),d(11,"Default name format"),l(),s(12,"input",12),g("input",function(o){k(e);let r=v();return T(r.defaultName.set(o.target.value))}),l()(),s(13,"mat-form-field",10)(14,"mat-label"),d(15,"Base script file"),l(),s(16,"input",13),g("input",function(o){k(e);let r=v();return T(r.scriptFile.set(o.target.value))}),l()(),s(17,"div",14)(18,"mat-form-field",15)(19,"mat-label"),d(20,"Symbol"),l(),s(21,"input",16),g("input",function(o){k(e);let r=v();return T(r.symbol.set(o.target.value))}),l()(),s(22,"button",17),g("click",function(){k(e);let o=v();return T(o.chooseSymbol())}),d(23,"Choose symbol"),l()(),s(24,"mat-form-field",10)(25,"mat-label"),d(26,"Tags"),l(),s(27,"mat-chip-grid",null,0),Y(29,Jse,4,1,"mat-chip",null,Ae),l(),s(31,"input",18),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(32,"mat-form-field",10)(33,"mat-label"),d(34,"Category"),l(),s(35,"mat-select",19),g("selectionChange",function(o){k(e);let r=v();return T(r.category.set(o.value))}),Y(36,ele,2,2,"mat-option",20,Hi),l()(),s(38,"mat-form-field",10)(39,"mat-label"),d(40,"Console type"),l(),s(41,"mat-select",19),g("selectionChange",function(o){k(e);let r=v();return T(r.consoleType.set(o.value))}),Y(42,tle,2,2,"mat-option",20,Ae),l()(),s(44,"mat-checkbox",21),g("change",function(o){k(e);let r=v();return T(r.consoleAutoStart.set(o.checked))}),d(45,"Auto start console"),l()()(),s(46,"section",7)(47,"h3",8),d(48,"Usage"),l(),s(49,"div",22)(50,"mat-form-field",23)(51,"mat-label"),d(52,"Usage notes"),l(),s(53,"textarea",24),g("input",function(o){k(e);let r=v();return T(r.usage.set(o.target.value))}),l()()()(),s(54,"div",25)(55,"button",26),g("click",function(){k(e);let o=v();return T(o.goBack())}),d(56,"Cancel"),l(),s(57,"button",27),g("click",function(){k(e);let o=v();return T(o.onSave())}),d(58,"Save"),l()()()}if(n&2){let e=Pe(28),t=v();m(8),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(4),C("value",t.scriptFile()),m(5),C("value",t.symbol()),m(8),Z(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Z(t.categories),m(5),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(9),C("value",t.usage())}}var Ox=(()=>{class n{route=f(lt);controllerService=f(Je);vpcsService=f(Rm);toasterService=f(te);vpcsConfigurationService=f(Lm);router=f(ht);cd=f(Q);dialog=f(nt);dialogConfig=f(fo);controller;vpcsTemplate;separatorKeysCodes=[13,188];consoleTypes=[];categories=[];templateName=U("");defaultName=U("");scriptFile=U("");symbol=U("");category=U("");consoleType=U("");consoleAutoStart=U(!1);tags=U([]);usage=U("");ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id"),t=this.route.snapshot.paramMap.get("template_id");this.controllerService.get(parseInt(e,10)).then(o=>{this.controller=o,this.cd.markForCheck(),this.getConfiguration(),this.vpcsService.getTemplate(this.controller,t).subscribe({next:r=>{this.vpcsTemplate=r,this.vpcsTemplate.tags||(this.vpcsTemplate.tags=[]),this.initFormFromTemplate(),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load VPCS template";this.toasterService.error(a),this.cd.markForCheck()}})},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}initFormFromTemplate(){this.templateName.set(this.vpcsTemplate.name||""),this.defaultName.set(this.vpcsTemplate.default_name_format||""),this.scriptFile.set(this.vpcsTemplate.base_script_file||""),this.symbol.set(this.vpcsTemplate.symbol||""),this.category.set(this.vpcsTemplate.category||""),this.consoleType.set(this.vpcsTemplate.console_type||""),this.consoleAutoStart.set(this.vpcsTemplate.console_auto_start||!1),this.tags.set(this.vpcsTemplate.tags||[]),this.usage.set(this.vpcsTemplate.usage||"")}getConfiguration(){this.consoleTypes=this.vpcsConfigurationService.getConsoleTypes(),this.categories=this.vpcsConfigurationService.getCategories()}goBack(){this.router.navigate(["/controller",this.controller.id,"preferences","vpcs","templates"])}onSave(){if(!this.templateName()||!this.defaultName()||!this.scriptFile()||!this.symbol()){let e=[];this.templateName()||e.push("Template name"),this.defaultName()||e.push("Default name format"),this.scriptFile()||e.push("Base script file"),this.symbol()||e.push("Symbol"),this.toasterService.error(`Missing required fields: ${e.join(", ")}`);return}this.vpcsTemplate.name=this.templateName(),this.vpcsTemplate.default_name_format=this.defaultName(),this.vpcsTemplate.base_script_file=this.scriptFile(),this.vpcsTemplate.symbol=this.symbol(),this.vpcsTemplate.category=this.category(),this.vpcsTemplate.console_type=this.consoleType(),this.vpcsTemplate.console_auto_start=this.consoleAutoStart(),this.vpcsTemplate.tags=this.tags(),this.vpcsTemplate.usage=this.usage(),this.vpcsService.saveTemplate(this.controller,this.vpcsTemplate).subscribe({next:e=>{this.toasterService.success("Changes saved"),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to save VPCS template";this.toasterService.error(t),this.cd.markForCheck()}})}chooseSymbol(){let e=this.dialogConfig.openConfig("templateSymbol",{autoFocus:!1,disableClose:!1,data:{controller:this.controller,symbol:this.symbol()}});this.dialog.open(qr,e).afterClosed().subscribe(o=>{o&&this.symbol.set(o)})}addTag(e){let t=(e.value||"").trim(),o=this.tags();t&&this.tags.set([...o,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),o=t.indexOf(e);if(o>=0){let r=[...t];r.splice(o,1),this.tags.set(r)}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-vpcs-template-details"]],inputs:{templateName:[1,"templateName"],defaultName:[1,"defaultName"],scriptFile:[1,"scriptFile"],symbol:[1,"symbol"],category:[1,"category"],consoleType:[1,"consoleType"],consoleAutoStart:[1,"consoleAutoStart"],tags:[1,"tags"],usage:[1,"usage"]},outputs:{templateName:"templateNameChange",defaultName:"defaultNameChange",scriptFile:"scriptFileChange",symbol:"symbolChange",category:"categoryChange",consoleType:"consoleTypeChange",consoleAutoStart:"consoleAutoStartChange",tags:"tagsChange",usage:"usageChange"},decls:6,vars:2,consts:[["chipList",""],[1,"vpcs-template-details"],[1,"vpcs-template-details__header"],["mat-icon-button","",1,"vpcs-template-details__back-btn"],[1,"vpcs-template-details__title"],[1,"vpcs-template-details__content"],["mat-icon-button","",1,"vpcs-template-details__back-btn",3,"click"],[1,"vpcs-template-details__form-card"],[1,"vpcs-template-details__section-title"],[1,"vpcs-template-details__form"],["appearance","fill",1,"vpcs-template-details__field"],["matInput","","type","text","placeholder","Template name",3,"input","value"],["matInput","","type","text","placeholder","Default name format",3,"input","value"],["matInput","","type","text","placeholder","Base script file",3,"input","value"],[1,"vpcs-template-details__symbol-row"],["appearance","fill",1,"vpcs-template-details__field","vpcs-template-details__field--flex"],["matInput","","type","text","placeholder","Symbol",3,"input","value"],["mat-button","",1,"vpcs-template-details__symbol-btn",3,"click"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"selectionChange","value"],[3,"value"],[3,"change","checked"],[1,"preferences__usage-form"],["appearance","fill",1,"preferences__usage-field--full"],["matInput","","type","text",3,"input","value"],[1,"vpcs-template-details__actions"],["mat-button","",1,"vpcs-template-details__cancel-btn",3,"click"],["mat-raised-button","","color","primary",1,"vpcs-template-details__save-btn",3,"click"],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2),A(2,Zse,3,0,"button",3),s(3,"h1",4),d(4,"VPCS node template configuration"),l()(),A(5,nle,59,10,"main",5),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.vpcsTemplate?5:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,ie,de,W,pe,je,Mt,we,Me,et,Se,Ee,vt,At,_t,Ot,Gt,ti,Jn,vi,Ci,mi],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.vpcs-template-details__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.vpcs-template-details__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.vpcs-template-details__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.vpcs-template-details__title[_ngcontent-%COMP%]{flex:1;font-size:28px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.vpcs-template-details__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.vpcs-template-details--hidden[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.vpcs-template-details__form-card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);margin-bottom:16px}.vpcs-template-details__form[_ngcontent-%COMP%]{padding:24px;display:flex;flex-direction:column;gap:16px}.vpcs-template-details__field[_ngcontent-%COMP%]{width:100%}.vpcs-template-details__field--flex[_ngcontent-%COMP%]{flex:1}.vpcs-template-details__section-title[_ngcontent-%COMP%]{padding:16px 24px;margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface-variant);border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.vpcs-template-details__symbol-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.vpcs-template-details__symbol-btn[_ngcontent-%COMP%]{margin-top:4px;height:48px}.vpcs-template-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.vpcs-template-details__cancel-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none}.vpcs-template-details__save-btn[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.vpcs-template-details__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.vpcs-template-details__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.vpcs-template-details__title[_ngcontent-%COMP%]{font-size:22px}.vpcs-template-details__content[_ngcontent-%COMP%]{padding:0 16px 16px}.vpcs-template-details__form[_ngcontent-%COMP%]{padding:16px}.vpcs-template-details__symbol-row[_ngcontent-%COMP%], .vpcs-template-details__actions[_ngcontent-%COMP%]{flex-direction:column}.vpcs-template-details__cancel-btn[_ngcontent-%COMP%], .vpcs-template-details__save-btn[_ngcontent-%COMP%]{width:100%;height:44px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var ile=(n,i)=>i.template_id;function ole(n,i){if(n&1&&(s(0,"button",4)(1,"mat-icon"),d(2,"arrow_back"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences")}}function rle(n,i){if(n&1&&(s(0,"button",6)(1,"mat-icon"),d(2,"add_circle_outline"),l()()),n&2){let e=v();C("routerLink","/controller/"+e.controller.id+"/preferences/vpcs/addtemplate")}}function ale(n,i){n&1&&R(0,"app-empty-templates-list")}function sle(n,i){if(n&1){let e=z();s(0,"div",10)(1,"mat-icon",11),d(2,"computer"),l(),s(3,"span",12),d(4),l(),s(5,"button",13),g("click",function(o){return o.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"a",15)(11,"mat-icon"),d(12,"edit"),l(),s(13,"span"),d(14,"Edit"),l()(),s(15,"button",16),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.deleteTemplate(o))}),s(16,"mat-icon"),d(17,"delete"),l(),s(18,"span"),d(19,"Delete"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(9);C("routerLink",e.template_id),m(4),j(e.name),m(),C("matMenuTriggerFor",t),m(5),C("routerLink",e.template_id)}}function lle(n,i){if(n&1&&(s(0,"nav",8),Y(1,sle,20,4,"div",10,ile),l()),n&2){let e=v();m(),Z(e.vpcsTemplates)}}var Nx=(()=>{class n{route=f(lt);controllerService=f(Je);vpcsService=f(Rm);toasterService=f(te);cd=f(Q);controller;vpcsTemplates=[];deleteComponent=Nt(Oi);ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.getTemplates()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}getTemplates(){this.vpcsService.getTemplates(this.controller).subscribe({next:e=>{this.vpcsTemplates=e.filter(t=>t.template_type==="vpcs"&&!t.builtin),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load VPCS templates";this.toasterService.error(t),this.cd.markForCheck()}})}deleteTemplate(e){this.deleteComponent().deleteItem(e.name,e.template_id)}onDeleteEvent(){this.getTemplates()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-vpcs-templates"]],viewQuery:function(t,o){t&1&&Xt(o.deleteComponent,Oi,5),t&2&&Kt()},decls:11,vars:5,consts:[["deleteComponent",""],["menu","matMenu"],[1,"vpcs-templates"],[1,"vpcs-templates__header"],["mat-icon-button","",1,"vpcs-templates__back-btn",3,"routerLink"],[1,"vpcs-templates__title"],["matTooltip","Add VPCS template","matTooltipClass","custom-tooltip","mat-icon-button","",1,"vpcs-templates__add-btn",3,"routerLink"],[1,"vpcs-templates__content"],[1,"vpcs-templates__list"],[3,"deleteEvent","controller"],[1,"vpcs-templates__list-item",3,"routerLink"],[1,"vpcs-templates__list-icon"],[1,"vpcs-templates__list-name"],["mat-icon-button","",1,"vpcs-templates__menu-btn",3,"click","matMenuTriggerFor"],["xPosition","before"],["mat-menu-item","",3,"routerLink"],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"header",3),A(2,ole,3,1,"button",4),s(3,"h1",5),d(4,"VPCS node templates"),l(),A(5,rle,3,1,"button",6),l(),s(6,"main",7),A(7,ale,1,0,"app-empty-templates-list"),A(8,lle,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),g("deleteEvent",function(){return o.onDeleteEvent()}),l()),t&2&&(m(2),O(o.controller?2:-1),m(3),O(o.controller?5:-1),m(2),O(o.vpcsTemplates.length?-1:7),m(),O(o.vpcsTemplates.length?8:-1),m(),C("controller",o.controller))},dependencies:[ne,dt,vn,W,je,ie,de,Zi,Ge,Qn,Ze,Fn,wt,It,Oi,Xr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.vpcs-templates__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.vpcs-templates__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.vpcs-templates__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.vpcs-templates__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.vpcs-templates__add-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.vpcs-templates__add-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent)}.vpcs-templates__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.vpcs-templates__list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.vpcs-templates__list-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;text-decoration:none;color:var(--mat-sys-on-surface)}.vpcs-templates__list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.vpcs-templates__list-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.vpcs-templates__list-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.vpcs-templates__list-name[_ngcontent-%COMP%]{flex:1;font-size:16px;font-weight:500}.vpcs-templates__menu-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);flex-shrink:0}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.vpcs-templates__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.vpcs-templates__back-btn[_ngcontent-%COMP%], .vpcs-templates__add-btn[_ngcontent-%COMP%]{width:44px;height:44px}.vpcs-templates__title[_ngcontent-%COMP%]{font-size:24px}.vpcs-templates__content[_ngcontent-%COMP%]{padding:0 16px 16px}.vpcs-templates__list-item[_ngcontent-%COMP%]{padding:14px 16px}}","[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();function cle(n,i){}var L8="_mat-bottom-sheet-enter",V8="_mat-bottom-sheet-exit",dle=(()=>{class n extends w4{_breakpointSubscription;_animationsDisabled=qo();_animationState="void";_animationStateChanged=new ve;_destroyed=!1;constructor(){super();let e=f(xC);this._breakpointSubscription=e.observe([hd.Medium,hd.Large,hd.XLarge]).subscribe(()=>{let t=this._elementRef.nativeElement.classList;t.toggle("mat-bottom-sheet-container-medium",e.isMatched(hd.Medium)),t.toggle("mat-bottom-sheet-container-large",e.isMatched(hd.Large)),t.toggle("mat-bottom-sheet-container-xlarge",e.isMatched(hd.XLarge))})}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._animationsDisabled&&this._simulateAnimation(L8))}exit(){this._destroyed||(this._elementRef.nativeElement.setAttribute("mat-exit",""),this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._animationsDisabled&&this._simulateAnimation(V8))}ngOnDestroy(){super.ngOnDestroy(),this._breakpointSubscription.unsubscribe(),this._destroyed=!0}_simulateAnimation(e){this._ngZone.run(()=>{this._handleAnimationEvent(!0,e),setTimeout(()=>this._handleAnimationEvent(!1,e))})}_trapFocus(){super._trapFocus({preventScroll:!0})}_handleAnimationEvent(e,t){let o=t===L8;(o||t===V8)&&this._animationStateChanged.emit({toState:o?"visible":"hidden",phase:e?"start":"done"})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-bottom-sheet-container"]],hostAttrs:["tabindex","-1",1,"mat-bottom-sheet-container"],hostVars:9,hostBindings:function(t,o){t&1&&g("animationstart",function(a){return o._handleAnimationEvent(!0,a.animationName)})("animationend",function(a){return o._handleAnimationEvent(!1,a.animationName)})("animationcancel",function(a){return o._handleAnimationEvent(!1,a.animationName)}),t&2&&(qt("role",o._config.role)("aria-modal",o._config.ariaModal)("aria-label",o._config.ariaLabel),Be("mat-bottom-sheet-container-animations-enabled",!o._animationsDisabled)("mat-bottom-sheet-container-enter",o._animationState==="visible")("mat-bottom-sheet-container-exit",o._animationState==="hidden"))},features:[si],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,o){t&1&&xe(0,cle,0,0,"ng-template",0)},dependencies:[Gu],styles:[`@keyframes _mat-bottom-sheet-enter{from{transform:translateY(100%)}to{transform:none}}@keyframes _mat-bottom-sheet-exit{from{transform:none}to{transform:translateY(100%)}}.mat-bottom-sheet-container{box-shadow:0px 8px 10px -5px rgba(0, 0, 0, 0.2), 0px 16px 24px 2px rgba(0, 0, 0, 0.14), 0px 6px 30px 5px rgba(0, 0, 0, 0.12);padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto;position:relative;background:var(--mat-bottom-sheet-container-background-color, var(--mat-sys-surface-container-low));color:var(--mat-bottom-sheet-container-text-color, var(--mat-sys-on-surface));font-family:var(--mat-bottom-sheet-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-bottom-sheet-container-text-size, var(--mat-sys-body-large-size));line-height:var(--mat-bottom-sheet-container-text-line-height, var(--mat-sys-body-large-line-height));font-weight:var(--mat-bottom-sheet-container-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-bottom-sheet-container-text-tracking, var(--mat-sys-body-large-tracking))}@media(forced-colors: active){.mat-bottom-sheet-container{outline:1px solid}}.mat-bottom-sheet-container-animations-enabled{transform:translateY(100%)}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-enter{animation:_mat-bottom-sheet-enter 195ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-exit{animation:_mat-bottom-sheet-exit 375ms cubic-bezier(0.4, 0, 1, 1) backwards}.mat-bottom-sheet-container-xlarge,.mat-bottom-sheet-container-large,.mat-bottom-sheet-container-medium{border-top-left-radius:var(--mat-bottom-sheet-container-shape, 28px);border-top-right-radius:var(--mat-bottom-sheet-container-shape, 28px)}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}
`],encapsulation:2})}return n})(),cP=new cn("MatBottomSheetData"),lP=class{viewContainerRef;injector;panelClass;direction;data=null;hasBackdrop=!0;backdropClass;disableClose=!1;ariaLabel=null;ariaModal=!1;closeOnNavigation=!0;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;height="";minHeight;maxHeight},Vm=class{_ref;get instance(){return this._ref.componentInstance}get componentRef(){return this._ref.componentRef}containerInstance;disableClose;_afterOpened=new He;_result;_closeFallbackTimeout;constructor(i,e,t){this._ref=i,this.containerInstance=t,this.disableClose=e.disableClose,t._animationStateChanged.pipe(ai(o=>o.phase==="done"&&o.toState==="visible"),Ao(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(ai(o=>o.phase==="done"&&o.toState==="hidden"),Ao(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._ref.close(this._result)}),i.overlayRef.detachments().subscribe(()=>{this._ref.close(this._result)}),Hn(this.backdropClick(),this.keydownEvents().pipe(ai(o=>o.keyCode===27))).subscribe(o=>{!this.disableClose&&(o.type!=="keydown"||!fa(o))&&(o.preventDefault(),this.dismiss())})}dismiss(i){this.containerInstance&&(this.containerInstance._animationStateChanged.pipe(ai(e=>e.phase==="start"),Ao(1)).subscribe(()=>{this._closeFallbackTimeout=setTimeout(()=>this._ref.close(this._result),500),this._ref.overlayRef.detachBackdrop()}),this._result=i,this.containerInstance.exit(),this.containerInstance=null)}afterDismissed(){return this._ref.closed}afterOpened(){return this._afterOpened}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}},mle=new cn("mat-bottom-sheet-default-options"),Gl=(()=>{class n{_injector=f(Jo);_parentBottomSheet=f(n,{optional:!0,skipSelf:!0});_animationsDisabled=qo();_defaultOptions=f(mle,{optional:!0});_bottomSheetRefAtThisLevel=null;_dialog=f(k4);get _openedBottomSheetRef(){let e=this._parentBottomSheet;return e?e._openedBottomSheetRef:this._bottomSheetRefAtThisLevel}set _openedBottomSheetRef(e){this._parentBottomSheet?this._parentBottomSheet._openedBottomSheetRef=e:this._bottomSheetRefAtThisLevel=e}constructor(){}open(e,t){let o=K(K({},this._defaultOptions||new lP),t),r;return this._dialog.open(e,it(K({},o),{disableClose:!0,closeOnOverlayDetachments:!1,maxWidth:"100%",container:dle,scrollStrategy:o.scrollStrategy||t4(this._injector),positionStrategy:n4(this._injector).centerHorizontally().bottom("0"),disableAnimations:this._animationsDisabled,templateContext:()=>({bottomSheetRef:r}),providers:(a,c,p)=>(r=new Vm(a,o,p),[{provide:Vm,useValue:r},{provide:cP,useValue:o.data}])})),r.afterDismissed().subscribe(()=>{this._openedBottomSheetRef===r&&(this._openedBottomSheetRef=null)}),this._openedBottomSheetRef?(this._openedBottomSheetRef.afterDismissed().subscribe(()=>r.containerInstance?.enter()),this._openedBottomSheetRef.dismiss()):r.containerInstance.enter(),this._openedBottomSheetRef=r,r}dismiss(e){this._openedBottomSheetRef&&this._openedBottomSheetRef.dismiss(e)}ngOnDestroy(){this._bottomSheetRefAtThisLevel&&this._bottomSheetRefAtThisLevel.dismiss()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Bc=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({providers:[Gl],imports:[T4,Wu,hi]})}return n})();var ule=(n,i)=>i==null?null:i.name;function hle(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e==null?null:e.name)}}function fle(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function gle(n,i){if(n&1){let e=z();s(0,"form",1),g("ngSubmit",function(){k(e);let o=v();return T(o.export_project_form.valid&&o.exportPortableProject())}),s(1,"div",2)(2,"h1",3),d(3,"Export Project"),l(),s(4,"button",4),g("click",function(){k(e);let o=v();return T(o.dialogRef.close())}),s(5,"mat-icon"),d(6,"close"),l()()(),R(7,"mat-divider"),s(8,"div",5)(9,"div",6)(10,"span",7),d(11,"Compression:"),l(),s(12,"mat-form-field",8)(13,"mat-select",9),g("selectionChange",function(o){k(e);let r=v();return T(r.selectCompression(o))}),Y(14,hle,2,2,"mat-option",10,ule),l()()(),s(16,"div",6)(17,"span",7),d(18,"Compression level:"),l(),s(19,"mat-form-field",8)(20,"mat-select",11),Y(21,fle,2,2,"mat-option",10,Ae),l()()(),s(23,"div",6)(24,"section",12)(25,"mat-checkbox",13),d(26," Include base images "),l()()(),s(27,"div",6)(28,"section",12)(29,"mat-checkbox",14),d(30," Include snapshots "),l()()(),s(31,"div",6)(32,"section",12)(33,"mat-checkbox",15),d(34," Reset MAC addresses "),l()()()(),R(35,"mat-divider"),s(36,"div",16)(37,"button",17),g("click",function(){k(e);let o=v();return T(o.dialogRef.close())}),d(38,"Cancel"),l(),s(39,"button",18),d(40,"Export"),l()()()}if(n&2){let e=v();C("formGroup",e.export_project_form),m(14),Z(e.compression_methods),m(7),Z(e.compression_filter_value),m(18),C("disabled",e.isExport())}}var tf=(()=>{class n{data;export_project_form;chosenImage="";compression_methods=[];compression_level=[];compression_filter_value=[];controller;project;index=4;fileName;isExport=ae(!1);dialogRef=f(Ie);projectService=f(ki);_fb=f(Vn);destroyRef=f(Pl);constructor(e){this.data=e,this.controller=e.controllerDetails,this.project=e.projectDetails,this.project&&(this.fileName=this.project.name+".gns3project")}ngOnInit(){this.formControls(),this.compression_methods=this.projectService.getCompression(),this.compression_level=this.projectService.getCompressionLevel(),this.selectCompression({value:this.compression_methods[this.index]}),this.export_project_form.get("compression").setValue(this.compression_methods[this.index])}formControls(){this.export_project_form=this._fb.group({compression:["",Ue.required],compression_level:[""],include_base_image:[!1,Ue.required],include_snapshots:[!1,Ue.required],reset_mac_address:[!1,Ue.required]})}selectCompression(e){let t=this.compression_level.find(o=>e.value.value===o.name);t&&(this.export_project_form.get("compression_level").setValue(t.value),this.compression_filter_value=t.selectionValues)}exportPortableProject(){this.isExport.set(!0);let e=this.export_project_form.value,t=typeof e.compression=="object"?e.compression.value:e.compression,o=it(K({},e),{compression:t??"zstd"});window.location.assign(this.projectService.getexportPortableProjectPath(this.controller,this.project.project_id,o)),this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-export-portable-project"]],decls:1,vars:1,consts:[[1,"export-portable-project__form",3,"formGroup"],[1,"export-portable-project__form",3,"ngSubmit","formGroup"],[1,"export-portable-project__header"],[1,"export-portable-project__title"],["mat-icon-button","","type","button",1,"export-portable-project__close-btn",3,"click"],[1,"export-portable-project__content"],[1,"export-portable-project__row"],[1,"export-portable-project__label"],[1,"export-portable-project__field"],["formControlName","compression","required","",3,"selectionChange"],[3,"value"],["formControlName","compression_level"],[1,"export-portable-project__checkbox-section"],["formControlName","include_base_image",1,"export-portable-project__checkbox"],["formControlName","include_snapshots",1,"export-portable-project__checkbox"],["formControlName","reset_mac_address",1,"export-portable-project__checkbox"],[1,"export-portable-project__actions"],["mat-button","","type","button",3,"click"],["mat-raised-button","","color","primary","type","submit","cdkFocusInitial","",3,"disabled"]],template:function(t,o){t&1&&A(0,gle,41,2,"form",0),t&2&&O(o.export_project_form?0:-1)},dependencies:[ne,Dt,at,Pt,rt,d4,Rt,zt,_e,W,pe,je,ie,de,we,Me,Se,vt,At,_t,Ot,Gt,jr,ga],styles:["[_nghost-%COMP%]{display:block}.export-portable-project__form[_ngcontent-%COMP%]{display:flex;flex-direction:column}.export-portable-project__header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:24px 24px 8px}.export-portable-project__title[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.export-portable-project__close-btn[_ngcontent-%COMP%]{flex-shrink:0}.export-portable-project__content[_ngcontent-%COMP%]{padding:16px 24px 0;display:flex;flex-direction:column;gap:12px}.export-portable-project__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}@media(max-width:600px){.export-portable-project__row[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}.export-portable-project__label[_ngcontent-%COMP%]{flex:0 0 140px;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface-variant);align-self:flex-start;padding-top:12px}.export-portable-project__field[_ngcontent-%COMP%]{flex:1}.export-portable-project__checkbox-section[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:35px}.export-portable-project__checkbox[_ngcontent-%COMP%]{margin:0}.export-portable-project__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px;padding:16px 24px}.checkBox-section[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:35px}.checkBox-margin[_ngcontent-%COMP%]{margin:0 10px}.input-full-width[_ngcontent-%COMP%]{width:100%}.col-data[_ngcontent-%COMP%]{text-align:left;align-self:self-end;margin-bottom:20px}.checkbox-row[_ngcontent-%COMP%]{margin-top:5px}"],changeDetection:0})}return n})();var Bd=Bs(B8());var Rx="http://www.w3.org/1999/xhtml",dP={svg:"http://www.w3.org/2000/svg",xhtml:Rx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Dd(n){var i=n+="",e=i.indexOf(":");return e>=0&&(i=n.slice(0,e))!=="xmlns"&&(n=n.slice(e+1)),dP.hasOwnProperty(i)?{space:dP[i],local:n}:n}function _le(n){return function(){var i=this.ownerDocument,e=this.namespaceURI;return e===Rx&&i.documentElement.namespaceURI===Rx?i.createElement(n):i.createElementNS(e,n)}}function vle(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Lx(n){var i=Dd(n);return(i.local?vle:_le)(i)}function Cle(){}function uu(n){return n==null?Cle:function(){return this.querySelector(n)}}function z8(n){typeof n!="function"&&(n=uu(n));for(var i=this._groups,e=i.length,t=new Array(e),o=0;o<e;++o)for(var r=i[o],a=r.length,c=t[o]=new Array(a),p,u,h=0;h<a;++h)(p=r[h])&&(u=n.call(p,p.__data__,h,r))&&("__data__"in p&&(u.__data__=p.__data__),c[h]=u);return new ir(t,this._parents)}function mP(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function ble(){return[]}function R0(n){return n==null?ble:function(){return this.querySelectorAll(n)}}function xle(n){return function(){return mP(n.apply(this,arguments))}}function j8(n){typeof n=="function"?n=xle(n):n=R0(n);for(var i=this._groups,e=i.length,t=[],o=[],r=0;r<e;++r)for(var a=i[r],c=a.length,p,u=0;u<c;++u)(p=a[u])&&(t.push(n.call(p,p.__data__,u,a)),o.push(p));return new ir(t,o)}function L0(n){return function(){return this.matches(n)}}function Vx(n){return function(i){return i.matches(n)}}var yle=Array.prototype.find;function Sle(n){return function(){return yle.call(this.children,n)}}function wle(){return this.firstElementChild}function $8(n){return this.select(n==null?wle:Sle(typeof n=="function"?n:Vx(n)))}var Mle=Array.prototype.filter;function kle(){return Array.from(this.children)}function Tle(n){return function(){return Mle.call(this.children,n)}}function H8(n){return this.selectAll(n==null?kle:Tle(typeof n=="function"?n:Vx(n)))}function U8(n){typeof n!="function"&&(n=L0(n));for(var i=this._groups,e=i.length,t=new Array(e),o=0;o<e;++o)for(var r=i[o],a=r.length,c=t[o]=[],p,u=0;u<a;++u)(p=r[u])&&n.call(p,p.__data__,u,r)&&c.push(p);return new ir(t,this._parents)}function Bx(n){return new Array(n.length)}function G8(){return new ir(this._enter||this._groups.map(Bx),this._parents)}function V0(n,i){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=i}V0.prototype={constructor:V0,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,i){return this._parent.insertBefore(n,i)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function W8(n){return function(){return n}}function Ele(n,i,e,t,o,r){for(var a=0,c,p=i.length,u=r.length;a<u;++a)(c=i[a])?(c.__data__=r[a],t[a]=c):e[a]=new V0(n,r[a]);for(;a<p;++a)(c=i[a])&&(o[a]=c)}function Dle(n,i,e,t,o,r,a){var c,p,u=new Map,h=i.length,_=r.length,S=new Array(h),x;for(c=0;c<h;++c)(p=i[c])&&(S[c]=x=a.call(p,p.__data__,c,i)+"",u.has(x)?o[c]=p:u.set(x,p));for(c=0;c<_;++c)x=a.call(n,r[c],c,r)+"",(p=u.get(x))?(t[c]=p,p.__data__=r[c],u.delete(x)):e[c]=new V0(n,r[c]);for(c=0;c<h;++c)(p=i[c])&&u.get(S[c])===p&&(o[c]=p)}function Ple(n){return n.__data__}function q8(n,i){if(!arguments.length)return Array.from(this,Ple);var e=i?Dle:Ele,t=this._parents,o=this._groups;typeof n!="function"&&(n=W8(n));for(var r=o.length,a=new Array(r),c=new Array(r),p=new Array(r),u=0;u<r;++u){var h=t[u],_=o[u],S=_.length,x=Ile(n.call(h,h&&h.__data__,u,t)),b=x.length,M=c[u]=new Array(b),w=a[u]=new Array(b),y=p[u]=new Array(S);e(h,_,M,w,y,x,i);for(var E=0,I=0,D,N;E<b;++E)if(D=M[E]){for(E>=I&&(I=E+1);!(N=w[I])&&++I<b;);D._next=N||null}}return a=new ir(a,t),a._enter=c,a._exit=p,a}function Ile(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function Q8(){return new ir(this._exit||this._groups.map(Bx),this._parents)}function X8(n,i,e){var t=this.enter(),o=this,r=this.exit();return typeof n=="function"?(t=n(t),t&&(t=t.selection())):t=t.append(n+""),i!=null&&(o=i(o),o&&(o=o.selection())),e==null?r.remove():e(r),t&&o?t.merge(o).order():o}function K8(n){for(var i=n.selection?n.selection():n,e=this._groups,t=i._groups,o=e.length,r=t.length,a=Math.min(o,r),c=new Array(o),p=0;p<a;++p)for(var u=e[p],h=t[p],_=u.length,S=c[p]=new Array(_),x,b=0;b<_;++b)(x=u[b]||h[b])&&(S[b]=x);for(;p<o;++p)c[p]=e[p];return new ir(c,this._parents)}function Y8(){for(var n=this._groups,i=-1,e=n.length;++i<e;)for(var t=n[i],o=t.length-1,r=t[o],a;--o>=0;)(a=t[o])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function Z8(n){n||(n=Ale);function i(_,S){return _&&S?n(_.__data__,S.__data__):!_-!S}for(var e=this._groups,t=e.length,o=new Array(t),r=0;r<t;++r){for(var a=e[r],c=a.length,p=o[r]=new Array(c),u,h=0;h<c;++h)(u=a[h])&&(p[h]=u);p.sort(i)}return new ir(o,this._parents).order()}function Ale(n,i){return n<i?-1:n>i?1:n>=i?0:NaN}function J8(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function eL(){return Array.from(this)}function tL(){for(var n=this._groups,i=0,e=n.length;i<e;++i)for(var t=n[i],o=0,r=t.length;o<r;++o){var a=t[o];if(a)return a}return null}function nL(){let n=0;for(let i of this)++n;return n}function iL(){return!this.node()}function oL(n){for(var i=this._groups,e=0,t=i.length;e<t;++e)for(var o=i[e],r=0,a=o.length,c;r<a;++r)(c=o[r])&&n.call(c,c.__data__,r,o);return this}function Ole(n){return function(){this.removeAttribute(n)}}function Nle(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Fle(n,i){return function(){this.setAttribute(n,i)}}function Rle(n,i){return function(){this.setAttributeNS(n.space,n.local,i)}}function Lle(n,i){return function(){var e=i.apply(this,arguments);e==null?this.removeAttribute(n):this.setAttribute(n,e)}}function Vle(n,i){return function(){var e=i.apply(this,arguments);e==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}}function rL(n,i){var e=Dd(n);if(arguments.length<2){var t=this.node();return e.local?t.getAttributeNS(e.space,e.local):t.getAttribute(e)}return this.each((i==null?e.local?Nle:Ole:typeof i=="function"?e.local?Vle:Lle:e.local?Rle:Fle)(e,i))}function zx(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function Ble(n){return function(){this.style.removeProperty(n)}}function zle(n,i,e){return function(){this.style.setProperty(n,i,e)}}function jle(n,i,e){return function(){var t=i.apply(this,arguments);t==null?this.style.removeProperty(n):this.style.setProperty(n,t,e)}}function aL(n,i,e){return arguments.length>1?this.each((i==null?Ble:typeof i=="function"?jle:zle)(n,i,e??"")):Bm(this.node(),n)}function Bm(n,i){return n.style.getPropertyValue(i)||zx(n).getComputedStyle(n,null).getPropertyValue(i)}function $le(n){return function(){delete this[n]}}function Hle(n,i){return function(){this[n]=i}}function Ule(n,i){return function(){var e=i.apply(this,arguments);e==null?delete this[n]:this[n]=e}}function sL(n,i){return arguments.length>1?this.each((i==null?$le:typeof i=="function"?Ule:Hle)(n,i)):this.node()[n]}function lL(n){return n.trim().split(/^|\s+/)}function pP(n){return n.classList||new cL(n)}function cL(n){this._node=n,this._names=lL(n.getAttribute("class")||"")}cL.prototype={add:function(n){var i=this._names.indexOf(n);i<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var i=this._names.indexOf(n);i>=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function dL(n,i){for(var e=pP(n),t=-1,o=i.length;++t<o;)e.add(i[t])}function mL(n,i){for(var e=pP(n),t=-1,o=i.length;++t<o;)e.remove(i[t])}function Gle(n){return function(){dL(this,n)}}function Wle(n){return function(){mL(this,n)}}function qle(n,i){return function(){(i.apply(this,arguments)?dL:mL)(this,n)}}function pL(n,i){var e=lL(n+"");if(arguments.length<2){for(var t=pP(this.node()),o=-1,r=e.length;++o<r;)if(!t.contains(e[o]))return!1;return!0}return this.each((typeof i=="function"?qle:i?Gle:Wle)(e,i))}function Qle(){this.textContent=""}function Xle(n){return function(){this.textContent=n}}function Kle(n){return function(){var i=n.apply(this,arguments);this.textContent=i??""}}function uL(n){return arguments.length?this.each(n==null?Qle:(typeof n=="function"?Kle:Xle)(n)):this.node().textContent}function Yle(){this.innerHTML=""}function Zle(n){return function(){this.innerHTML=n}}function Jle(n){return function(){var i=n.apply(this,arguments);this.innerHTML=i??""}}function hL(n){return arguments.length?this.each(n==null?Yle:(typeof n=="function"?Jle:Zle)(n)):this.node().innerHTML}function ece(){this.nextSibling&&this.parentNode.appendChild(this)}function fL(){return this.each(ece)}function tce(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gL(){return this.each(tce)}function _L(n){var i=typeof n=="function"?n:Lx(n);return this.select(function(){return this.appendChild(i.apply(this,arguments))})}function nce(){return null}function vL(n,i){var e=typeof n=="function"?n:Lx(n),t=i==null?nce:typeof i=="function"?i:uu(i);return this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})}function ice(){var n=this.parentNode;n&&n.removeChild(this)}function CL(){return this.each(ice)}function oce(){var n=this.cloneNode(!1),i=this.parentNode;return i?i.insertBefore(n,this.nextSibling):n}function rce(){var n=this.cloneNode(!0),i=this.parentNode;return i?i.insertBefore(n,this.nextSibling):n}function bL(n){return this.select(n?rce:oce)}function xL(n){return arguments.length?this.property("__data__",n):this.node().__data__}function ace(n){return function(i){n.call(this,i,this.__data__)}}function sce(n){return n.trim().split(/^|\s+/).map(function(i){var e="",t=i.indexOf(".");return t>=0&&(e=i.slice(t+1),i=i.slice(0,t)),{type:i,name:e}})}function lce(n){return function(){var i=this.__on;if(i){for(var e=0,t=-1,o=i.length,r;e<o;++e)r=i[e],(!n.type||r.type===n.type)&&r.name===n.name?this.removeEventListener(r.type,r.listener,r.options):i[++t]=r;++t?i.length=t:delete this.__on}}}function cce(n,i,e){return function(){var t=this.__on,o,r=ace(i);if(t){for(var a=0,c=t.length;a<c;++a)if((o=t[a]).type===n.type&&o.name===n.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=e),o.value=i;return}}this.addEventListener(n.type,r,e),o={type:n.type,name:n.name,value:i,listener:r,options:e},t?t.push(o):this.__on=[o]}}function yL(n,i,e){var t=sce(n+""),o,r=t.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var p=0,u=c.length,h;p<u;++p)for(o=0,h=c[p];o<r;++o)if((a=t[o]).type===h.type&&a.name===h.name)return h.value}return}for(c=i?cce:lce,o=0;o<r;++o)this.each(c(t[o],i,e));return this}function SL(n,i,e){var t=zx(n),o=t.CustomEvent;typeof o=="function"?o=new o(i,e):(o=t.document.createEvent("Event"),e?(o.initEvent(i,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(i,!1,!1)),n.dispatchEvent(o)}function dce(n,i){return function(){return SL(this,n,i)}}function mce(n,i){return function(){return SL(this,n,i.apply(this,arguments))}}function wL(n,i){return this.each((typeof i=="function"?mce:dce)(n,i))}function*ML(){for(var n=this._groups,i=0,e=n.length;i<e;++i)for(var t=n[i],o=0,r=t.length,a;o<r;++o)(a=t[o])&&(yield a)}var uP=[null];function ir(n,i){this._groups=n,this._parents=i}function kL(){return new ir([[document.documentElement]],uP)}function pce(){return this}ir.prototype=kL.prototype={constructor:ir,select:z8,selectAll:j8,selectChild:$8,selectChildren:H8,filter:U8,data:q8,enter:G8,exit:Q8,join:X8,merge:K8,selection:pce,order:Y8,sort:Z8,call:J8,nodes:eL,node:tL,size:nL,empty:iL,each:oL,attr:rL,style:aL,property:sL,classed:pL,text:uL,html:hL,raise:fL,lower:gL,append:_L,insert:vL,remove:CL,clone:bL,datum:xL,on:yL,dispatch:wL,[Symbol.iterator]:ML};var Pd=kL;function Wt(n){return typeof n=="string"?new ir([[document.querySelector(n)]],[document.documentElement]):new ir([[n]],uP)}function TL(n){let i;for(;i=n.sourceEvent;)n=i;return n}function Zr(n,i){if(n=TL(n),i===void 0&&(i=n.currentTarget),i){var e=i.ownerSVGElement||i;if(e.createSVGPoint){var t=e.createSVGPoint();return t.x=n.clientX,t.y=n.clientY,t=t.matrixTransform(i.getScreenCTM().inverse()),[t.x,t.y]}if(i.getBoundingClientRect){var o=i.getBoundingClientRect();return[n.clientX-o.left-i.clientLeft,n.clientY-o.top-i.clientTop]}}return[n.pageX,n.pageY]}var zm=class{x;y;constructor(i,e){this.x=i,this.y=e}};var jm=class{width;height;constructor(i,e){this.width=i,this.height=e}};var hP=class{x;y;k;constructor(i,e,t){this.x=i,this.y=e,this.k=t}},Eo=(()=>{class n{transformation;size;centerZeroZeroPoint=!0;centerX=null;centerY=null;constructor(){this.size=new jm(0,0),this.transformation=new hP(0,0,1)}getZeroZeroTransformationPoint(){return this.centerZeroZeroPoint?new zm(this.centerX!==null?this.centerX:this.size.width/2,this.centerY!==null?this.centerY:this.size.height/2):new zm(0,0)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var zc=(()=>{class n{context;currentScale;scaleChangeEmitter=new ve;constructor(e){this.context=e,this.currentScale=1}getScale(){return this.currentScale}setScale(e){this.currentScale=e,this.context.transformation.k=this.currentScale,this.scaleChangeEmitter.emit(this.currentScale)}resetToDefault(){this.currentScale=1,this.context.transformation.k=this.currentScale,this.scaleChangeEmitter.emit(this.currentScale)}static \u0275fac=function(t){return new(t||n)(ge(Eo))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var go=(()=>{class n{symbolScalingSubject=new He;isScrollDisabled=new He;isMapLocked=new He;isTopologySummaryVisible=!0;isLogConsoleVisible=!1;isLayerNumberVisible=!1;isItemLockStatusVisible=!1;logConsoleSubject=new He;mapRenderedEmitter=new ve;openReadme;showInterfaceLabels=!0;integrateLinkLabelsToLinks=!0;openConsolesInWidget=!1;constructor(){this.isLayerNumberVisible=localStorage.getItem("layersVisibility")==="true",localStorage.getItem("integrateLinkLabelsToLinks")&&(this.integrateLinkLabelsToLinks=localStorage.getItem("integrateLinkLabelsToLinks")==="true"),localStorage.getItem("openConsolesInWidget")&&(this.openConsolesInWidget=localStorage.getItem("openConsolesInWidget")==="true"),localStorage.getItem("symbolScaling")||localStorage.setItem("symbolScaling","true"),localStorage.getItem("openReadme")?this.openReadme=localStorage.getItem("openReadme")==="true":localStorage.setItem("openReadme","false"),localStorage.getItem("showInterfaceLabels")?this.showInterfaceLabels=localStorage.getItem("showInterfaceLabels")==="true":localStorage.setItem("showInterfaceLabels","true")}getSymbolScaling(){return localStorage.getItem("symbolScaling")==="true"}setSymbolScaling(e){e?localStorage.setItem("symbolScaling","true"):localStorage.setItem("symbolScaling","false"),this.symbolScalingSubject.next(e)}changeMapLockValue(e){this.isMapLocked.next(e)}setConsoleContextMenuAction(e){localStorage.setItem("consoleContextMenu",e)}getConsoleContextMenuAction(){return localStorage.getItem("consoleContextMenu")}toggleTopologySummary(e){this.isTopologySummaryVisible=e}toggleLogConsole(e){this.isLogConsoleVisible=e}toggleLayers(e){this.isLayerNumberVisible=e}toggleItemLockStatus(e){this.isItemLockStatusVisible=e}toggleShowInterfaceLabels(e){this.showInterfaceLabels=e,localStorage.removeItem("showInterfaceLabels"),e?localStorage.setItem("showInterfaceLabels","true"):localStorage.setItem("showInterfaceLabels","false")}toggleIntegrateInterfaceLabels(e){this.integrateLinkLabelsToLinks=e,localStorage.removeItem("integrateLinkLabelsToLinks"),e?localStorage.setItem("integrateLinkLabelsToLinks","true"):localStorage.setItem("integrateLinkLabelsToLinks","false")}toggleOpenReadme(e){this.openReadme=e,localStorage.removeItem("openReadme"),e?localStorage.setItem("openReadme","true"):localStorage.setItem("openReadme","false")}toggleOpenConsolesInWidget(e){this.openConsolesInWidget=e,localStorage.removeItem("openConsolesInWidget"),e?localStorage.setItem("openConsolesInWidget","true"):localStorage.setItem("openConsolesInWidget","false")}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var gl=(()=>{class n{isSelectionToolActivated=new He;isMovingToolActivated=new He;isTextEditingToolActivated=new He;isTextAddingToolActivated=new He;isDrawLinkToolActivated=new He;constructor(){}selectionToolActivation(e){this.isSelectionToolActivated.next(e)}movingToolActivation(e){this.isMovingToolActivated.next(e)}textEditingToolActivation(e){this.isTextEditingToolActivated.next(e)}textAddingToolActivation(e){this.isTextAddingToolActivated.next(e)}drawLinkToolActivation(e){this.isDrawLinkToolActivated.next(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var $x=(()=>{class n{getOptimalSize(e,t){let o=document.documentElement.clientWidth,r=document.documentElement.clientHeight;return e>o&&(o=e),t>r&&(r=t),new jm(o,r)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var of=class extends Qd{getItemKey(i){return i.id}},rf=(()=>{class n extends of{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})(),jc=(()=>{class n extends of{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})(),af=(()=>{class n extends of{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})(),sf=(()=>{class n extends of{static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var _l=class{id;commandLine;computeId;console;consoleHost;consoleType;firstPortName;height;label;locked;name;nodeDirectory;nodeType;portNameFormat;portSegmentSize;ports;properties;projectId;status;symbol;symbolUrl;usage;width;x;y;z};var Wl=class{id;rotation;style;text;x;y;originalX;originalY;nodeId};var $c=(()=>{class n{calculate(e,t){let o=document.createElement("text");o.innerText=e,o.setAttribute("fill","#00000"),o.setAttribute("fill-opacity","0"),o.setAttribute("style",t),document.documentElement.appendChild(o);let r=o.getBoundingClientRect();return document.documentElement.removeChild(o),{width:r.width,height:r.height}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function Yo(n){return n>=48&&n<=57}function hs(n){return Yo(n)||n>=65&&n<=70||n>=97&&n<=102}function Wx(n){return n>=65&&n<=90}function hce(n){return n>=97&&n<=122}function fce(n){return Wx(n)||hce(n)}function gce(n){return n>=128}function Gx(n){return fce(n)||gce(n)||n===95}function B0(n){return Gx(n)||Yo(n)||n===45}function _ce(n){return n>=0&&n<=8||n===11||n>=14&&n<=31||n===127}function z0(n){return n===10||n===13||n===12}function Hc(n){return z0(n)||n===32||n===9}function Ha(n,i){return!(n!==92||z0(i)||i===0)}function lf(n,i,e){return n===45?Gx(i)||i===45||Ha(i,e):Gx(n)?!0:n===92?Ha(n,i):!1}function qx(n,i,e){return n===43||n===45?Yo(i)?2:i===46&&Yo(e)?3:0:n===46?Yo(i)?2:0:Yo(n)?1:0}function Qx(n){return n===65279||n===65534?1:0}var fP=new Array(128),vce=128,j0=130,gP=131,Xx=132,_P=133;for(let n=0;n<fP.length;n++)fP[n]=Hc(n)&&j0||Yo(n)&&gP||Gx(n)&&Xx||_ce(n)&&_P||n||vce;function Kx(n){return n<128?fP[n]:Xx}function cf(n,i){return i<n.length?n.charCodeAt(i):0}function Yx(n,i,e){return e===13&&cf(n,i+1)===10?2:1}function Id(n,i,e){let t=n.charCodeAt(i);return Wx(t)&&(t=t|32),t===e}function Ad(n,i,e,t){if(e-i!==t.length||i<0||e>n.length)return!1;for(let o=i;o<e;o++){let r=t.charCodeAt(o-i),a=n.charCodeAt(o);if(Wx(a)&&(a=a|32),a!==r)return!1}return!0}function DL(n,i){for(;i>=0&&Hc(n.charCodeAt(i));i--);return i+1}function $0(n,i){for(;i<n.length&&Hc(n.charCodeAt(i));i++);return i}function vP(n,i){for(;i<n.length&&Yo(n.charCodeAt(i));i++);return i}function Uc(n,i){if(i+=2,hs(cf(n,i-1))){for(let t=Math.min(n.length,i+5);i<t&&hs(cf(n,i));i++);let e=cf(n,i);Hc(e)&&(i+=Yx(n,i,e))}return i}function H0(n,i){for(;i<n.length;i++){let e=n.charCodeAt(i);if(!B0(e)){if(Ha(e,cf(n,i+1))){i=Uc(n,i)-1;continue}break}}return i}function hu(n,i){let e=n.charCodeAt(i);if((e===43||e===45)&&(e=n.charCodeAt(i+=1)),Yo(e)&&(i=vP(n,i+1),e=n.charCodeAt(i)),e===46&&Yo(n.charCodeAt(i+1))&&(i+=2,i=vP(n,i)),Id(n,i,101)){let t=0;e=n.charCodeAt(i+1),(e===45||e===43)&&(t=1,e=n.charCodeAt(i+2)),Yo(e)&&(i=vP(n,i+1+t+1))}return i}function Zx(n,i){for(;i<n.length;i++){let e=n.charCodeAt(i);if(e===41){i++;break}Ha(e,cf(n,i+1))&&(i=Uc(n,i))}return i}function U0(n){if(n.length===1&&!hs(n.charCodeAt(0)))return n[0];let i=parseInt(n,16);return(i===0||i>=55296&&i<=57343||i>1114111)&&(i=65533),String.fromCodePoint(i)}var df=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token"];function mf(n=null,i){return n===null||n.length<i?new Uint32Array(Math.max(i+1024,16384)):n}var PL=10,Cce=12,IL=13;function AL(n){let i=n.source,e=i.length,t=i.length>0?Qx(i.charCodeAt(0)):0,o=mf(n.lines,e),r=mf(n.columns,e),a=n.startLine,c=n.startColumn;for(let p=t;p<e;p++){let u=i.charCodeAt(p);o[p]=a,r[p]=c++,(u===PL||u===IL||u===Cce)&&(u===IL&&p+1<e&&i.charCodeAt(p+1)===PL&&(p++,o[p]=a,r[p]=c),a++,c=1)}o[e]=a,r[e]=c,n.lines=o,n.columns=r,n.computed=!0}var Jx=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(i,e=0,t=1,o=1){this.source=i,this.startOffset=e,this.startLine=t,this.startColumn=o,this.computed=!1}getLocation(i,e){return this.computed||AL(this),{source:e,offset:this.startOffset+i,line:this.lines[i],column:this.columns[i]}}getLocationRange(i,e,t){return this.computed||AL(this),{source:t,start:{offset:this.startOffset+i,line:this.lines[i],column:this.columns[i]},end:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}}};var vl=16777215,$m=24,bce=new Map([[2,22],[21,22],[19,20],[23,24]]),G0=class{constructor(i,e){this.setSource(i,e)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(i="",e=()=>{}){i=String(i||"");let t=i.length,o=mf(this.offsetAndType,i.length+1),r=mf(this.balance,i.length+1),a=0,c=0,p=0,u=-1;for(this.offsetAndType=null,this.balance=null,e(i,(h,_,S)=>{switch(h){default:r[a]=t;break;case c:{let x=p&vl;for(p=r[x],c=p>>$m,r[a]=x,r[x++]=a;x<a;x++)r[x]===t&&(r[x]=a);break}case 21:case 2:case 19:case 23:r[a]=p,c=bce.get(h),p=c<<$m|a;break}o[a++]=h<<$m|S,u===-1&&(u=_)}),o[a]=0<<$m|t,r[a]=t,r[t]=t;p!==0;){let h=p&vl;p=r[h],r[h]=t}this.source=i,this.firstCharOffset=u===-1?0:u,this.tokenCount=a,this.offsetAndType=o,this.balance=r,this.reset(),this.next()}lookupType(i){return i+=this.tokenIndex,i<this.tokenCount?this.offsetAndType[i]>>$m:0}lookupOffset(i){return i+=this.tokenIndex,i<this.tokenCount?this.offsetAndType[i-1]&vl:this.source.length}lookupValue(i,e){return i+=this.tokenIndex,i<this.tokenCount?Ad(this.source,this.offsetAndType[i-1]&vl,this.offsetAndType[i]&vl,e):!1}getTokenStart(i){return i===this.tokenIndex?this.tokenStart:i>0?i<this.tokenCount?this.offsetAndType[i-1]&vl:this.offsetAndType[this.tokenCount]&vl:this.firstCharOffset}substrToCursor(i){return this.source.substring(i,this.tokenStart)}isBalanceEdge(i){return this.balance[this.tokenIndex]<i}isDelim(i,e){return e?this.lookupType(e)===9&&this.source.charCodeAt(this.lookupOffset(e))===i:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===i}skip(i){let e=this.tokenIndex+i;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.offsetAndType[e-1]&vl,e=this.offsetAndType[e],this.tokenType=e>>$m,this.tokenEnd=e&vl):(this.tokenIndex=this.tokenCount,this.next())}next(){let i=this.tokenIndex+1;i<this.tokenCount?(this.tokenIndex=i,this.tokenStart=this.tokenEnd,i=this.offsetAndType[i],this.tokenType=i>>$m,this.tokenEnd=i&vl):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(i,e){let t=i,o,r;e:for(;t<this.tokenCount;t++){if(o=this.balance[t],o<i)break e;switch(r=t>0?this.offsetAndType[t-1]&vl:this.firstCharOffset,e(this.source.charCodeAt(r))){case 1:break e;case 2:t++;break e;default:this.balance[o]===t&&(t=o)}}this.skip(t-this.tokenIndex)}forEachToken(i){for(let e=0,t=this.firstCharOffset;e<this.tokenCount;e++){let o=t,r=this.offsetAndType[e],a=r&vl,c=r>>$m;t=a,i(c,o,a,e)}}dump(){let i=new Array(this.tokenCount);return this.forEachToken((e,t,o,r)=>{i[r]={idx:r,type:df[e],chunk:this.source.substring(t,o),balance:this.balance[r]}}),i}};function Um(n,i){function e(_){return _<c?n.charCodeAt(_):0}function t(){if(u=hu(n,u),lf(e(u),e(u+1),e(u+2))){h=12,u=H0(n,u);return}if(e(u)===37){h=11,u++;return}h=10}function o(){let _=u;if(u=H0(n,u),Ad(n,_,u,"url")&&e(u)===40){if(u=$0(n,u+1),e(u)===34||e(u)===39){h=2,u=_+4;return}a();return}if(e(u)===40){h=2,u++;return}h=1}function r(_){for(_||(_=e(u++)),h=5;u<n.length;u++){let S=n.charCodeAt(u);switch(Kx(S)){case _:u++;return;case j0:if(z0(S)){u+=Yx(n,u,S),h=6;return}break;case 92:if(u===n.length-1)break;let x=e(u+1);z0(x)?u+=Yx(n,u+1,x):Ha(S,x)&&(u=Uc(n,u)-1);break}}}function a(){for(h=7,u=$0(n,u);u<n.length;u++){let _=n.charCodeAt(u);switch(Kx(_)){case 41:u++;return;case j0:if(u=$0(n,u),e(u)===41||u>=n.length){u<n.length&&u++;return}u=Zx(n,u),h=8;return;case 34:case 39:case 40:case _P:u=Zx(n,u),h=8;return;case 92:if(Ha(_,e(u+1))){u=Uc(n,u)-1;break}u=Zx(n,u),h=8;return}}}n=String(n||"");let c=n.length,p=Qx(e(0)),u=p,h;for(;u<c;){let _=n.charCodeAt(u);switch(Kx(_)){case j0:h=13,u=$0(n,u+1);break;case 34:r();break;case 35:B0(e(u+1))||Ha(e(u+1),e(u+2))?(h=4,u=H0(n,u+1)):(h=9,u++);break;case 39:r();break;case 40:h=21,u++;break;case 41:h=22,u++;break;case 43:qx(_,e(u+1),e(u+2))?t():(h=9,u++);break;case 44:h=18,u++;break;case 45:qx(_,e(u+1),e(u+2))?t():e(u+1)===45&&e(u+2)===62?(h=15,u=u+3):lf(_,e(u+1),e(u+2))?o():(h=9,u++);break;case 46:qx(_,e(u+1),e(u+2))?t():(h=9,u++);break;case 47:e(u+1)===42?(h=25,u=n.indexOf("*/",u+2),u=u===-1?n.length:u+2):(h=9,u++);break;case 58:h=16,u++;break;case 59:h=17,u++;break;case 60:e(u+1)===33&&e(u+2)===45&&e(u+3)===45?(h=14,u=u+4):(h=9,u++);break;case 64:lf(e(u+1),e(u+2),e(u+3))?(h=3,u=H0(n,u+1)):(h=9,u++);break;case 91:h=19,u++;break;case 92:Ha(_,e(u+1))?o():(h=9,u++);break;case 93:h=20,u++;break;case 123:h=23,u++;break;case 125:h=24,u++;break;case gP:t();break;case Xx:o();break;default:h=9,u++}i(h,p,p=u)}}var pf=null,Ua=class n{static createItem(i){return{prev:null,next:null,data:i}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(i){return n.createItem(i)}allocateCursor(i,e){let t;return pf!==null?(t=pf,pf=pf.cursor,t.prev=i,t.next=e,t.cursor=this.cursor):t={prev:i,next:e,cursor:this.cursor},this.cursor=t,t}releaseCursor(){let{cursor:i}=this;this.cursor=i.cursor,i.prev=null,i.next=null,i.cursor=pf,pf=i}updateCursors(i,e,t,o){let{cursor:r}=this;for(;r!==null;)r.prev===i&&(r.prev=e),r.next===t&&(r.next=o),r=r.cursor}*[Symbol.iterator](){for(let i=this.head;i!==null;i=i.next)yield i.data}get size(){let i=0;for(let e=this.head;e!==null;e=e.next)i++;return i}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(i){let e=null;this.head=null;for(let t of i){let o=n.createItem(t);e!==null?e.next=o:this.head=o,o.prev=e,e=o}return this.tail=e,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(i,e=this){let t=this.allocateCursor(null,this.head);for(;t.next!==null;){let o=t.next;t.next=o.next,i.call(e,o.data,o,this)}this.releaseCursor()}forEachRight(i,e=this){let t=this.allocateCursor(this.tail,null);for(;t.prev!==null;){let o=t.prev;t.prev=o.prev,i.call(e,o.data,o,this)}this.releaseCursor()}reduce(i,e,t=this){let o=this.allocateCursor(null,this.head),r=e,a;for(;o.next!==null;)a=o.next,o.next=a.next,r=i.call(t,r,a.data,a,this);return this.releaseCursor(),r}reduceRight(i,e,t=this){let o=this.allocateCursor(this.tail,null),r=e,a;for(;o.prev!==null;)a=o.prev,o.prev=a.prev,r=i.call(t,r,a.data,a,this);return this.releaseCursor(),r}some(i,e=this){for(let t=this.head;t!==null;t=t.next)if(i.call(e,t.data,t,this))return!0;return!1}map(i,e=this){let t=new n;for(let o=this.head;o!==null;o=o.next)t.appendData(i.call(e,o.data,o,this));return t}filter(i,e=this){let t=new n;for(let o=this.head;o!==null;o=o.next)i.call(e,o.data,o,this)&&t.appendData(o.data);return t}nextUntil(i,e,t=this){if(i===null)return;let o=this.allocateCursor(null,i);for(;o.next!==null;){let r=o.next;if(o.next=r.next,e.call(t,r.data,r,this))break}this.releaseCursor()}prevUntil(i,e,t=this){if(i===null)return;let o=this.allocateCursor(i,null);for(;o.prev!==null;){let r=o.prev;if(o.prev=r.prev,e.call(t,r.data,r,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let i=new n;for(let e of this)i.appendData(e);return i}prepend(i){return this.updateCursors(null,i,this.head,i),this.head!==null?(this.head.prev=i,i.next=this.head):this.tail=i,this.head=i,this}prependData(i){return this.prepend(n.createItem(i))}append(i){return this.insert(i)}appendData(i){return this.insert(n.createItem(i))}insert(i,e=null){if(e!==null)if(this.updateCursors(e.prev,i,e,i),e.prev===null){if(this.head!==e)throw new Error("before doesn't belong to list");this.head=i,e.prev=i,i.next=e,this.updateCursors(null,i)}else e.prev.next=i,i.prev=e.prev,e.prev=i,i.next=e;else this.updateCursors(this.tail,i,null,i),this.tail!==null?(this.tail.next=i,i.prev=this.tail):this.head=i,this.tail=i;return this}insertData(i,e){return this.insert(n.createItem(i),e)}remove(i){if(this.updateCursors(i,i.prev,i,i.next),i.prev!==null)i.prev.next=i.next;else{if(this.head!==i)throw new Error("item doesn't belong to list");this.head=i.next}if(i.next!==null)i.next.prev=i.prev;else{if(this.tail!==i)throw new Error("item doesn't belong to list");this.tail=i.prev}return i.prev=null,i.next=null,i}push(i){this.insert(n.createItem(i))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(i){this.prepend(n.createItem(i))}shift(){return this.head!==null?this.remove(this.head):null}prependList(i){return this.insertList(i,this.head)}appendList(i){return this.insertList(i)}insertList(i,e){return i.head===null?this:(e!=null?(this.updateCursors(e.prev,i.tail,e,i.head),e.prev!==null?(e.prev.next=i.head,i.head.prev=e.prev):this.head=i.head,e.prev=i.tail,i.tail.next=e):(this.updateCursors(this.tail,i.tail,null,i.head),this.tail!==null?(this.tail.next=i.head,i.head.prev=this.tail):this.head=i.head,this.tail=i.tail),i.head=null,i.tail=null,this)}replace(i,e){"head"in e?this.insertList(e,i):this.insert(e,i),this.remove(i)}};function fu(n,i){let e=Object.create(SyntaxError.prototype),t=new Error;return Object.assign(e,{name:n,message:i,get stack(){return(t.stack||"").replace(/^(.+\n){1,3}/,`${n}: ${i}
`)}})}var bP=100,OL=60,NL=" ";function FL({source:n,line:i,column:e},t){function o(h,_){return r.slice(h,_).map((S,x)=>String(h+x+1).padStart(p)+" |"+S).join(`
`)}let r=n.split(/\r\n?|\n|\f/),a=Math.max(1,i-t)-1,c=Math.min(i+t,r.length+1),p=Math.max(4,String(c).length)+1,u=0;e+=(NL.length-1)*(r[i-1].substr(0,e-1).match(/\t/g)||[]).length,e>bP&&(u=e-OL+3,e=OL-2);for(let h=a;h<=c;h++)h>=0&&h<r.length&&(r[h]=r[h].replace(/\t/g,NL),r[h]=(u>0&&r[h].length>u?"\u2026":"")+r[h].substr(u,bP-2)+(r[h].length>u+bP-1?"\u2026":""));return[o(a,i),new Array(e+p+2).join("-")+"^",o(i,c)].filter(Boolean).join(`
`)}function xP(n,i,e,t,o){return Object.assign(fu("SyntaxError",n),{source:i,offset:e,line:t,column:o,sourceFragment(a){return FL({source:i,line:t,column:o},isNaN(a)?0:a)},get formattedMessage(){return`Parse error: ${n}
`+FL({source:i,line:t,column:o},2)}})}function RL(n){let i=this.createList(),e=!1,t={recognizer:n};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:e=!0,this.next();continue}let o=n.getNode.call(this,t);if(o===void 0)break;e&&(n.onWhiteSpace&&n.onWhiteSpace.call(this,o,i,t),e=!1),i.push(o)}return e&&n.onWhiteSpace&&n.onWhiteSpace.call(this,null,i,t),i}var LL=()=>{},xce=33,yce=35,yP=59,VL=123,BL=0;function Sce(n){return function(){return this[n]()}}function SP(n){let i=Object.create(null);for(let e in n){let t=n[e],o=t.parse||t;o&&(i[e]=o)}return i}function wce(n){let i={context:Object.create(null),scope:Object.assign(Object.create(null),n.scope),atrule:SP(n.atrule),pseudo:SP(n.pseudo),node:SP(n.node)};for(let e in n.parseContext)switch(typeof n.parseContext[e]){case"function":i.context[e]=n.parseContext[e];break;case"string":i.context[e]=Sce(n.parseContext[e]);break}return K(K({config:i},i),i.node)}function zL(n){let i="",e="<unknown>",t=!1,o=LL,r=!1,a=new Jx,c=Object.assign(new G0,wce(n||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:RL,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(u){return u===VL?1:0},consumeUntilLeftCurlyBracketOrSemicolon(u){return u===VL||u===yP?1:0},consumeUntilExclamationMarkOrSemicolon(u){return u===xce||u===yP?1:0},consumeUntilSemicolonIncluded(u){return u===yP?2:0},createList(){return new Ua},createSingleNodeList(u){return new Ua().appendData(u)},getFirstListNode(u){return u&&u.first},getLastListNode(u){return u&&u.last},parseWithFallback(u,h){let _=this.tokenIndex;try{return u.call(this)}catch(S){if(r)throw S;let x=h.call(this,_);return r=!0,o(S,x),r=!1,x}},lookupNonWSType(u){let h;do if(h=this.lookupType(u++),h!==13)return h;while(h!==BL);return BL},charCodeAt(u){return u>=0&&u<i.length?i.charCodeAt(u):0},substring(u,h){return i.substring(u,h)},substrToCursor(u){return this.source.substring(u,this.tokenStart)},cmpChar(u,h){return Id(i,u,h)},cmpStr(u,h,_){return Ad(i,u,h,_)},consume(u){let h=this.tokenStart;return this.eat(u),this.substrToCursor(h)},consumeFunctionName(){let u=i.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),u},consumeNumber(u){let h=i.substring(this.tokenStart,hu(i,this.tokenStart));return this.eat(u),h},eat(u){if(this.tokenType!==u){let h=df[u].slice(0,-6).replace(/-/g," ").replace(/^./,x=>x.toUpperCase()),_=`${/[[\](){}]/.test(h)?`"${h}"`:h} is expected`,S=this.tokenStart;switch(u){case 1:this.tokenType===2||this.tokenType===7?(S=this.tokenEnd-1,_="Identifier is expected but function found"):_="Identifier is expected";break;case 4:this.isDelim(yce)&&(this.next(),S++,_="Name is expected");break;case 11:this.tokenType===10&&(S=this.tokenEnd,_="Percent sign is expected");break}this.error(_,S)}this.next()},eatIdent(u){(this.tokenType!==1||this.lookupValue(0,u)===!1)&&this.error(`Identifier "${u}" is expected`),this.next()},eatDelim(u){this.isDelim(u)||this.error(`Delim "${String.fromCharCode(u)}" is expected`),this.next()},getLocation(u,h){return t?a.getLocationRange(u,h,e):null},getLocationFromList(u){if(t){let h=this.getFirstListNode(u),_=this.getLastListNode(u);return a.getLocationRange(h!==null?h.loc.start.offset-a.startOffset:this.tokenStart,_!==null?_.loc.end.offset-a.startOffset:this.tokenStart,e)}return null},error(u,h){let _=typeof h<"u"&&h<i.length?a.getLocation(h):this.eof?a.getLocation(DL(i,i.length-1)):a.getLocation(this.tokenStart);throw new xP(u||"Unexpected input",i,_.offset,_.line,_.column)}});return Object.assign(function(u,h){i=u,h=h||{},c.setSource(i,Um),a.setSource(i,h.offset,h.line,h.column),e=h.filename||"<unknown>",t=!!h.positions,o=typeof h.onParseError=="function"?h.onParseError:LL,r=!1,c.parseAtrulePrelude="parseAtrulePrelude"in h?!!h.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in h?!!h.parseRulePrelude:!0,c.parseValue="parseValue"in h?!!h.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in h?!!h.parseCustomProperty:!1;let{context:_="default",onComment:S}=h;if(!(_ in c.context))throw new Error("Unknown context `"+_+"`");typeof S=="function"&&c.forEachToken((b,M,w)=>{if(b===25){let y=c.getLocation(M,w),E=Ad(i,w-2,w,"*/")?i.slice(M+2,w-2):i.slice(M+2,w);S(E,y)}});let x=c.context[_].call(c,h);return c.eof||c.error(),x},{SyntaxError:xP,config:c.config})}var s7=Bs(r7(),1),a7=new Set(["Atrule","Selector","Declaration"]);function l7(n){let i=new s7.SourceMapGenerator,e={line:1,column:0},t={line:0,column:0},o={line:1,column:0},r={generated:o},a=1,c=0,p=!1,u=n.node;n.node=function(S){if(S.loc&&S.loc.start&&a7.has(S.type)){let x=S.loc.start.line,b=S.loc.start.column-1;(t.line!==x||t.column!==b)&&(t.line=x,t.column=b,e.line=a,e.column=c,p&&(p=!1,(e.line!==o.line||e.column!==o.column)&&i.addMapping(r)),p=!0,i.addMapping({source:S.loc.source,original:t,generated:e}))}u.call(this,S),p&&a7.has(S.type)&&(o.line=a,o.column=c)};let h=n.emit;n.emit=function(S,x,b){for(let M=0;M<S.length;M++)S.charCodeAt(M)===10?(a++,c=0):c++;h(S,x,b)};let _=n.result;return n.result=function(){return p&&i.addMapping(r),{css:_(),map:i}},n}var iy={};Ln(iy,{safe:()=>IP,spec:()=>Wce});var Hce=43,Uce=45,PP=(n,i)=>{if(n===9&&(n=i),typeof n=="string"){let e=n.charCodeAt(0);return e>127?32768:e<<8}return n},c7=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],Gce=c7.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function d7(n){let i=new Set(n.map(([e,t])=>PP(e)<<16|PP(t)));return function(e,t,o){let r=PP(t,o),a=o.charCodeAt(0);return(a===Uce&&t!==1&&t!==2&&t!==15||a===Hce?i.has(e<<16|a<<8):i.has(e<<16|r))&&this.emit(" ",13,!0),r}}var Wce=d7(c7),IP=d7(Gce);var qce=92;function Qce(n,i){if(typeof i=="function"){let e=null;n.children.forEach(t=>{e!==null&&i.call(this,e),this.node(t),e=t});return}n.children.forEach(this.node,this)}function Xce(n){Um(n,(i,e,t)=>{this.token(i,n.slice(e,t))})}function m7(n){let i=new Map;for(let e in n.node){let t=n.node[e];typeof(t.generate||t)=="function"&&i.set(e,t.generate||t)}return function(e,t){let o="",r=0,a={node(p){if(i.has(p.type))i.get(p.type).call(c,p);else throw new Error("Unknown node type: "+p.type)},tokenBefore:IP,token(p,u){r=this.tokenBefore(r,p,u),this.emit(u,p,!1),p===9&&u.charCodeAt(0)===qce&&this.emit(`
`,13,!0)},emit(p){o+=p},result(){return o}};t&&(typeof t.decorator=="function"&&(a=t.decorator(a)),t.sourceMap&&(a=l7(a)),t.mode in iy&&(a.tokenBefore=iy[t.mode]));let c={node:p=>a.node(p),children:Qce,token:(p,u)=>a.token(p,u),tokenize:Xce};return a.node(e),a.result()}}function p7(n){return{fromPlainObject(i){return n(i,{enter(e){e.children&&!(e.children instanceof Ua)&&(e.children=new Ua().fromArray(e.children))}}),i},toPlainObject(i){return n(i,{leave(e){e.children&&e.children instanceof Ua&&(e.children=e.children.toArray())}}),i}}}var{hasOwnProperty:AP}=Object.prototype,X0=function(){};function u7(n){return typeof n=="function"?n:X0}function h7(n,i){return function(e,t,o){e.type===i&&n.call(this,e,t,o)}}function Kce(n,i){let e=i.structure,t=[];for(let o in e){if(AP.call(e,o)===!1)continue;let r=e[o],a={name:o,type:!1,nullable:!1};Array.isArray(r)||(r=[r]);for(let c of r)c===null?a.nullable=!0:typeof c=="string"?a.type="node":Array.isArray(c)&&(a.type="list");a.type&&t.push(a)}return t.length?{context:i.walkContext,fields:t}:null}function Yce(n){let i={};for(let e in n.node)if(AP.call(n.node,e)){let t=n.node[e];if(!t.structure)throw new Error("Missed `structure` field in `"+e+"` node type definition");i[e]=Kce(e,t)}return i}function f7(n,i){let e=n.fields.slice(),t=n.context,o=typeof t=="string";return i&&e.reverse(),function(r,a,c,p){let u;o&&(u=a[t],a[t]=r);for(let h of e){let _=r[h.name];if(!h.nullable||_){if(h.type==="list"){if(i?_.reduceRight(p,!1):_.reduce(p,!1))return!0}else if(c(_))return!0}}o&&(a[t]=u)}}function g7({StyleSheet:n,Atrule:i,Rule:e,Block:t,DeclarationList:o}){return{Atrule:{StyleSheet:n,Atrule:i,Rule:e,Block:t},Rule:{StyleSheet:n,Atrule:i,Rule:e,Block:t},Declaration:{StyleSheet:n,Atrule:i,Rule:e,Block:t,DeclarationList:o}}}function _7(n){let i=Yce(n),e={},t={},o=Symbol("break-walk"),r=Symbol("skip-node");for(let u in i)AP.call(i,u)&&i[u]!==null&&(e[u]=f7(i[u],!1),t[u]=f7(i[u],!0));let a=g7(e),c=g7(t),p=function(u,h){function _(y,E,I){let D=S.call(w,y,E,I);return D===o?!0:D===r?!1:!!(b.hasOwnProperty(y.type)&&b[y.type](y,w,_,M)||x.call(w,y,E,I)===o)}let S=X0,x=X0,b=e,M=(y,E,I,D)=>y||_(E,I,D),w={break:o,skip:r,root:u,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof h=="function")S=h;else if(h&&(S=u7(h.enter),x=u7(h.leave),h.reverse&&(b=t),h.visit)){if(a.hasOwnProperty(h.visit))b=h.reverse?c[h.visit]:a[h.visit];else if(!i.hasOwnProperty(h.visit))throw new Error("Bad value `"+h.visit+"` for `visit` option (should be: "+Object.keys(i).sort().join(", ")+")");S=h7(S,h.visit),x=h7(x,h.visit)}if(S===X0&&x===X0)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");_(u)};return p.break=o,p.skip=r,p.find=function(u,h){let _=null;return p(u,function(S,x,b){if(h.call(this,S,x,b))return _=S,o}),_},p.findLast=function(u,h){let _=null;return p(u,{reverse:!0,enter(S,x,b){if(h.call(this,S,x,b))return _=S,o}}),_},p.findAll=function(u,h){let _=[];return p(u,function(S,x,b){h.call(this,S,x,b)&&_.push(S)}),_},p}function Zce(n){return n}function Jce(n){let{min:i,max:e,comma:t}=n;return i===0&&e===0?t?"#?":"*":i===0&&e===1?"?":i===1&&e===0?t?"#":"+":i===1&&e===1?"":(t?"#":"")+(i===e?"{"+i+"}":"{"+i+","+(e!==0?e:"")+"}")}function ede(n){if(n.type==="Range")return" ["+(n.min===null?"-\u221E":n.min)+","+(n.max===null?"\u221E":n.max)+"]";throw new Error("Unknown node type `"+n.type+"`")}function tde(n,i,e,t){let o=n.combinator===" "||t?n.combinator:" "+n.combinator+" ",r=n.terms.map(a=>OP(a,i,e,t)).join(o);return n.explicit||e?(t||r[0]===","?"[":"[ ")+r+(t?"]":" ]"):r}function OP(n,i,e,t){let o;switch(n.type){case"Group":o=tde(n,i,e,t)+(n.disallowEmpty?"!":"");break;case"Multiplier":return OP(n.term,i,e,t)+i(Jce(n),n);case"Type":o="<"+n.name+(n.opts?i(ede(n.opts),n.opts):"")+">";break;case"Property":o="<'"+n.name+"'>";break;case"Keyword":o=n.name;break;case"AtKeyword":o="@"+n.name;break;case"Function":o=n.name+"(";break;case"String":case"Token":o=n.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+n.type+"`")}return i(o,n)}function hf(n,i){let e=Zce,t=!1,o=!1;return typeof i=="function"?e=i:i&&(t=!!i.forceBraces,o=!!i.compact,typeof i.decorate=="function"&&(e=i.decorate)),OP(n,e,t,o)}var v7={offset:0,line:1,column:1};function nde(n,i){let e=n.tokens,t=n.longestMatch,o=t<e.length&&e[t].node||null,r=o!==i?o:null,a=0,c=0,p=0,u="",h,_;for(let S=0;S<e.length;S++){let x=e[S].value;S===t&&(c=x.length,a=u.length),r!==null&&e[S].node===r&&(S<=t?p++:p=0),u+=x}return t===e.length||p>1?(h=oy(r||i,"end")||K0(v7,u),_=K0(h)):(h=oy(r,"start")||K0(oy(i,"start")||v7,u.slice(0,a)),_=oy(r,"end")||K0(h,u.substr(a,c))),{css:u,mismatchOffset:a,mismatchLength:c,start:h,end:_}}function oy(n,i){let e=n&&n.loc&&n.loc[i];return e?"line"in e?K0(e):e:null}function K0({offset:n,line:i,column:e},t){let o={offset:n,line:i,column:e};if(t){let r=t.split(/\n|\r\n?|\f/);o.offset+=t.length,o.line+=r.length-1,o.column=r.length===1?o.column+t.length:r.pop().length+1}return o}var ff=function(n,i){let e=fu("SyntaxReferenceError",n+(i?" `"+i+"`":""));return e.reference=i,e},C7=function(n,i,e,t){let o=fu("SyntaxMatchError",n),{css:r,mismatchOffset:a,mismatchLength:c,start:p,end:u}=nde(t,e);return o.rawMessage=n,o.syntax=i?hf(i):"<generic>",o.css=r,o.mismatchOffset=a,o.mismatchLength=c,o.message=n+`
syntax: `+o.syntax+`
value: `+(r||"<empty string>")+`
--------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,p),o.loc={source:e&&e.loc&&e.loc.source||"<unknown>",start:p,end:u},o};var ry=new Map,gf=new Map,ay=45,sy=ide,NP=ode;function ly(n,i){return i=i||0,n.length-i>=2&&n.charCodeAt(i)===ay&&n.charCodeAt(i+1)===ay}function b7(n,i){if(i=i||0,n.length-i>=3&&n.charCodeAt(i)===ay&&n.charCodeAt(i+1)!==ay){let e=n.indexOf("-",i+2);if(e!==-1)return n.substring(i,e+1)}return""}function ide(n){if(ry.has(n))return ry.get(n);let i=n.toLowerCase(),e=ry.get(i);if(e===void 0){let t=ly(i,0),o=t?"":b7(i,0);e=Object.freeze({basename:i.substr(o.length),name:i,prefix:o,vendor:o,custom:t})}return ry.set(n,e),e}function ode(n){if(gf.has(n))return gf.get(n);let i=n,e=n[0];e==="/"?e=n[1]==="/"?"//":"/":e!=="_"&&e!=="*"&&e!=="$"&&e!=="#"&&e!=="+"&&e!=="&"&&(e="");let t=ly(i,e.length);if(!t&&(i=i.toLowerCase(),gf.has(i))){let c=gf.get(i);return gf.set(n,c),c}let o=t?"":b7(i,e.length),r=i.substr(0,e.length+o.length),a=Object.freeze({basename:i.substr(r.length),name:i.substr(e.length),hack:e,vendor:o,prefix:r,custom:t});return gf.set(n,a),a}var cy=["initial","inherit","unset","revert","revert-layer"];var Z0=43,Gc=45,FP=110,_f=!0,ade=!1;function LP(n,i){return n!==null&&n.type===9&&n.value.charCodeAt(0)===i}function Y0(n,i,e){for(;n!==null&&(n.type===13||n.type===25);)n=e(++i);return i}function Gm(n,i,e,t){if(!n)return 0;let o=n.value.charCodeAt(i);if(o===Z0||o===Gc){if(e)return 0;i++}for(;i<n.value.length;i++)if(!Yo(n.value.charCodeAt(i)))return 0;return t+1}function RP(n,i,e){let t=!1,o=Y0(n,i,e);if(n=e(o),n===null)return i;if(n.type!==10)if(LP(n,Z0)||LP(n,Gc)){if(t=!0,o=Y0(e(++o),o,e),n=e(o),n===null||n.type!==10)return 0}else return i;if(!t){let r=n.value.charCodeAt(0);if(r!==Z0&&r!==Gc)return 0}return Gm(n,t?0:1,t,o)}function VP(n,i){let e=0;if(!n)return 0;if(n.type===10)return Gm(n,0,ade,e);if(n.type===1&&n.value.charCodeAt(0)===Gc){if(!Id(n.value,1,FP))return 0;switch(n.value.length){case 2:return RP(i(++e),e,i);case 3:return n.value.charCodeAt(2)!==Gc?0:(e=Y0(i(++e),e,i),n=i(e),Gm(n,0,_f,e));default:return n.value.charCodeAt(2)!==Gc?0:Gm(n,3,_f,e)}}else if(n.type===1||LP(n,Z0)&&i(e+1).type===1){if(n.type!==1&&(n=i(++e)),n===null||!Id(n.value,0,FP))return 0;switch(n.value.length){case 1:return RP(i(++e),e,i);case 2:return n.value.charCodeAt(1)!==Gc?0:(e=Y0(i(++e),e,i),n=i(e),Gm(n,0,_f,e));default:return n.value.charCodeAt(1)!==Gc?0:Gm(n,2,_f,e)}}else if(n.type===12){let t=n.value.charCodeAt(0),o=t===Z0||t===Gc?1:0,r=o;for(;r<n.value.length&&Yo(n.value.charCodeAt(r));r++);return r===o||!Id(n.value,r,FP)?0:r+1===n.value.length?RP(i(++e),e,i):n.value.charCodeAt(r+1)!==Gc?0:r+2===n.value.length?(e=Y0(i(++e),e,i),n=i(e),Gm(n,0,_f,e)):Gm(n,r+2,_f,e)}return 0}var sde=43,x7=45,y7=63,lde=117;function BP(n,i){return n!==null&&n.type===9&&n.value.charCodeAt(0)===i}function cde(n,i){return n.value.charCodeAt(0)===i}function J0(n,i,e){let t=0;for(let o=i;o<n.value.length;o++){let r=n.value.charCodeAt(o);if(r===x7&&e&&t!==0)return J0(n,i+t+1,!1),6;if(!hs(r)||++t>6)return 0}return t}function dy(n,i,e){if(!n)return 0;for(;BP(e(i),y7);){if(++n>6)return 0;i++}return i}function zP(n,i){let e=0;if(n===null||n.type!==1||!Id(n.value,0,lde)||(n=i(++e),n===null))return 0;if(BP(n,sde))return n=i(++e),n===null?0:n.type===1?dy(J0(n,0,!0),++e,i):BP(n,y7)?dy(1,++e,i):0;if(n.type===10){let t=J0(n,1,!0);return t===0?0:(n=i(++e),n===null?e:n.type===12||n.type===10?!cde(n,x7)||!J0(n,1,!1)?0:e+1:dy(t,e,i))}return n.type===12?dy(J0(n,1,!0),++e,i):0}var dde=["calc(","-moz-calc(","-webkit-calc("],jP=new Map([[2,22],[21,22],[19,20],[23,24]]);function ql(n,i){return i<n.length?n.charCodeAt(i):0}function S7(n,i){return Ad(n,0,n.length,i)}function w7(n,i){for(let e=0;e<i.length;e++)if(S7(n,i[e]))return!0;return!1}function M7(n,i){return i!==n.length-2?!1:ql(n,i)===92&&Yo(ql(n,i+1))}function my(n,i,e){if(n&&n.type==="Range"){let t=Number(e!==void 0&&e!==i.length?i.substr(0,e):i);if(isNaN(t)||n.min!==null&&t<n.min&&typeof n.min!="string"||n.max!==null&&t>n.max&&typeof n.max!="string")return!0}return!1}function mde(n,i){let e=0,t=[],o=0;e:do{switch(n.type){case 24:case 22:case 20:if(n.type!==e)break e;if(e=t.pop(),t.length===0){o++;break e}break;case 2:case 21:case 19:case 23:t.push(e),e=jP.get(n.type);break}o++}while(n=i(o));return o}function bl(n){return function(i,e,t){return i===null?0:i.type===2&&w7(i.value,dde)?mde(i,e):n(i,e,t)}}function Po(n){return function(i){return i===null||i.type!==n?0:1}}function pde(n){if(n===null||n.type!==1)return 0;let i=n.value.toLowerCase();return w7(i,cy)||S7(i,"default")?0:1}function ude(n){return n===null||n.type!==1||ql(n.value,0)!==45||ql(n.value,1)!==45?0:1}function hde(n){if(n===null||n.type!==4)return 0;let i=n.value.length;if(i!==4&&i!==5&&i!==7&&i!==9)return 0;for(let e=1;e<i;e++)if(!hs(ql(n.value,e)))return 0;return 1}function fde(n){return n===null||n.type!==4||!lf(ql(n.value,1),ql(n.value,2),ql(n.value,3))?0:1}function gde(n,i){if(!n)return 0;let e=0,t=[],o=0;e:do{switch(n.type){case 6:case 8:break e;case 24:case 22:case 20:if(n.type!==e)break e;e=t.pop();break;case 17:if(e===0)break e;break;case 9:if(e===0&&n.value==="!")break e;break;case 2:case 21:case 19:case 23:t.push(e),e=jP.get(n.type);break}o++}while(n=i(o));return o}function _de(n,i){if(!n)return 0;let e=0,t=[],o=0;e:do{switch(n.type){case 6:case 8:break e;case 24:case 22:case 20:if(n.type!==e)break e;e=t.pop();break;case 2:case 21:case 19:case 23:t.push(e),e=jP.get(n.type);break}o++}while(n=i(o));return o}function Fd(n){return n&&(n=new Set(n)),function(i,e,t){if(i===null||i.type!==12)return 0;let o=hu(i.value,0);if(n!==null){let r=i.value.indexOf("\\",o),a=r===-1||!M7(i.value,r)?i.value.substr(o):i.value.substring(o,r);if(n.has(a.toLowerCase())===!1)return 0}return my(t,i.value,o)?0:1}}function vde(n,i,e){return n===null||n.type!==11||my(e,n.value,n.value.length-1)?0:1}function k7(n){return typeof n!="function"&&(n=function(){return 0}),function(i,e,t){return i!==null&&i.type===10&&Number(i.value)===0?1:n(i,e,t)}}function Cde(n,i,e){if(n===null)return 0;let t=hu(n.value,0);return!(t===n.value.length)&&!M7(n.value,t)||my(e,n.value,t)?0:1}function bde(n,i,e){if(n===null||n.type!==10)return 0;let t=ql(n.value,0)===43||ql(n.value,0)===45?1:0;for(;t<n.value.length;t++)if(!Yo(ql(n.value,t)))return 0;return my(e,n.value,t)?0:1}var xde={"ident-token":Po(1),"function-token":Po(2),"at-keyword-token":Po(3),"hash-token":Po(4),"string-token":Po(5),"bad-string-token":Po(6),"url-token":Po(7),"bad-url-token":Po(8),"delim-token":Po(9),"number-token":Po(10),"percentage-token":Po(11),"dimension-token":Po(12),"whitespace-token":Po(13),"CDO-token":Po(14),"CDC-token":Po(15),"colon-token":Po(16),"semicolon-token":Po(17),"comma-token":Po(18),"[-token":Po(19),"]-token":Po(20),"(-token":Po(21),")-token":Po(22),"{-token":Po(23),"}-token":Po(24)},yde={string:Po(5),ident:Po(1),percentage:bl(vde),zero:k7(),number:bl(Cde),integer:bl(bde),"custom-ident":pde,"custom-property-name":ude,"hex-color":hde,"id-selector":fde,"an-plus-b":VP,urange:zP,"declaration-value":gde,"any-value":_de};function Sde(n){let{angle:i,decibel:e,frequency:t,flex:o,length:r,resolution:a,semitones:c,time:p}=n||{};return{dimension:bl(Fd(null)),angle:bl(Fd(i)),decibel:bl(Fd(e)),frequency:bl(Fd(t)),flex:bl(Fd(o)),length:bl(k7(Fd(r))),resolution:bl(Fd(a)),semitones:bl(Fd(c)),time:bl(Fd(p))}}function T7(n){return K(K(K({},xde),yde),Sde(n))}var py={};Ln(py,{angle:()=>Mde,decibel:()=>Pde,flex:()=>Dde,frequency:()=>Tde,length:()=>wde,resolution:()=>Ede,semitones:()=>Ide,time:()=>kde});var wde=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],Mde=["deg","grad","rad","turn"],kde=["s","ms"],Tde=["hz","khz"],Ede=["dpi","dpcm","dppx","x"],Dde=["fr"],Pde=["db"],Ide=["st"];function $P(n,i,e){return Object.assign(fu("SyntaxError",n),{input:i,offset:e,rawMessage:n,message:n+`
`+i+`
--`+new Array((e||i.length)+1).join("-")+"^"})}var Ade=9,Ode=10,Nde=12,Fde=13,Rde=32,uy=class{constructor(i){this.str=i,this.pos=0}charCodeAt(i){return i<this.str.length?this.str.charCodeAt(i):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(i){return this.charCodeAt(this.findWsEnd(i))}findWsEnd(i){for(;i<this.str.length;i++){let e=this.str.charCodeAt(i);if(e!==Fde&&e!==Ode&&e!==Nde&&e!==Rde&&e!==Ade)break}return i}substringToPos(i){return this.str.substring(this.pos,this.pos=i)}eat(i){this.charCode()!==i&&this.error("Expect `"+String.fromCharCode(i)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(i){throw new $P(i,this.str,this.pos)}};var Lde=9,Vde=10,Bde=12,zde=13,jde=32,F7=33,GP=35,E7=38,hy=39,R7=40,$de=41,L7=42,WP=43,qP=44,D7=45,QP=60,V7=62,UP=63,Hde=64,vy=91,XP=93,fy=123,P7=124,I7=125,A7=8734,ev=new Uint8Array(128).map((n,i)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(i))?1:0),O7={" ":1,"&&":2,"||":3,"|":4};function gy(n){return n.substringToPos(n.findWsEnd(n.pos))}function vf(n){let i=n.pos;for(;i<n.str.length;i++){let e=n.str.charCodeAt(i);if(e>=128||ev[e]===0)break}return n.pos===i&&n.error("Expect a keyword"),n.substringToPos(i)}function _y(n){let i=n.pos;for(;i<n.str.length;i++){let e=n.str.charCodeAt(i);if(e<48||e>57)break}return n.pos===i&&n.error("Expect a number"),n.substringToPos(i)}function Ude(n){let i=n.str.indexOf("'",n.pos+1);return i===-1&&(n.pos=n.str.length,n.error("Expect an apostrophe")),n.substringToPos(i+1)}function N7(n){let i=null,e=null;return n.eat(fy),i=_y(n),n.charCode()===qP?(n.pos++,n.charCode()!==I7&&(e=_y(n))):e=i,n.eat(I7),{min:Number(i),max:e?Number(e):0}}function Gde(n){let i=null,e=!1;switch(n.charCode()){case L7:n.pos++,i={min:0,max:0};break;case WP:n.pos++,i={min:1,max:0};break;case UP:n.pos++,i={min:0,max:1};break;case GP:n.pos++,e=!0,n.charCode()===fy?i=N7(n):n.charCode()===UP?(n.pos++,i={min:0,max:0}):i={min:1,max:0};break;case fy:i=N7(n);break;default:return null}return{type:"Multiplier",comma:e,min:i.min,max:i.max,term:null}}function Cf(n,i){let e=Gde(n);return e!==null?(e.term=i,n.charCode()===GP&&n.charCodeAt(n.pos-1)===WP?Cf(n,e):e):i}function HP(n){let i=n.peek();return i===""?null:{type:"Token",value:i}}function Wde(n){let i;return n.eat(QP),n.eat(hy),i=vf(n),n.eat(hy),n.eat(V7),Cf(n,{type:"Property",name:i})}function qde(n){let i=null,e=null,t=1;return n.eat(vy),n.charCode()===D7&&(n.peek(),t=-1),t==-1&&n.charCode()===A7?n.peek():(i=t*Number(_y(n)),ev[n.charCode()]!==0&&(i+=vf(n))),gy(n),n.eat(qP),gy(n),n.charCode()===A7?n.peek():(t=1,n.charCode()===D7&&(n.peek(),t=-1),e=t*Number(_y(n)),ev[n.charCode()]!==0&&(e+=vf(n))),n.eat(XP),{type:"Range",min:i,max:e}}function Qde(n){let i,e=null;return n.eat(QP),i=vf(n),n.charCode()===R7&&n.nextCharCode()===$de&&(n.pos+=2,i+="()"),n.charCodeAt(n.findWsEnd(n.pos))===vy&&(gy(n),e=qde(n)),n.eat(V7),Cf(n,{type:"Type",name:i,opts:e})}function Xde(n){let i=vf(n);return n.charCode()===R7?(n.pos++,{type:"Function",name:i}):Cf(n,{type:"Keyword",name:i})}function Kde(n,i){function e(o,r){return{type:"Group",terms:o,combinator:r,disallowEmpty:!1,explicit:!1}}let t;for(i=Object.keys(i).sort((o,r)=>O7[o]-O7[r]);i.length>0;){t=i.shift();let o=0,r=0;for(;o<n.length;o++){let a=n[o];a.type==="Combinator"&&(a.value===t?(r===-1&&(r=o-1),n.splice(o,1),o--):(r!==-1&&o-r>1&&(n.splice(r,o-r,e(n.slice(r,o),t)),o=r+1),r=-1))}r!==-1&&i.length&&n.splice(r,o-r,e(n.slice(r,o),t))}return t}function B7(n){let i=[],e={},t,o=null,r=n.pos;for(;t=Zde(n);)t.type!=="Spaces"&&(t.type==="Combinator"?((o===null||o.type==="Combinator")&&(n.pos=r,n.error("Unexpected combinator")),e[t.value]=!0):o!==null&&o.type!=="Combinator"&&(e[" "]=!0,i.push({type:"Combinator",value:" "})),i.push(t),o=t,r=n.pos);return o!==null&&o.type==="Combinator"&&(n.pos-=r,n.error("Unexpected combinator")),{type:"Group",terms:i,combinator:Kde(i,e)||" ",disallowEmpty:!1,explicit:!1}}function Yde(n){let i;return n.eat(vy),i=B7(n),n.eat(XP),i.explicit=!0,n.charCode()===F7&&(n.pos++,i.disallowEmpty=!0),i}function Zde(n){let i=n.charCode();if(i<128&&ev[i]===1)return Xde(n);switch(i){case XP:break;case vy:return Cf(n,Yde(n));case QP:return n.nextCharCode()===hy?Wde(n):Qde(n);case P7:return{type:"Combinator",value:n.substringToPos(n.pos+(n.nextCharCode()===P7?2:1))};case E7:return n.pos++,n.eat(E7),{type:"Combinator",value:"&&"};case qP:return n.pos++,{type:"Comma"};case hy:return Cf(n,{type:"String",value:Ude(n)});case jde:case Lde:case Vde:case zde:case Bde:return{type:"Spaces",value:gy(n)};case Hde:return i=n.nextCharCode(),i<128&&ev[i]===1?(n.pos++,{type:"AtKeyword",name:vf(n)}):HP(n);case L7:case WP:case UP:case GP:case F7:break;case fy:if(i=n.nextCharCode(),i<48||i>57)return HP(n);break;default:return HP(n)}}function tv(n){let i=new uy(n),e=B7(i);return i.pos!==n.length&&i.error("Unexpected input"),e.terms.length===1&&e.terms[0].type==="Group"?e.terms[0]:e}var nv=function(){};function z7(n){return typeof n=="function"?n:nv}function KP(n,i,e){function t(a){switch(o.call(e,a),a.type){case"Group":a.terms.forEach(t);break;case"Multiplier":t(a.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+a.type)}r.call(e,a)}let o=nv,r=nv;if(typeof i=="function"?o=i:i&&(o=z7(i.enter),r=z7(i.leave)),o===nv&&r===nv)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");t(n,e)}var eme={decorator(n){let i=[],e=null;return it(K({},n),{node(t){let o=e;e=t,n.node.call(this,t),e=o},emit(t,o,r){i.push({type:o,value:t,node:r?null:e})},result(){return i}})}};function tme(n){let i=[];return Um(n,(e,t,o)=>i.push({type:e,value:n.slice(t,o),node:null})),i}function j7(n,i){return typeof n=="string"?tme(n):i.generate(n,eme)}var $i={type:"Match"},co={type:"Mismatch"},Cy={type:"DisallowEmpty"},nme=40,ime=41;function Ta(n,i,e){return i===$i&&e===co||n===$i&&i===$i&&e===$i?n:(n.type==="If"&&n.else===co&&i===$i&&(i=n.then,n=n.match),{type:"If",match:n,then:i,else:e})}function H7(n){return n.length>2&&n.charCodeAt(n.length-2)===nme&&n.charCodeAt(n.length-1)===ime}function $7(n){return n.type==="Keyword"||n.type==="AtKeyword"||n.type==="Function"||n.type==="Type"&&H7(n.name)}function YP(n,i,e){switch(n){case" ":{let t=$i;for(let o=i.length-1;o>=0;o--){let r=i[o];t=Ta(r,t,co)}return t}case"|":{let t=co,o=null;for(let r=i.length-1;r>=0;r--){let a=i[r];if($7(a)&&(o===null&&r>0&&$7(i[r-1])&&(o=Object.create(null),t=Ta({type:"Enum",map:o},$i,t)),o!==null)){let c=(H7(a.name)?a.name.slice(0,-1):a.name).toLowerCase();if(!(c in o)){o[c]=a;continue}}o=null,t=Ta(a,$i,t)}return t}case"&&":{if(i.length>5)return{type:"MatchOnce",terms:i,all:!0};let t=co;for(let o=i.length-1;o>=0;o--){let r=i[o],a;i.length>1?a=YP(n,i.filter(function(c){return c!==r}),!1):a=$i,t=Ta(r,a,t)}return t}case"||":{if(i.length>5)return{type:"MatchOnce",terms:i,all:!1};let t=e?$i:co;for(let o=i.length-1;o>=0;o--){let r=i[o],a;i.length>1?a=YP(n,i.filter(function(c){return c!==r}),!0):a=$i,t=Ta(r,a,t)}return t}}}function ome(n){let i=$i,e=ZP(n.term);if(n.max===0)e=Ta(e,Cy,co),i=Ta(e,null,co),i.then=Ta($i,$i,i),n.comma&&(i.then.else=Ta({type:"Comma",syntax:n},i,co));else for(let t=n.min||1;t<=n.max;t++)n.comma&&i!==$i&&(i=Ta({type:"Comma",syntax:n},i,co)),i=Ta(e,Ta($i,$i,i),co);if(n.min===0)i=Ta($i,$i,i);else for(let t=0;t<n.min-1;t++)n.comma&&i!==$i&&(i=Ta({type:"Comma",syntax:n},i,co)),i=Ta(e,i,co);return i}function ZP(n){if(typeof n=="function")return{type:"Generic",fn:n};switch(n.type){case"Group":{let i=YP(n.combinator,n.terms.map(ZP),!1);return n.disallowEmpty&&(i=Ta(i,Cy,co)),i}case"Multiplier":return ome(n);case"Type":case"Property":return{type:n.type,name:n.name,syntax:n};case"Keyword":return{type:n.type,name:n.name.toLowerCase(),syntax:n};case"AtKeyword":return{type:n.type,name:"@"+n.name.toLowerCase(),syntax:n};case"Function":return{type:n.type,name:n.name.toLowerCase()+"(",syntax:n};case"String":return n.value.length===3?{type:"Token",value:n.value.charAt(1),syntax:n}:{type:n.type,value:n.value.substr(1,n.value.length-2).replace(/\\'/g,"'"),syntax:n};case"Token":return{type:n.type,value:n.value,syntax:n};case"Comma":return{type:n.type,syntax:n};default:throw new Error("Unknown node type:",n.type)}}function by(n,i){return typeof n=="string"&&(n=tv(n)),{type:"MatchGraph",match:ZP(n),syntax:i||null,source:n}}var{hasOwnProperty:U7}=Object.prototype,rme=0,ame=1,eI=2,X7=3,G7="Match",sme="Mismatch",lme="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",W7=15e3,cme=0;function dme(n){let i=null,e=null,t=n;for(;t!==null;)e=t.prev,t.prev=i,i=t,t=e;return i}function JP(n,i){if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){let t=i.charCodeAt(e),o=n.charCodeAt(e);if(o>=65&&o<=90&&(o=o|32),o!==t)return!1}return!0}function mme(n){return n.type!==9?!1:n.value!=="?"}function q7(n){return n===null?!0:n.type===18||n.type===2||n.type===21||n.type===19||n.type===23||mme(n)}function Q7(n){return n===null?!0:n.type===22||n.type===20||n.type===24||n.type===9&&n.value==="/"}function pme(n,i,e){function t(){do E++,y=E<n.length?n[E]:null;while(y!==null&&(y.type===13||y.type===25))}function o(N){let P=E+N;return P<n.length?n[P]:null}function r(N,P){return{nextState:N,matchStack:D,syntaxStack:_,thenStack:S,tokenIndex:E,prev:P}}function a(N){S={nextState:N,matchStack:D,syntaxStack:_,prev:S}}function c(N){x=r(N,x)}function p(){D={type:ame,syntax:i.syntax,token:y,prev:D},t(),b=null,E>I&&(I=E)}function u(){_={syntax:i.syntax,opts:i.syntax.opts||_!==null&&_.opts||null,prev:_},D={type:eI,syntax:i.syntax,token:D.token,prev:D}}function h(){D.type===eI?D=D.prev:D={type:X7,syntax:_.syntax,token:D.token,prev:D},_=_.prev}let _=null,S=null,x=null,b=null,M=0,w=null,y=null,E=-1,I=0,D={type:rme,syntax:null,token:null,prev:null};for(t();w===null&&++M<W7;)switch(i.type){case"Match":if(S===null){if(y!==null&&(E!==n.length-1||y.value!=="\\0"&&y.value!=="\\9")){i=co;break}w=G7;break}if(i=S.nextState,i===Cy)if(S.matchStack===D){i=co;break}else i=$i;for(;S.syntaxStack!==_;)h();S=S.prev;break;case"Mismatch":if(b!==null&&b!==!1)(x===null||E>x.tokenIndex)&&(x=b,b=!1);else if(x===null){w=sme;break}i=x.nextState,S=x.thenStack,_=x.syntaxStack,D=x.matchStack,E=x.tokenIndex,y=E<n.length?n[E]:null,x=x.prev;break;case"MatchGraph":i=i.match;break;case"If":i.else!==co&&c(i.else),i.then!==$i&&a(i.then),i=i.match;break;case"MatchOnce":i={type:"MatchOnceBuffer",syntax:i,index:0,mask:0};break;case"MatchOnceBuffer":{let L=i.syntax.terms;if(i.index===L.length){if(i.mask===0||i.syntax.all){i=co;break}i=$i;break}if(i.mask===(1<<L.length)-1){i=$i;break}for(;i.index<L.length;i.index++){let re=1<<i.index;if((i.mask&re)===0){c(i),a({type:"AddMatchOnce",syntax:i.syntax,mask:i.mask|re}),i=L[i.index++];break}}break}case"AddMatchOnce":i={type:"MatchOnceBuffer",syntax:i.syntax,index:0,mask:i.mask};break;case"Enum":if(y!==null){let L=y.value.toLowerCase();if(L.indexOf("\\")!==-1&&(L=L.replace(/\\[09].*$/,"")),U7.call(i.map,L)){i=i.map[L];break}}i=co;break;case"Generic":{let L=_!==null?_.opts:null,re=E+Math.floor(i.fn(y,o,L));if(!isNaN(re)&&re>E){for(;E<re;)p();i=$i}else i=co;break}case"Type":case"Property":{let L=i.type==="Type"?"types":"properties",re=U7.call(e,L)?e[L][i.name]:null;if(!re||!re.match)throw new Error("Bad syntax reference: "+(i.type==="Type"?"<"+i.name+">":"<'"+i.name+"'>"));if(b!==!1&&y!==null&&i.type==="Type"&&(i.name==="custom-ident"&&y.type===1||i.name==="length"&&y.value==="0")){b===null&&(b=r(i,x)),i=co;break}u(),i=re.match;break}case"Keyword":{let L=i.name;if(y!==null){let re=y.value;if(re.indexOf("\\")!==-1&&(re=re.replace(/\\[09].*$/,"")),JP(re,L)){p(),i=$i;break}}i=co;break}case"AtKeyword":case"Function":if(y!==null&&JP(y.value,i.name)){p(),i=$i;break}i=co;break;case"Token":if(y!==null&&y.value===i.value){p(),i=$i;break}i=co;break;case"Comma":y!==null&&y.type===18?q7(D.token)?i=co:(p(),i=Q7(y)?co:$i):i=q7(D.token)||Q7(y)?$i:co;break;case"String":let N="",P=E;for(;P<n.length&&N.length<i.value.length;P++)N+=n[P].value;if(JP(N,i.value)){for(;E<P;)p();i=$i}else i=co;break;default:throw new Error("Unknown node type: "+i.type)}switch(cme+=M,w){case null:console.warn("[csstree-match] BREAK after "+W7+" iterations"),w=lme,D=null;break;case G7:for(;_!==null;)h();break;default:D=null}return{tokens:n,reason:w,iterations:M,match:D,longestMatch:I}}function tI(n,i,e){let t=pme(n,i,e||{});if(t.match===null)return t;let o=t.match,r=t.match={syntax:i.syntax||null,match:[]},a=[r];for(o=dme(o).prev;o!==null;){switch(o.type){case eI:r.match.push(r={syntax:o.syntax,match:[]}),a.push(r);break;case X7:a.pop(),r=a[a.length-1];break;default:r.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return t}var iI={};Ln(iI,{getTrace:()=>K7,isKeyword:()=>fme,isProperty:()=>hme,isType:()=>ume});function K7(n){function i(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function e(o){if(Array.isArray(o.match)){for(let r=0;r<o.match.length;r++)if(e(o.match[r]))return i(o.syntax)&&t.unshift(o.syntax),!0}else if(o.node===n)return t=i(o.syntax)?[o.syntax]:[],!0;return!1}let t=null;return this.matched!==null&&e(this.matched),t}function ume(n,i){return nI(this,n,e=>e.type==="Type"&&e.name===i)}function hme(n,i){return nI(this,n,e=>e.type==="Property"&&e.name===i)}function fme(n){return nI(this,n,i=>i.type==="Keyword")}function nI(n,i,e){let t=K7.call(n,i);return t===null?!1:t.some(e)}function Y7(n){return"node"in n?n.node:Y7(n.match[0])}function Z7(n){return"node"in n?n.node:Z7(n.match[n.match.length-1])}function oI(n,i,e,t,o){function r(c){if(c.syntax!==null&&c.syntax.type===t&&c.syntax.name===o){let p=Y7(c),u=Z7(c);n.syntax.walk(i,function(h,_,S){if(h===p){let x=new Ua;do{if(x.appendData(_.data),_.data===u)break;_=_.next}while(_!==null);a.push({parent:S,nodes:x})}})}Array.isArray(c.match)&&c.match.forEach(r)}let a=[];return e.matched!==null&&r(e.matched),a}var{hasOwnProperty:iv}=Object.prototype;function rI(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n&&n>=0}function J7(n){return!!n&&rI(n.offset)&&rI(n.line)&&rI(n.column)}function gme(n,i){return function(t,o){if(!t||t.constructor!==Object)return o(t,"Type of node should be an Object");for(let r in t){let a=!0;if(iv.call(t,r)!==!1){if(r==="type")t.type!==n&&o(t,"Wrong node type `"+t.type+"`, expected `"+n+"`");else if(r==="loc"){if(t.loc===null)continue;if(t.loc&&t.loc.constructor===Object)if(typeof t.loc.source!="string")r+=".source";else if(!J7(t.loc.start))r+=".start";else if(!J7(t.loc.end))r+=".end";else continue;a=!1}else if(i.hasOwnProperty(r)){a=!1;for(let c=0;!a&&c<i[r].length;c++){let p=i[r][c];switch(p){case String:a=typeof t[r]=="string";break;case Boolean:a=typeof t[r]=="boolean";break;case null:a=t[r]===null;break;default:typeof p=="string"?a=t[r]&&t[r].type===p:Array.isArray(p)&&(a=t[r]instanceof Ua)}}}else o(t,"Unknown field `"+r+"` for "+n+" node type");a||o(t,"Bad value for `"+n+"."+r+"`")}}for(let r in i)iv.call(i,r)&&iv.call(t,r)===!1&&o(t,"Field `"+n+"."+r+"` is missed")}}function _me(n,i){let e=i.structure,t={type:String,loc:!0},o={type:'"'+n+'"'};for(let r in e){if(iv.call(e,r)===!1)continue;let a=[],c=t[r]=Array.isArray(e[r])?e[r].slice():[e[r]];for(let p=0;p<c.length;p++){let u=c[p];if(u===String||u===Boolean)a.push(u.name);else if(u===null)a.push("null");else if(typeof u=="string")a.push("<"+u+">");else if(Array.isArray(u))a.push("List");else throw new Error("Wrong value `"+u+"` in `"+n+"."+r+"` structure definition")}o[r]=a.join(" | ")}return{docs:o,check:gme(n,t)}}function eV(n){let i={};if(n.node){for(let e in n.node)if(iv.call(n.node,e)){let t=n.node[e];if(t.structure)i[e]=_me(e,t);else throw new Error("Missed `structure` field in `"+e+"` node type definition")}}return i}var vme=by(cy.join(" | "));function aI(n,i,e){let t={};for(let o in n)n[o].syntax&&(t[o]=e?n[o].syntax:hf(n[o].syntax,{compact:i}));return t}function Cme(n,i,e){let t={};for(let[o,r]of Object.entries(n))t[o]={prelude:r.prelude&&(e?r.prelude.syntax:hf(r.prelude.syntax,{compact:i})),descriptors:r.descriptors&&aI(r.descriptors,i,e)};return t}function bme(n){for(let i=0;i<n.length;i++)if(n[i].value.toLowerCase()==="var(")return!0;return!1}function Ql(n,i,e){return K({matched:n,iterations:e,error:i},iI)}function bf(n,i,e,t){let o=j7(e,n.syntax),r;return bme(o)?Ql(null,new Error("Matching for a tree with var() is not supported")):(t&&(r=tI(o,n.cssWideKeywordsSyntax,n)),(!t||!r.match)&&(r=tI(o,i.match,n),!r.match)?Ql(null,new C7(r.reason,i.syntax,e,r),r.iterations):Ql(r.match,null,r.iterations))}var xf=class{constructor(i,e,t){if(this.cssWideKeywordsSyntax=vme,this.syntax=e,this.generic=!1,this.units=K({},py),this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=t||eV(i),i){if(i.units)for(let o of Object.keys(py))Array.isArray(i.units[o])&&(this.units[o]=i.units[o]);if(i.types)for(let o in i.types)this.addType_(o,i.types[o]);if(i.generic){this.generic=!0;for(let[o,r]of Object.entries(T7(this.units)))this.addType_(o,r)}if(i.atrules)for(let o in i.atrules)this.addAtrule_(o,i.atrules[o]);if(i.properties)for(let o in i.properties)this.addProperty_(o,i.properties[o])}}checkStructure(i){function e(r,a){o.push({node:r,message:a})}let t=this.structure,o=[];return this.syntax.walk(i,function(r){t.hasOwnProperty(r.type)?t[r.type].check(r,e):e(r,"Unknown node type `"+r.type+"`")}),o.length?o:!1}createDescriptor(i,e,t,o=null){let r={type:e,name:t},a={type:e,name:t,parent:o,serializable:typeof i=="string"||i&&typeof i.type=="string",syntax:null,match:null};return typeof i=="function"?a.match=by(i,r):(typeof i=="string"?Object.defineProperty(a,"syntax",{get(){return Object.defineProperty(a,"syntax",{value:tv(i)}),a.syntax}}):a.syntax=i,Object.defineProperty(a,"match",{get(){return Object.defineProperty(a,"match",{value:by(a.syntax,r)}),a.match}})),a}addAtrule_(i,e){e&&(this.atrules[i]={type:"Atrule",name:i,prelude:e.prelude?this.createDescriptor(e.prelude,"AtrulePrelude",i):null,descriptors:e.descriptors?Object.keys(e.descriptors).reduce((t,o)=>(t[o]=this.createDescriptor(e.descriptors[o],"AtruleDescriptor",o,i),t),Object.create(null)):null})}addProperty_(i,e){e&&(this.properties[i]=this.createDescriptor(e,"Property",i))}addType_(i,e){e&&(this.types[i]=this.createDescriptor(e,"Type",i))}checkAtruleName(i){if(!this.getAtrule(i))return new ff("Unknown at-rule","@"+i)}checkAtrulePrelude(i,e){let t=this.checkAtruleName(i);if(t)return t;let o=this.getAtrule(i);if(!o.prelude&&e)return new SyntaxError("At-rule `@"+i+"` should not contain a prelude");if(o.prelude&&!e&&!bf(this,o.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+i+"` should contain a prelude")}checkAtruleDescriptorName(i,e){let t=this.checkAtruleName(i);if(t)return t;let o=this.getAtrule(i),r=sy(e);if(!o.descriptors)return new SyntaxError("At-rule `@"+i+"` has no known descriptors");if(!o.descriptors[r.name]&&!o.descriptors[r.basename])return new ff("Unknown at-rule descriptor",e)}checkPropertyName(i){if(!this.getProperty(i))return new ff("Unknown property",i)}matchAtrulePrelude(i,e){let t=this.checkAtrulePrelude(i,e);if(t)return Ql(null,t);let o=this.getAtrule(i);return o.prelude?bf(this,o.prelude,e||"",!1):Ql(null,null)}matchAtruleDescriptor(i,e,t){let o=this.checkAtruleDescriptorName(i,e);if(o)return Ql(null,o);let r=this.getAtrule(i),a=sy(e);return bf(this,r.descriptors[a.name]||r.descriptors[a.basename],t,!1)}matchDeclaration(i){return i.type!=="Declaration"?Ql(null,new Error("Not a Declaration node")):this.matchProperty(i.property,i.value)}matchProperty(i,e){if(NP(i).custom)return Ql(null,new Error("Lexer matching doesn't applicable for custom properties"));let t=this.checkPropertyName(i);return t?Ql(null,t):bf(this,this.getProperty(i),e,!0)}matchType(i,e){let t=this.getType(i);return t?bf(this,t,e,!1):Ql(null,new ff("Unknown type",i))}match(i,e){return typeof i!="string"&&(!i||!i.type)?Ql(null,new ff("Bad syntax")):((typeof i=="string"||!i.match)&&(i=this.createDescriptor(i,"Type","anonymous")),bf(this,i,e,!1))}findValueFragments(i,e,t,o){return oI(this,e,this.matchProperty(i,e),t,o)}findDeclarationValueFragments(i,e,t){return oI(this,i.value,this.matchDeclaration(i),e,t)}findAllFragments(i,e,t){let o=[];return this.syntax.walk(i,{visit:"Declaration",enter:r=>{o.push.apply(o,this.findDeclarationValueFragments(r,e,t))}}),o}getAtrule(i,e=!0){let t=sy(i);return(t.vendor&&e?this.atrules[t.name]||this.atrules[t.basename]:this.atrules[t.name])||null}getAtrulePrelude(i,e=!0){let t=this.getAtrule(i,e);return t&&t.prelude||null}getAtruleDescriptor(i,e){return this.atrules.hasOwnProperty(i)&&this.atrules.declarators&&this.atrules[i].declarators[e]||null}getProperty(i,e=!0){let t=NP(i);return(t.vendor&&e?this.properties[t.name]||this.properties[t.basename]:this.properties[t.name])||null}getType(i){return hasOwnProperty.call(this.types,i)?this.types[i]:null}validate(){function i(o,r,a,c){if(a.has(r))return a.get(r);a.set(r,!1),c.syntax!==null&&KP(c.syntax,function(p){if(p.type!=="Type"&&p.type!=="Property")return;let u=p.type==="Type"?o.types:o.properties,h=p.type==="Type"?e:t;(!hasOwnProperty.call(u,p.name)||i(o,p.name,h,u[p.name]))&&a.set(r,!0)},this)}let e=new Map,t=new Map;for(let o in this.types)i(this,o,e,this.types[o]);for(let o in this.properties)i(this,o,t,this.properties[o]);return e=[...e.keys()].filter(o=>e.get(o)),t=[...t.keys()].filter(o=>t.get(o)),e.length||t.length?{types:e,properties:t}:null}dump(i,e){return{generic:this.generic,units:this.units,types:aI(this.types,!e,i),properties:aI(this.properties,!e,i),atrules:Cme(this.atrules,!e,i)}}toString(){return JSON.stringify(this.dump())}};function sI(n,i){return typeof i=="string"&&/^\s*\|/.test(i)?typeof n=="string"?n+i:i.replace(/^\s*\|\s*/,""):i||null}function tV(n,i){let e=Object.create(null);for(let[t,o]of Object.entries(n))if(o){e[t]={};for(let r of Object.keys(o))i.includes(r)&&(e[t][r]=o[r])}return e}function ov(n,i){let e=K({},n);for(let[t,o]of Object.entries(i))switch(t){case"generic":e[t]=!!o;break;case"units":e[t]=K({},n[t]);for(let[r,a]of Object.entries(o))e[t][r]=Array.isArray(a)?a:[];break;case"atrules":e[t]=K({},n[t]);for(let[r,a]of Object.entries(o)){let c=e[t][r]||{},p=e[t][r]={prelude:c.prelude||null,descriptors:K({},c.descriptors)};if(a){p.prelude=a.prelude?sI(p.prelude,a.prelude):p.prelude||null;for(let[u,h]of Object.entries(a.descriptors||{}))p.descriptors[u]=h?sI(p.descriptors[u],h):null;Object.keys(p.descriptors).length||(p.descriptors=null)}}break;case"types":case"properties":e[t]=K({},n[t]);for(let[r,a]of Object.entries(o))e[t][r]=sI(e[t][r],a);break;case"scope":e[t]=K({},n[t]);for(let[r,a]of Object.entries(o))e[t][r]=K(K({},e[t][r]),a);break;case"parseContext":e[t]=K(K({},n[t]),o);break;case"atrule":case"pseudo":e[t]=K(K({},n[t]),tV(o,["parse"]));break;case"node":e[t]=K(K({},n[t]),tV(o,["name","structure","parse","generate","walkContext"]));break}return e}function nV(n){let i=zL(n),e=_7(n),t=m7(n),{fromPlainObject:o,toPlainObject:r}=p7(e),a={lexer:null,createLexer:c=>new xf(c,a,a.lexer.structure),tokenize:Um,parse:i,generate:t,walk:e,find:e.find,findLast:e.findLast,findAll:e.findAll,fromPlainObject:o,toPlainObject:r,fork(c){let p=ov({},n);return nV(typeof c=="function"?c(p,Object.assign):ov(p,c))}};return a.lexer=new xf({generic:!0,units:n.units,types:n.types,atrules:n.atrules,properties:n.properties,node:n.node},a),a}var lI=n=>nV(ov({},n));var iV={generic:!0,units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|vertical|horizontal","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<hex-color>|<named-color>|currentcolor|<deprecated-system-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>* [<pseudo-element-selector> <pseudo-class-selector>*]*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<compound-selector> [<combinator>? <compound-selector>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value> )]|( <ident> <any-value> )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","name-repeat":"repeat( [<integer [1,\u221E]>|auto-fill] , <line-names>+ )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( [<length [0,\u221E]>|none] )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pow()":"pow( <calc-sum> , <calc-sum> )","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )",ratio:"<number [0,\u221E]> [/ <number [0,\u221E]>]?","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( <number-percentage> )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )",scroller:"root|nearest","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","sign()":"sign( <calc-sum> )","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( <calc-sum> )","single-animation":"<time>||<easing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<timeline-name>|scroll( <axis>? <scroller>? )","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-name":"<custom-ident>|<string>","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-width":"fill-available|min-intrinsic|intrinsic|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content|-webkit-min-content|-webkit-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-webkit-mask-clip-style":"border|border-box|padding|padding-box|content|content-box|text","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","-ms-filter":"<string>",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral",left:"<length>|auto","mask-image":"<mask-reference>#",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke",right:"<length>|auto","scroll-timeline-axis":"block|inline|vertical|horizontal","scroll-timeline-name":"none|<custom-ident>","single-animation-composition":"replace|add|accumulate","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,\u221E]>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto|<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-overflow":"clip|ellipsis|<string>","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end",caret:"<'caret-color'>||<'caret-shape'>","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none",color:"<color>","print-color-adjust":"economy|exact","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance|balance-all","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-size":"[none|<length>|auto <length>]{1,2}","contain-intrinsic-block-size":"none|<length>|auto <length>","contain-intrinsic-height":"none|<length>|auto <length>","contain-intrinsic-inline-size":"none|<length>|auto <length>","contain-intrinsic-width":"none|<length>|auto <length>",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","empty-cells":"show|hide",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css21>||<'font-weight'>||<'font-stretch'>]? <'font-size'> [/ <'line-height'>]? <'font-family'>]|caption|icon|menu|message-box|small-caption|status-bar","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps]","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter","forced-color-adjust":"auto|none",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","hyphenate-character":"auto|<string>",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|ray( [<angle>&&<size>&&contain?] )|<path()>|<url>|[<basic-shape>||<geometry-box>]","offset-position":"auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-color'>||<'outline-style'>||<'outline-width'>]","outline-color":"<color>|invert","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,\u221E]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky",quotes:"none|auto|[<string> <string>]+",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",scale:"none|<number>{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-timeline":"<scroll-timeline-name>||<scroll-timeline-axis>","scroll-timeline-axis":"block|inline|vertical|horizontal","scroll-timeline-name":"none|<custom-ident>","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"[over|under]&&[right|left]","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|fill|stretch|intrinsic|-moz-max-content|-webkit-max-content|-moz-fit-content|-webkit-fit-content","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+","clip-rule":"nonzero|evenodd",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|none|normal","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<number-zero-one>","stroke-width":"<svg-length>","text-anchor":"start|middle|end","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<string>"}},"scroll-timeline":{prelude:"<timeline-name>",descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},viewport:{prelude:null,descriptors:{height:"<viewport-length>{1,2}","max-height":"<viewport-length>","max-width":"<viewport-length>","max-zoom":"auto|<number>|<percentage>","min-height":"<viewport-length>","min-width":"<viewport-length>","min-zoom":"auto|<number>|<percentage>",orientation:"auto|portrait|landscape","user-zoom":"zoom|fixed","viewport-fit":"auto|contain|cover",width:"<viewport-length>{1,2}",zoom:"auto|<number>|<percentage>"}},nest:{prelude:"<complex-selector-list>",descriptors:null}}};var av={};Ln(av,{AnPlusB:()=>mI,Atrule:()=>uI,AtrulePrelude:()=>fI,AttributeSelector:()=>vI,Block:()=>bI,Brackets:()=>yI,CDC:()=>wI,CDO:()=>kI,ClassSelector:()=>EI,Combinator:()=>PI,Comment:()=>AI,Declaration:()=>NI,DeclarationList:()=>LI,Dimension:()=>BI,Function:()=>jI,Hash:()=>HI,IdSelector:()=>qI,Identifier:()=>GI,MediaFeature:()=>XI,MediaQuery:()=>YI,MediaQueryList:()=>JI,NestingSelector:()=>t3,Nth:()=>i3,Number:()=>r3,Operator:()=>s3,Parentheses:()=>c3,Percentage:()=>m3,PseudoClassSelector:()=>u3,PseudoElementSelector:()=>f3,Ratio:()=>_3,Raw:()=>C3,Rule:()=>x3,Selector:()=>S3,SelectorList:()=>M3,String:()=>E3,StyleSheet:()=>P3,TypeSelector:()=>O3,UnicodeRange:()=>R3,Url:()=>B3,Value:()=>j3,WhiteSpace:()=>H3});var mI={};Ln(mI,{generate:()=>wme,name:()=>yme,parse:()=>dI,structure:()=>Sme});var Wc=43,Fs=45,xy=110,_u=!0,xme=!1;function yy(n,i){let e=this.tokenStart+n,t=this.charCodeAt(e);for((t===Wc||t===Fs)&&(i&&this.error("Number sign is not allowed"),e++);e<this.tokenEnd;e++)Yo(this.charCodeAt(e))||this.error("Integer is expected",e)}function yf(n){return yy.call(this,0,n)}function Wm(n,i){if(!this.cmpChar(this.tokenStart+n,i)){let e="";switch(i){case xy:e="N is expected";break;case Fs:e="HyphenMinus is expected";break}this.error(e,this.tokenStart+n)}}function cI(){let n=0,i=0,e=this.tokenType;for(;e===13||e===25;)e=this.lookupType(++n);if(e!==10)if(this.isDelim(Wc,n)||this.isDelim(Fs,n)){i=this.isDelim(Wc,n)?Wc:Fs;do e=this.lookupType(++n);while(e===13||e===25);e!==10&&(this.skip(n),yf.call(this,_u))}else return null;return n>0&&this.skip(n),i===0&&(e=this.charCodeAt(this.tokenStart),e!==Wc&&e!==Fs&&this.error("Number sign is expected")),yf.call(this,i!==0),i===Fs?"-"+this.consume(10):this.consume(10)}var yme="AnPlusB",Sme={a:[String,null],b:[String,null]};function dI(){let n=this.tokenStart,i=null,e=null;if(this.tokenType===10)yf.call(this,xme),e=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Fs))switch(i="-1",Wm.call(this,1,xy),this.tokenEnd-this.tokenStart){case 2:this.next(),e=cI.call(this);break;case 3:Wm.call(this,2,Fs),this.next(),this.skipSC(),yf.call(this,_u),e="-"+this.consume(10);break;default:Wm.call(this,2,Fs),yy.call(this,3,_u),this.next(),e=this.substrToCursor(n+2)}else if(this.tokenType===1||this.isDelim(Wc)&&this.lookupType(1)===1){let t=0;switch(i="1",this.isDelim(Wc)&&(t=1,this.next()),Wm.call(this,0,xy),this.tokenEnd-this.tokenStart){case 1:this.next(),e=cI.call(this);break;case 2:Wm.call(this,1,Fs),this.next(),this.skipSC(),yf.call(this,_u),e="-"+this.consume(10);break;default:Wm.call(this,1,Fs),yy.call(this,2,_u),this.next(),e=this.substrToCursor(n+t+1)}}else if(this.tokenType===12){let t=this.charCodeAt(this.tokenStart),o=t===Wc||t===Fs,r=this.tokenStart+o;for(;r<this.tokenEnd&&Yo(this.charCodeAt(r));r++);r===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Wm.call(this,r-this.tokenStart,xy),i=this.substring(n,r),r+1===this.tokenEnd?(this.next(),e=cI.call(this)):(Wm.call(this,r-this.tokenStart+1,Fs),r+2===this.tokenEnd?(this.next(),this.skipSC(),yf.call(this,_u),e="-"+this.consume(10)):(yy.call(this,r-this.tokenStart+2,_u),this.next(),e=this.substrToCursor(r+1)))}else this.error();return i!==null&&i.charCodeAt(0)===Wc&&(i=i.substr(1)),e!==null&&e.charCodeAt(0)===Wc&&(e=e.substr(1)),{type:"AnPlusB",loc:this.getLocation(n,this.tokenStart),a:i,b:e}}function wme(n){if(n.a){let i=n.a==="+1"&&"n"||n.a==="1"&&"n"||n.a==="-1"&&"-n"||n.a+"n";if(n.b){let e=n.b[0]==="-"||n.b[0]==="+"?n.b:"+"+n.b;this.tokenize(i+e)}else this.tokenize(i)}else this.tokenize(n.b)}var uI={};Ln(uI,{generate:()=>Dme,name:()=>kme,parse:()=>pI,structure:()=>Eme,walkContext:()=>Tme});function oV(n){return this.Raw(n,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function Mme(){for(let n=1,i;i=this.lookupType(n);n++){if(i===24)return!0;if(i===23||i===3)return!1}return!1}var kme="Atrule",Tme="atrule",Eme={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function pI(n=!1){let i=this.tokenStart,e,t,o=null,r=null;switch(this.eat(3),e=this.substrToCursor(i+1),t=e.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?o=this.parseWithFallback(this.AtrulePrelude.bind(this,e,n),oV):o=oV.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,t)&&typeof this.atrule[t].block=="function"?r=this.atrule[t].block.call(this,n):r=this.Block(Mme.call(this));break}return{type:"Atrule",loc:this.getLocation(i,this.tokenStart),name:e,prelude:o,block:r}}function Dme(n){this.token(3,"@"+n.name),n.prelude!==null&&this.node(n.prelude),n.block?this.node(n.block):this.token(17,";")}var fI={};Ln(fI,{generate:()=>Ome,name:()=>Pme,parse:()=>hI,structure:()=>Ame,walkContext:()=>Ime});var Pme="AtrulePrelude",Ime="atrulePrelude",Ame={children:[[]]};function hI(n){let i=null;return n!==null&&(n=n.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].prelude=="function"?i=this.atrule[n].prelude.call(this):i=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(i),children:i}}function Ome(n){this.children(n)}var vI={};Ln(vI,{generate:()=>jme,name:()=>Bme,parse:()=>_I,structure:()=>zme});var Nme=36,rV=42,Sy=61,Fme=94,gI=124,Rme=126;function Lme(){this.eof&&this.error("Unexpected end of input");let n=this.tokenStart,i=!1;return this.isDelim(rV)?(i=!0,this.next()):this.isDelim(gI)||this.eat(1),this.isDelim(gI)?this.charCodeAt(this.tokenStart+1)!==Sy?(this.next(),this.eat(1)):i&&this.error("Identifier is expected",this.tokenEnd):i&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(n,this.tokenStart),name:this.substrToCursor(n)}}function Vme(){let n=this.tokenStart,i=this.charCodeAt(n);return i!==Sy&&i!==Rme&&i!==Fme&&i!==Nme&&i!==rV&&i!==gI&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),i!==Sy&&(this.isDelim(Sy)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(n)}var Bme="AttributeSelector",zme={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function _I(){let n=this.tokenStart,i,e=null,t=null,o=null;return this.eat(19),this.skipSC(),i=Lme.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(e=Vme.call(this),this.skipSC(),t=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(n,this.tokenStart),name:i,matcher:e,value:t,flags:o}}function jme(n){this.token(9,"["),this.node(n.name),n.matcher!==null&&(this.tokenize(n.matcher),this.node(n.value)),n.flags!==null&&this.token(1,n.flags),this.token(9,"]")}var bI={};Ln(bI,{generate:()=>qme,name:()=>Ume,parse:()=>CI,structure:()=>Wme,walkContext:()=>Gme});var $me=38;function lV(n){return this.Raw(n,null,!0)}function aV(){return this.parseWithFallback(this.Rule,lV)}function sV(n){return this.Raw(n,this.consumeUntilSemicolonIncluded,!0)}function Hme(){if(this.tokenType===17)return sV.call(this,this.tokenIndex);let n=this.parseWithFallback(this.Declaration,sV);return this.tokenType===17&&this.next(),n}var Ume="Block",Gme="block",Wme={children:[["Atrule","Rule","Declaration"]]};function CI(n){let i=n?Hme:aV,e=this.tokenStart,t=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:t.push(this.parseWithFallback(this.Atrule.bind(this,n),lV));break;default:n&&this.isDelim($me)?t.push(aV.call(this)):t.push(i.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(e,this.tokenStart),children:t}}function qme(n){this.token(23,"{"),this.children(n,i=>{i.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var yI={};Ln(yI,{generate:()=>Kme,name:()=>Qme,parse:()=>xI,structure:()=>Xme});var Qme="Brackets",Xme={children:[[]]};function xI(n,i){let e=this.tokenStart,t=null;return this.eat(19),t=n.call(this,i),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(e,this.tokenStart),children:t}}function Kme(n){this.token(9,"["),this.children(n),this.token(9,"]")}var wI={};Ln(wI,{generate:()=>Jme,name:()=>Yme,parse:()=>SI,structure:()=>Zme});var Yme="CDC",Zme=[];function SI(){let n=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(n,this.tokenStart)}}function Jme(){this.token(15,"-->")}var kI={};Ln(kI,{generate:()=>npe,name:()=>epe,parse:()=>MI,structure:()=>tpe});var epe="CDO",tpe=[];function MI(){let n=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(n,this.tokenStart)}}function npe(){this.token(14,"<!--")}var EI={};Ln(EI,{generate:()=>ape,name:()=>ope,parse:()=>TI,structure:()=>rpe});var ipe=46,ope="ClassSelector",rpe={name:String};function TI(){return this.eatDelim(ipe),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function ape(n){this.token(9,"."),this.token(1,n.name)}var PI={};Ln(PI,{generate:()=>ppe,name:()=>dpe,parse:()=>DI,structure:()=>mpe});var spe=43,cV=47,lpe=62,cpe=126,dpe="Combinator",mpe={name:String};function DI(){let n=this.tokenStart,i;switch(this.tokenType){case 13:i=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case lpe:case spe:case cpe:this.next();break;case cV:this.next(),this.eatIdent("deep"),this.eatDelim(cV);break;default:this.error("Combinator is expected")}i=this.substrToCursor(n);break}return{type:"Combinator",loc:this.getLocation(n,this.tokenStart),name:i}}function ppe(n){this.tokenize(n.name)}var AI={};Ln(AI,{generate:()=>_pe,name:()=>fpe,parse:()=>II,structure:()=>gpe});var upe=42,hpe=47,fpe="Comment",gpe={value:String};function II(){let n=this.tokenStart,i=this.tokenEnd;return this.eat(25),i-n+2>=2&&this.charCodeAt(i-2)===upe&&this.charCodeAt(i-1)===hpe&&(i-=2),{type:"Comment",loc:this.getLocation(n,this.tokenStart),value:this.substring(n+2,i)}}function _pe(n){this.token(25,"/*"+n.value+"*/")}var NI={};Ln(NI,{generate:()=>Dpe,name:()=>kpe,parse:()=>OI,structure:()=>Epe,walkContext:()=>Tpe});var mV=33,vpe=35,Cpe=36,bpe=38,xpe=42,ype=43,dV=47;function Spe(n){return this.Raw(n,this.consumeUntilExclamationMarkOrSemicolon,!0)}function wpe(n){return this.Raw(n,this.consumeUntilExclamationMarkOrSemicolon,!1)}function Mpe(){let n=this.tokenIndex,i=this.Value();return i.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(mV)===!1&&this.isBalanceEdge(n)===!1&&this.error(),i}var kpe="Declaration",Tpe="declaration",Epe={important:[Boolean,String],property:String,value:["Value","Raw"]};function OI(){let n=this.tokenStart,i=this.tokenIndex,e=Ppe.call(this),t=ly(e),o=t?this.parseCustomProperty:this.parseValue,r=t?wpe:Spe,a=!1,c;this.skipSC(),this.eat(16);let p=this.tokenIndex;if(t||this.skipSC(),o?c=this.parseWithFallback(Mpe,r):c=r.call(this,this.tokenIndex),t&&c.type==="Value"&&c.children.isEmpty){for(let u=p-this.tokenIndex;u<=0;u++)if(this.lookupType(u)===13){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(mV)&&(a=Ipe.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(i)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(n,this.tokenStart),important:a,property:e,value:c}}function Dpe(n){this.token(1,n.property),this.token(16,":"),this.node(n.value),n.important&&(this.token(9,"!"),this.token(1,n.important===!0?"important":n.important))}function Ppe(){let n=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case xpe:case Cpe:case ype:case vpe:case bpe:this.next();break;case dV:this.next(),this.isDelim(dV)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(n)}function Ipe(){this.eat(9),this.skipSC();let n=this.consume(1);return n==="important"?!0:n}var LI={};Ln(LI,{generate:()=>Fpe,name:()=>Ope,parse:()=>RI,structure:()=>Npe});var Ape=38;function FI(n){return this.Raw(n,this.consumeUntilSemicolonIncluded,!0)}var Ope="DeclarationList",Npe={children:[["Declaration","Atrule","Rule"]]};function RI(){let n=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:n.push(this.parseWithFallback(this.Atrule.bind(this,!0),FI));break;default:this.isDelim(Ape)?n.push(this.parseWithFallback(this.Rule,FI)):n.push(this.parseWithFallback(this.Declaration,FI))}return{type:"DeclarationList",loc:this.getLocationFromList(n),children:n}}function Fpe(n){this.children(n,i=>{i.type==="Declaration"&&this.token(17,";")})}var BI={};Ln(BI,{generate:()=>Vpe,name:()=>Rpe,parse:()=>VI,structure:()=>Lpe});var Rpe="Dimension",Lpe={value:String,unit:String};function VI(){let n=this.tokenStart,i=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(n,this.tokenStart),value:i,unit:this.substring(n+i.length,this.tokenStart)}}function Vpe(n){this.token(12,n.value+n.unit)}var jI={};Ln(jI,{generate:()=>$pe,name:()=>Bpe,parse:()=>zI,structure:()=>jpe,walkContext:()=>zpe});var Bpe="Function",zpe="function",jpe={name:String,children:[[]]};function zI(n,i){let e=this.tokenStart,t=this.consumeFunctionName(),o=t.toLowerCase(),r;return r=i.hasOwnProperty(o)?i[o].call(this,i):n.call(this,i),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function $pe(n){this.token(2,n.name+"("),this.children(n),this.token(22,")")}var HI={};Ln(HI,{generate:()=>Wpe,name:()=>Upe,parse:()=>$I,structure:()=>Gpe,xxx:()=>Hpe});var Hpe="XXX",Upe="Hash",Gpe={value:String};function $I(){let n=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(n,this.tokenStart),value:this.substrToCursor(n+1)}}function Wpe(n){this.token(4,"#"+n.value)}var GI={};Ln(GI,{generate:()=>Xpe,name:()=>qpe,parse:()=>UI,structure:()=>Qpe});var qpe="Identifier",Qpe={name:String};function UI(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function Xpe(n){this.token(1,n.name)}var qI={};Ln(qI,{generate:()=>Zpe,name:()=>Kpe,parse:()=>WI,structure:()=>Ype});var Kpe="IdSelector",Ype={name:String};function WI(){let n=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(n,this.tokenStart),name:this.substrToCursor(n+1)}}function Zpe(n){this.token(9,"#"+n.name)}var XI={};Ln(XI,{generate:()=>tue,name:()=>Jpe,parse:()=>QI,structure:()=>eue});var Jpe="MediaFeature",eue={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function QI(){let n=this.tokenStart,i,e=null;if(this.eat(21),this.skipSC(),i=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?e=this.Ratio():e=this.Number();break;case 12:e=this.Dimension();break;case 1:e=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eat(22),{type:"MediaFeature",loc:this.getLocation(n,this.tokenStart),name:i,value:e}}function tue(n){this.token(21,"("),this.token(1,n.name),n.value!==null&&(this.token(16,":"),this.node(n.value)),this.token(22,")")}var YI={};Ln(YI,{generate:()=>oue,name:()=>nue,parse:()=>KI,structure:()=>iue});var nue="MediaQuery",iue={children:[["Identifier","MediaFeature","WhiteSpace"]]};function KI(){let n=this.createList(),i=null;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 1:i=this.Identifier();break;case 21:i=this.MediaFeature();break;default:break e}n.push(i)}return i===null&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(n),children:n}}function oue(n){this.children(n)}var JI={};Ln(JI,{generate:()=>sue,name:()=>rue,parse:()=>ZI,structure:()=>aue});var rue="MediaQueryList",aue={children:[["MediaQuery"]]};function ZI(){let n=this.createList();for(this.skipSC();!this.eof&&(n.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(n),children:n}}function sue(n){this.children(n,()=>this.token(18,","))}var t3={};Ln(t3,{generate:()=>mue,name:()=>cue,parse:()=>e3,structure:()=>due});var lue=38,cue="NestingSelector",due={};function e3(){let n=this.tokenStart;return this.eatDelim(lue),{type:"NestingSelector",loc:this.getLocation(n,this.tokenStart)}}function mue(){this.token(9,"&")}var i3={};Ln(i3,{generate:()=>hue,name:()=>pue,parse:()=>n3,structure:()=>uue});var pue="Nth",uue={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function n3(){this.skipSC();let n=this.tokenStart,i=n,e=null,t;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?t=this.Identifier():t=this.AnPlusB(),i=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),e=this.SelectorList(),i=this.tokenStart),{type:"Nth",loc:this.getLocation(n,i),nth:t,selector:e}}function hue(n){this.node(n.nth),n.selector!==null&&(this.token(1,"of"),this.node(n.selector))}var r3={};Ln(r3,{generate:()=>_ue,name:()=>fue,parse:()=>o3,structure:()=>gue});var fue="Number",gue={value:String};function o3(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function _ue(n){this.token(10,n.value)}var s3={};Ln(s3,{generate:()=>bue,name:()=>vue,parse:()=>a3,structure:()=>Cue});var vue="Operator",Cue={value:String};function a3(){let n=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(n,this.tokenStart),value:this.substrToCursor(n)}}function bue(n){this.tokenize(n.value)}var c3={};Ln(c3,{generate:()=>Sue,name:()=>xue,parse:()=>l3,structure:()=>yue});var xue="Parentheses",yue={children:[[]]};function l3(n,i){let e=this.tokenStart,t=null;return this.eat(21),t=n.call(this,i),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(e,this.tokenStart),children:t}}function Sue(n){this.token(21,"("),this.children(n),this.token(22,")")}var m3={};Ln(m3,{generate:()=>kue,name:()=>wue,parse:()=>d3,structure:()=>Mue});var wue="Percentage",Mue={value:String};function d3(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function kue(n){this.token(11,n.value+"%")}var u3={};Ln(u3,{generate:()=>Pue,name:()=>Tue,parse:()=>p3,structure:()=>Due,walkContext:()=>Eue});var Tue="PseudoClassSelector",Eue="function",Due={name:String,children:[["Raw"],null]};function p3(){let n=this.tokenStart,i=null,e,t;return this.eat(16),this.tokenType===2?(e=this.consumeFunctionName(),t=e.toLowerCase(),hasOwnProperty.call(this.pseudo,t)?(this.skipSC(),i=this.pseudo[t].call(this),this.skipSC()):(i=this.createList(),i.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):e=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(n,this.tokenStart),name:e,children:i}}function Pue(n){this.token(16,":"),n.children===null?this.token(1,n.name):(this.token(2,n.name+"("),this.children(n),this.token(22,")"))}var f3={};Ln(f3,{generate:()=>Nue,name:()=>Iue,parse:()=>h3,structure:()=>Oue,walkContext:()=>Aue});var Iue="PseudoElementSelector",Aue="function",Oue={name:String,children:[["Raw"],null]};function h3(){let n=this.tokenStart,i=null,e,t;return this.eat(16),this.eat(16),this.tokenType===2?(e=this.consumeFunctionName(),t=e.toLowerCase(),hasOwnProperty.call(this.pseudo,t)?(this.skipSC(),i=this.pseudo[t].call(this),this.skipSC()):(i=this.createList(),i.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):e=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(n,this.tokenStart),name:e,children:i}}function Nue(n){this.token(16,":"),this.token(16,":"),n.children===null?this.token(1,n.name):(this.token(2,n.name+"("),this.children(n),this.token(22,")"))}var _3={};Ln(_3,{generate:()=>Bue,name:()=>Lue,parse:()=>g3,structure:()=>Vue});var Fue=47,Rue=46;function pV(){this.skipSC();let n=this.consume(10);for(let i=0;i<n.length;i++){let e=n.charCodeAt(i);!Yo(e)&&e!==Rue&&this.error("Unsigned number is expected",this.tokenStart-n.length+i)}return Number(n)===0&&this.error("Zero number is not allowed",this.tokenStart-n.length),n}var Lue="Ratio",Vue={left:String,right:String};function g3(){let n=this.tokenStart,i=pV.call(this),e;return this.skipSC(),this.eatDelim(Fue),e=pV.call(this),{type:"Ratio",loc:this.getLocation(n,this.tokenStart),left:i,right:e}}function Bue(n){this.token(10,n.left),this.token(9,"/"),this.token(10,n.right)}var C3={};Ln(C3,{generate:()=>Hue,name:()=>jue,parse:()=>v3,structure:()=>$ue});function zue(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var jue="Raw",$ue={value:String};function v3(n,i,e){let t=this.getTokenStart(n),o;return this.skipUntilBalanced(n,i||this.consumeUntilBalanceEnd),e&&this.tokenStart>t?o=zue.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(t,o),value:this.substring(t,o)}}function Hue(n){this.tokenize(n.value)}var x3={};Ln(x3,{generate:()=>Que,name:()=>Gue,parse:()=>b3,structure:()=>que,walkContext:()=>Wue});function uV(n){return this.Raw(n,this.consumeUntilLeftCurlyBracket,!0)}function Uue(){let n=this.SelectorList();return n.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),n}var Gue="Rule",Wue="rule",que={prelude:["SelectorList","Raw"],block:["Block"]};function b3(){let n=this.tokenIndex,i=this.tokenStart,e,t;return this.parseRulePrelude?e=this.parseWithFallback(Uue,uV):e=uV.call(this,n),t=this.Block(!0),{type:"Rule",loc:this.getLocation(i,this.tokenStart),prelude:e,block:t}}function Que(n){this.node(n.prelude),this.node(n.block)}var S3={};Ln(S3,{generate:()=>Yue,name:()=>Xue,parse:()=>y3,structure:()=>Kue});var Xue="Selector",Kue={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function y3(){let n=this.readSequence(this.scope.Selector);return this.getFirstListNode(n)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(n),children:n}}function Yue(n){this.children(n)}var M3={};Ln(M3,{generate:()=>the,name:()=>Zue,parse:()=>w3,structure:()=>ehe,walkContext:()=>Jue});var Zue="SelectorList",Jue="selector",ehe={children:[["Selector","Raw"]]};function w3(){let n=this.createList();for(;!this.eof;){if(n.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(n),children:n}}function the(n){this.children(n,()=>this.token(18,","))}var E3={};Ln(E3,{generate:()=>ohe,name:()=>nhe,parse:()=>T3,structure:()=>ihe});var k3=92,hV=34,fV=39;function wy(n){let i=n.length,e=n.charCodeAt(0),t=e===hV||e===fV?1:0,o=t===1&&i>1&&n.charCodeAt(i-1)===e?i-2:i-1,r="";for(let a=t;a<=o;a++){let c=n.charCodeAt(a);if(c===k3){if(a===o){a!==i-1&&(r=n.substr(a+1));break}if(c=n.charCodeAt(++a),Ha(k3,c)){let p=a-1,u=Uc(n,p);a=u-1,r+=U0(n.substring(p+1,u))}else c===13&&n.charCodeAt(a+1)===10&&a++}else r+=n[a]}return r}function gV(n,i){let e=i?"'":'"',t=i?fV:hV,o="",r=!1;for(let a=0;a<n.length;a++){let c=n.charCodeAt(a);if(c===0){o+="\uFFFD";continue}if(c<=31||c===127){o+="\\"+c.toString(16),r=!0;continue}c===t||c===k3?(o+="\\"+n.charAt(a),r=!1):(r&&(hs(c)||Hc(c))&&(o+=" "),o+=n.charAt(a),r=!1)}return e+o+e}var nhe="String",ihe={value:String};function T3(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:wy(this.consume(5))}}function ohe(n){this.token(5,gV(n.value))}var P3={};Ln(P3,{generate:()=>che,name:()=>ahe,parse:()=>D3,structure:()=>lhe,walkContext:()=>she});var rhe=33;function vV(n){return this.Raw(n,null,!1)}var ahe="StyleSheet",she="stylesheet",lhe={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function D3(){let n=this.tokenStart,i=this.createList(),e;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==rhe){this.next();continue}e=this.Comment();break;case 14:e=this.CDO();break;case 15:e=this.CDC();break;case 3:e=this.parseWithFallback(this.Atrule,vV);break;default:e=this.parseWithFallback(this.Rule,vV)}i.push(e)}return{type:"StyleSheet",loc:this.getLocation(n,this.tokenStart),children:i}}function che(n){this.children(n)}var O3={};Ln(O3,{generate:()=>uhe,name:()=>mhe,parse:()=>A3,structure:()=>phe});var dhe=42,CV=124;function I3(){this.tokenType!==1&&this.isDelim(dhe)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var mhe="TypeSelector",phe={name:String};function A3(){let n=this.tokenStart;return this.isDelim(CV)?(this.next(),I3.call(this)):(I3.call(this),this.isDelim(CV)&&(this.next(),I3.call(this))),{type:"TypeSelector",loc:this.getLocation(n,this.tokenStart),name:this.substrToCursor(n)}}function uhe(n){this.tokenize(n.name)}var R3={};Ln(R3,{generate:()=>vhe,name:()=>ghe,parse:()=>F3,structure:()=>_he});var bV=43,xV=45,N3=63;function rv(n,i){let e=0;for(let t=this.tokenStart+n;t<this.tokenEnd;t++){let o=this.charCodeAt(t);if(o===xV&&i&&e!==0)return rv.call(this,n+e+1,!1),-1;hs(o)||this.error(i&&e!==0?"Hyphen minus"+(e<6?" or hex digit":"")+" is expected":e<6?"Hex digit is expected":"Unexpected input",t),++e>6&&this.error("Too many hex digits",t)}return this.next(),e}function My(n){let i=0;for(;this.isDelim(N3);)++i>n&&this.error("Too many question marks"),this.next()}function hhe(n){this.charCodeAt(this.tokenStart)!==n&&this.error((n===bV?"Plus sign":"Hyphen minus")+" is expected")}function fhe(){let n=0;switch(this.tokenType){case 10:if(n=rv.call(this,1,!0),this.isDelim(N3)){My.call(this,6-n);break}if(this.tokenType===12||this.tokenType===10){hhe.call(this,xV),rv.call(this,1,!1);break}break;case 12:n=rv.call(this,1,!0),n>0&&My.call(this,6-n);break;default:if(this.eatDelim(bV),this.tokenType===1){n=rv.call(this,0,!0),n>0&&My.call(this,6-n);break}if(this.isDelim(N3)){this.next(),My.call(this,5);break}this.error("Hex digit or question mark is expected")}}var ghe="UnicodeRange",_he={value:String};function F3(){let n=this.tokenStart;return this.eatIdent("u"),fhe.call(this),{type:"UnicodeRange",loc:this.getLocation(n,this.tokenStart),value:this.substrToCursor(n)}}function vhe(n){this.tokenize(n.value)}var B3={};Ln(B3,{generate:()=>Mhe,name:()=>She,parse:()=>V3,structure:()=>whe});var Che=32,L3=92,bhe=34,xhe=39,yhe=40,yV=41;function SV(n){let i=n.length,e=4,t=n.charCodeAt(i-1)===yV?i-2:i-1,o="";for(;e<t&&Hc(n.charCodeAt(e));)e++;for(;e<t&&Hc(n.charCodeAt(t));)t--;for(let r=e;r<=t;r++){let a=n.charCodeAt(r);if(a===L3){if(r===t){r!==i-1&&(o=n.substr(r+1));break}if(a=n.charCodeAt(++r),Ha(L3,a)){let c=r-1,p=Uc(n,c);r=p-1,o+=U0(n.substring(c+1,p))}else a===13&&n.charCodeAt(r+1)===10&&r++}else o+=n[r]}return o}function wV(n){let i="",e=!1;for(let t=0;t<n.length;t++){let o=n.charCodeAt(t);if(o===0){i+="\uFFFD";continue}if(o<=31||o===127){i+="\\"+o.toString(16),e=!0;continue}o===Che||o===L3||o===bhe||o===xhe||o===yhe||o===yV?(i+="\\"+n.charAt(t),e=!1):(e&&hs(o)&&(i+=" "),i+=n.charAt(t),e=!1)}return"url("+i+")"}var She="Url",whe={value:String};function V3(){let n=this.tokenStart,i;switch(this.tokenType){case 7:i=SV(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),i=wy(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(n,this.tokenStart),value:i}}function Mhe(n){this.token(7,wV(n.value))}var j3={};Ln(j3,{generate:()=>Ehe,name:()=>khe,parse:()=>z3,structure:()=>The});var khe="Value",The={children:[[]]};function z3(){let n=this.tokenStart,i=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(n,this.tokenStart),children:i}}function Ehe(n){this.children(n)}var H3={};Ln(H3,{generate:()=>Ahe,name:()=>Phe,parse:()=>$3,structure:()=>Ihe});var Dhe=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Phe="WhiteSpace",Ihe={value:String};function $3(){return this.eat(13),Dhe}function Ahe(n){this.token(13,n.value)}var kV=it(K({generic:!0},iV),{node:av});var U3={};Ln(U3,{AtrulePrelude:()=>EV,Selector:()=>PV,Value:()=>NV});var Ohe=35,Nhe=42,TV=43,Fhe=45,Rhe=47,Lhe=117;function sv(n){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,n.recognizer);case 19:return this.Brackets(this.readSequence,n.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,n.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,Lhe)&&this.cmpChar(this.tokenStart+1,TV)?this.UnicodeRange():this.Identifier();case 9:{let i=this.charCodeAt(this.tokenStart);if(i===Rhe||i===Nhe||i===TV||i===Fhe)return this.Operator();i===Ohe&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var EV={getNode:sv};var Vhe=35,Bhe=38,zhe=42,jhe=43,$he=47,DV=46,Hhe=62,Uhe=124,Ghe=126;function Whe(n,i){i.last!==null&&i.last.type!=="Combinator"&&n!==null&&n.type!=="Combinator"&&i.push({type:"Combinator",loc:null,name:" "})}function qhe(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===DV&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case jhe:case Hhe:case Ghe:case $he:return this.Combinator();case DV:return this.ClassSelector();case zhe:case Uhe:return this.TypeSelector();case Vhe:return this.IdSelector();case Bhe:return this.NestingSelector()}break}}}var PV={onWhiteSpace:Whe,getNode:qhe};function IV(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function AV(){let n=this.createList();if(this.skipSC(),n.push(this.Identifier()),this.skipSC(),this.tokenType===18){n.push(this.Operator());let i=this.tokenIndex,e=this.parseCustomProperty?this.Value(null):this.Raw(this.tokenIndex,this.consumeUntilExclamationMarkOrSemicolon,!1);if(e.type==="Value"&&e.children.isEmpty){for(let t=i-this.tokenIndex;t<=0;t++)if(this.lookupType(t)===13){e.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}n.push(e)}return n}function OV(n){return n!==null&&n.type==="Operator"&&(n.value[n.value.length-1]==="-"||n.value[n.value.length-1]==="+")}var NV={getNode:sv,onWhiteSpace(n,i){OV(n)&&(n.value=" "+n.value),OV(i.last)&&(i.last.value+=" ")},expression:IV,var:AV};var FV={parse:{prelude:null,block(){return this.Block(!0)}}};var RV={parse:{prelude(){let n=this.createList();switch(this.skipSC(),this.tokenType){case 5:n.push(this.String());break;case 7:case 2:n.push(this.Url());break;default:this.error("String or url() is expected")}return(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&n.push(this.MediaQueryList()),n},block:null}};var LV={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(n=!1){return this.Block(n)}}};var VV={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var BV={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function Qhe(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function Xhe(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):zV.call(this)}function zV(){let n=this.createList(),i;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 2:i=this.Function(Qhe,this.scope.AtrulePrelude);break;case 1:i=this.Identifier();break;case 21:i=this.Parentheses(Xhe,this.scope.AtrulePrelude);break;default:break e}n.push(i)}return n}var jV={parse:{prelude(){let n=zV.call(this);return this.getFirstListNode(n)===null&&this.error("Condition is expected"),n},block(n=!1){return this.Block(n)}}};var $V={"font-face":FV,import:RV,media:LV,nest:VV,page:BV,supports:jV};var vu={parse(){return this.createSingleNodeList(this.SelectorList())}},G3={parse(){return this.createSingleNodeList(this.Selector())}},HV={parse(){return this.createSingleNodeList(this.Identifier())}},ky={parse(){return this.createSingleNodeList(this.Nth())}},UV={dir:HV,has:vu,lang:HV,matches:vu,is:vu,"-moz-any":vu,"-webkit-any":vu,where:vu,not:vu,"nth-child":ky,"nth-last-child":ky,"nth-last-of-type":ky,"nth-of-type":ky,slotted:G3,host:G3,"host-context":G3};var W3={};Ln(W3,{AnPlusB:()=>dI,Atrule:()=>pI,AtrulePrelude:()=>hI,AttributeSelector:()=>_I,Block:()=>CI,Brackets:()=>xI,CDC:()=>SI,CDO:()=>MI,ClassSelector:()=>TI,Combinator:()=>DI,Comment:()=>II,Declaration:()=>OI,DeclarationList:()=>RI,Dimension:()=>VI,Function:()=>zI,Hash:()=>$I,IdSelector:()=>WI,Identifier:()=>UI,MediaFeature:()=>QI,MediaQuery:()=>KI,MediaQueryList:()=>ZI,NestingSelector:()=>e3,Nth:()=>n3,Number:()=>o3,Operator:()=>a3,Parentheses:()=>l3,Percentage:()=>d3,PseudoClassSelector:()=>p3,PseudoElementSelector:()=>h3,Ratio:()=>g3,Raw:()=>v3,Rule:()=>b3,Selector:()=>y3,SelectorList:()=>w3,String:()=>T3,StyleSheet:()=>D3,TypeSelector:()=>A3,UnicodeRange:()=>F3,Url:()=>V3,Value:()=>z3,WhiteSpace:()=>$3});var GV={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(n){return this.AtrulePrelude(n.atrule?String(n.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:U3,atrule:$V,pseudo:UV,node:W3};var WV={node:av};var qV=lI(K(K(K({},kV),GV),WV));var{tokenize:pat,parse:Sf,generate:Ty,lexer:uat,createLexer:hat,walk:fat,find:gat,findLast:_at,findAll:vat,toPlainObject:Cat,fromPlainObject:bat,fork:xat}=qV;var xl=(()=>{class n{fix(e){let t=Sf(e,{context:"declarationList"});return t.children.forEach(o=>{o.property==="font-size"&&o.value&&o.value.children&&o.value.children.forEach(r=>{if(r.type==="Number"){let a=r.value.toString();a.indexOf("pt")>=0||a.indexOf("px")>=0||(r.value=`${a}pt`)}})}),Ty(t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ta=(()=>{class n{static DEFAULT_FONT="TypeWriter";static DEFAULT_SIZE=10;static REPLACE_BY_FONT="Noto Sans";static REPLACE_BY_SIZE=11;fix(e){return e.font_family===n.DEFAULT_FONT&&e.font_size===n.DEFAULT_SIZE&&(e.font_family=n.REPLACE_BY_FONT,e.font_size=n.REPLACE_BY_SIZE),e}fixStyles(e){let t=Sf(e,{context:"declarationList"}),o=null,r=null,a=!0;if(t.children.forEach(c=>{c.property==="font-family"&&c.value&&c.value.children&&c.value.children.forEach(p=>{p.type==="Identifier"&&(o=p),p.type==="String"&&(o=p,a=!1)}),c.property==="font-size"&&c.value&&c.value.children&&c.value.children.forEach(p=>{p.type==="Dimension"&&(r=p)})}),r&&o){let c=null,p=r.value;a?c=o.name:c=o.value;let u=this.fix({font_family:c.split('"').join(""),font_size:parseInt(p,10)});a?o.name=u.font_family:o.value=u.font_family,r.value=u.font_size}return Ty(t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Mf=(()=>{class n{fontBBoxCalculator;cssFixer;fontFixer;constructor(e,t,o){this.fontBBoxCalculator=e,this.cssFixer=t,this.fontFixer=o}convert(e,t){let o=new Wl;o.rotation=e.rotation,o.style=e.style,o.text=e.text,o.x=e.x,o.y=e.y,o.originalX=e.x,o.originalY=e.y,t!==void 0&&(o.id=t.node_id,o.nodeId=t.node_id);let r=this.cssFixer.fix(o.style),a=this.fontFixer.fixStyles(r),c=this.fontBBoxCalculator.calculate(o.text,a);return o.x!==null&&(o.x+=3),o.y!==null&&(o.y+=c.height),o}static \u0275fac=function(t){return new(t||n)(ge($c),ge(xl),ge(ta))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Ey=class{adapterNumber;linkType;name;portNumber;shortName};var kf=(()=>{class n{convert(e){let t=new Ey;return t.adapterNumber=e.adapter_number,t.linkType=e.link_type,t.name=e.name,t.portNumber=e.port_number,t.shortName=e.short_name,t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Tf=(()=>{class n{labelToMapLabel;portToMapPort;fontBBoxCalculator;cssFixer;fontFixer;constructor(e,t,o,r,a){this.labelToMapLabel=e,this.portToMapPort=t,this.fontBBoxCalculator=o,this.cssFixer=r,this.fontFixer=a}convert(e){let t=new _l;if(t.id=e.node_id,t.commandLine=e.command_line,t.computeId=e.compute_id,t.console=e.console,t.consoleHost=e.console_host,t.consoleType=e.console_type,t.firstPortName=e.first_port_name,t.height=e.height,t.label=this.labelToMapLabel?this.labelToMapLabel.convert(e.label,{node_id:e.node_id}):void 0,t.locked=e.locked,t.name=e.name,t.nodeDirectory=e.node_directory,t.nodeType=e.node_type,t.portNameFormat=e.port_name_format,t.portSegmentSize=e.port_segment_size,t.ports=e.ports?e.ports.map(o=>this.portToMapPort.convert(o)):[],t.properties=e.properties,t.projectId=e.project_id,t.status=e.status,t.symbol=e.symbol,t.symbolUrl=e.symbol_url,t.usage=e.properties.usage,t.width=e.width,t.x=e.x,t.y=e.y,t.z=e.z,t.label!==void 0){let o=this.cssFixer.fix(t.label.style),r=this.fontFixer.fixStyles(o),a=this.fontBBoxCalculator.calculate(t.label.text,r);(e.label.x===null||e.label.y===null)&&(t.label.x=e.width/2-a.width/2+3,t.label.y=-8)}return t}static \u0275fac=function(t){return new(t||n)(ge(Mf),ge(kf),ge($c),ge(xl),ge(ta))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Cu=class{id;captureFileName;captureFilePath;capturing;filters;linkType;nodes;projectId;suspend;show_filters_icon;link_style;wireshark;distance;length;source;target;isSelected=!1;isMultiplied=!1;parallelLinksCount=1;x;y};var yl=(()=>{class n{static LINK_TYPE_PREFIX="gns3-link-type";static BEZIER_CURVINESS_PREFIX="gns3-bezier-curviness";static FLOWCHART_ROUNDNESS_PREFIX="gns3-flowchart-roundness";static linkTypeKey(e,t){return`${n.LINK_TYPE_PREFIX}:${e}:${t}`}static bezierCurvinessKey(e,t){return`${n.BEZIER_CURVINESS_PREFIX}:${e}:${t}`}static flowchartRoundnessKey(e,t){return`${n.FLOWCHART_ROUNDNESS_PREFIX}:${e}:${t}`}static get(e,t){if(!(!e||!t))try{return localStorage.getItem(n.linkTypeKey(e,t))||void 0}catch{return}}static set(e,t,o){if(!(!e||!t||!o))try{localStorage.setItem(n.linkTypeKey(e,t),o)}catch{}}static getNumberValue(e){try{let t=localStorage.getItem(e);if(t===null||t==="")return;let o=parseInt(t,10);return Number.isNaN(o)?void 0:o}catch{return}}static setNumberValue(e,t){if(t!=null)try{localStorage.setItem(e,`${t}`)}catch{}}static getBezierCurviness(e,t){if(!(!e||!t))return n.getNumberValue(n.bezierCurvinessKey(e,t))}static setBezierCurviness(e,t,o){!e||!t||n.setNumberValue(n.bezierCurvinessKey(e,t),o)}static getFlowchartRoundness(e,t){if(!(!e||!t))return n.getNumberValue(n.flowchartRoundnessKey(e,t))}static setFlowchartRoundness(e,t,o){!e||!t||n.setNumberValue(n.flowchartRoundnessKey(e,t),o)}static getStyleSnapshot(e,t){let o=n.get(e,t),r=n.getBezierCurviness(e,t),a=n.getFlowchartRoundness(e,t);if(!(!o&&r===void 0&&a===void 0))return{link_type:o,bezier_curviness:r,flowchart_roundness:a}}static remove(e,t){if(!(!e||!t))try{localStorage.removeItem(n.linkTypeKey(e,t)),localStorage.removeItem(n.bezierCurvinessKey(e,t)),localStorage.removeItem(n.flowchartRoundnessKey(e,t))}catch{}}}return n})();var Rd=class{id;nodeId;linkId;adapterNumber;portNumber;label;bezierRenderOffsetX;bezierRenderOffsetY};var Dy=(()=>{class n{labelToMapLabel;constructor(e){this.labelToMapLabel=e}convert(e,t){let o=new Rd;return o.nodeId=e.node_id,o.adapterNumber=e.adapter_number,o.portNumber=e.port_number,o.label=this.labelToMapLabel.convert(e.label),t!==void 0&&(o.linkId=t.link_id,o.id=`${o.nodeId}-${o.linkId}`),o}static \u0275fac=function(t){return new(t||n)(ge(Mf))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Ef=(()=>{class n{linkNodeToMapLinkNode;constructor(e){this.linkNodeToMapLinkNode=e}convert(e){let t=new Cu;if(t.id=e.link_id,t.captureFileName=e.capture_file_name,t.captureFilePath=e.capture_file_path,t.capturing=e.capturing,t.filters=e.filters,t.link_style=e.link_style,!(t.link_style?.link_type!==void 0||t.link_style?.bezier_curviness!==void 0||t.link_style?.flowchart_roundness!==void 0)){let r=yl.getStyleSnapshot(e.project_id,e.link_id);r&&(t.link_style=K(K({},t.link_style||{}),r))}return t.linkType=e.link_type,t.nodes=e.nodes.map(r=>this.linkNodeToMapLinkNode.convert(r,{link_id:e.link_id})),t.projectId=e.project_id,t.suspend=e.suspend,t.show_filters_icon=e.show_filters_icon,t.wireshark=e.wireshark,t}static \u0275fac=function(t){return new(t||n)(ge(Dy))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Ea=class{id;projectId;rotation;svg;locked;x;y;z;element};var qm=(()=>{class n{constructor(){}convert(e){let t=new Ea;return t.id=e.drawing_id,t.projectId=e.project_id,t.rotation=e.rotation,t.svg=e.svg,t.locked=e.locked,t.x=e.x,t.y=e.y,t.z=e.z,t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Py=class{id;builtin;filename;raw};var Iy=(()=>{class n{convert(e){let t=new Py;return t.id=e.symbol_id,t.builtin=e.builtin,t.filename=e.filename,t.raw=e.raw,t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Ay=class{index;nodes;drawings;links;constructor(i,e=[],t=[],o=[]){this.index=i,this.nodes=e,this.drawings=t,this.links=o}};var Df=(()=>{class n{layers;constructor(){this.layers={}}getLayersList(){return Object.keys(this.layers).sort((e,t)=>Number(e)-Number(t)).map(e=>this.layers[e])}setNodes(e){e.forEach(t=>{this.getLayerForKey(t.z.toString()).nodes.push(t)})}setDrawings(e){e.forEach(t=>{this.getLayerForKey(t.z.toString()).drawings.push(t)})}setLinks(e){e.filter(t=>t.source&&t.target).forEach(t=>{let o=Math.min(t.source.z,t.target.z).toString();this.getLayerForKey(o).links.push(t)})}clear(){this.layers={}}getLayerForKey(e){return e in this.layers||(this.layers[e]=new Ay,this.layers[e].index=Number(e)),this.layers[e]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Qm=(()=>{class n{static DEFAULT_LINK_SPACING=14;static DENSE_LINK_SPACING=10;static MIN_LINK_SPACING=6;static DENSE_BUNDLE_THRESHOLD=4;static NODE_EDGE_PADDING=8;static MAX_VISIBLE_DENSE_LINKS=8;linkTranslation(e,t,o){if(!e)return{dx:0,dy:0};let r=o.x-t.x,a=o.y-t.y,c=Math.sqrt(r*r+a*a);if(c===0)return{dx:0,dy:0};let p=-a/c,u=r/c;return{dx:p*e,dy:u*e}}assignDataToLinks(e){let t={};e.forEach(o=>{if(!o.source||!o.target){o.distance=0,o.parallelLinksCount=1;return}let r=o.source.id,a=o.target.id,c=r<a?`${r},${a}`:`${a},${r}`;c in t||(t[c]=[]),t[c].push(o)}),Object.keys(t).forEach(o=>{let r=t[o],a=this.calculateSpacingForGroup(r),c=this.getVisibleRange(r.length),p=this.getOverflowStackDistance(r.length,a),u=(c.count-1)/2;r.forEach((h,_)=>{if(_<c.start||_>c.end)h.distance=p;else{let S=_-c.start;h.distance=(S-u)*a}h.parallelLinksCount=r.length})})}getVisibleRange(e){if(e<=n.MAX_VISIBLE_DENSE_LINKS)return{start:0,end:Math.max(0,e-1),count:e};let t=this.getVisibleLinksCountForSpacing(e),o=e-t,a=Math.floor(o/2);return{start:a,end:a+t-1,count:t}}getOverflowStackDistance(e,t){return e<=n.MAX_VISIBLE_DENSE_LINKS?0:t/2}calculateSpacingForGroup(e){if(e.length<=n.DENSE_BUNDLE_THRESHOLD)return n.DEFAULT_LINK_SPACING;let t=n.DENSE_LINK_SPACING,o=this.getMaxSpacingFromNodeSize(e);return o>0&&(t=Math.min(t,o)),Math.max(n.MIN_LINK_SPACING,t)}getMaxSpacingFromNodeSize(e){let t=this.getVisibleLinksCountForSpacing(e.length);if(t<=1)return n.DEFAULT_LINK_SPACING;let o=e[0],r=this.getNodeCrossSection(o.source),a=this.getNodeCrossSection(o.target);if(!r||!a)return 0;let c=Math.min(r,a)-n.NODE_EDGE_PADDING*2;return c<=0?0:c/(t-1)}getVisibleLinksCountForSpacing(e){return Math.min(e,n.MAX_VISIBLE_DENSE_LINKS)}getNodeCrossSection(e){if(!e)return 0;let t=[e.width,e.height].filter(o=>typeof o=="number"&&o>0);return t.length===0?0:Math.min(...t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Xm=(()=>{class n{mapNodesDataSource;mapLinksDataSource;mapDrawingsDataSource;mapSymbolsDataSource;nodeToMapNode;linkToMapLink;drawingToMapDrawing;symbolToMapSymbol;layersManager;multiLinkCalculator;constructor(e,t,o,r,a,c,p,u,h,_){this.mapNodesDataSource=e,this.mapLinksDataSource=t,this.mapDrawingsDataSource=o,this.mapSymbolsDataSource=r,this.nodeToMapNode=a,this.linkToMapLink=c,this.drawingToMapDrawing=p,this.symbolToMapSymbol=u,this.layersManager=h,this.multiLinkCalculator=_}setNodes(e){if(e){let t=e.map(o=>this.nodeToMapNode.convert(o));this.mapNodesDataSource.set(t),this.assignDataToLinks(),this.onDataUpdate()}}setLinks(e){if(e){let t=e.map(o=>this.linkToMapLink.convert(o));this.mapLinksDataSource.set(t),this.assignDataToLinks(),this.onDataUpdate()}}setDrawings(e){if(e){let t=e.map(o=>this.drawingToMapDrawing.convert(o));this.mapDrawingsDataSource.set(t),this.onDataUpdate()}}setSymbols(e){if(e){let t=e.map(o=>this.symbolToMapSymbol.convert(o));this.mapSymbolsDataSource.set(t)}}getNodes(){return this.mapNodesDataSource.getItems()}getLinks(){return this.mapLinksDataSource.getItems()}getDrawings(){return this.mapDrawingsDataSource.getItems()}getSymbols(){return this.mapSymbolsDataSource.getItems()}onDataUpdate(){this.layersManager.clear(),this.layersManager.setNodes(this.getNodes()),this.layersManager.setLinks(this.getLinks()),this.layersManager.setDrawings(this.getDrawings())}assignDataToLinks(){let e={};this.getNodes().forEach(t=>{e[t.id]=t}),this.getLinks().forEach(t=>{if(!t.nodes||t.nodes.length<2)return;let o=t.nodes[0]?.nodeId,r=t.nodes[1]?.nodeId;o&&o in e&&(t.source=e[o]),r&&r in e&&(t.target=e[r]),t.source&&t.target&&(t.x=t.source.x+(t.target.x-t.source.x)*.5,t.y=t.source.y+(t.target.y-t.source.y)*.5)}),this.multiLinkCalculator.assignDataToLinks(this.getLinks())}static \u0275fac=function(t){return new(t||n)(ge(rf),ge(jc),ge(af),ge(sf),ge(Tf),ge(Ef),ge(qm),ge(Iy),ge(Df),ge(Qm))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Sl=(()=>{class n{isReadOnly=!1;static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Km=(()=>{class n{changesDetected=new ve;selectionChangesDetected=new ve;hasBeenDrawn=!1;detectChanges(){this.changesDetected.emit(!0)}detectSelectionChanges(){this.selectionChangesDetected.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ife={value:()=>{}};function YV(){for(var n=0,i=arguments.length,e={},t;n<i;++n){if(!(t=arguments[n]+"")||t in e||/[\s.]/.test(t))throw new Error("illegal type: "+t);e[t]=[]}return new Ny(e)}function Ny(n){this._=n}function ofe(n,i){return n.trim().split(/^|\s+/).map(function(e){var t="",o=e.indexOf(".");if(o>=0&&(t=e.slice(o+1),e=e.slice(0,o)),e&&!i.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})}Ny.prototype=YV.prototype={constructor:Ny,on:function(n,i){var e=this._,t=ofe(n+"",e),o,r=-1,a=t.length;if(arguments.length<2){for(;++r<a;)if((o=(n=t[r]).type)&&(o=rfe(e[o],n.name)))return o;return}if(i!=null&&typeof i!="function")throw new Error("invalid callback: "+i);for(;++r<a;)if(o=(n=t[r]).type)e[o]=KV(e[o],n.name,i);else if(i==null)for(o in e)e[o]=KV(e[o],n.name,null);return this},copy:function(){var n={},i=this._;for(var e in i)n[e]=i[e].slice();return new Ny(n)},call:function(n,i){if((o=arguments.length-2)>0)for(var e=new Array(o),t=0,o,r;t<o;++t)e[t]=arguments[t+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(r=this._[n],t=0,o=r.length;t<o;++t)r[t].value.apply(i,e)},apply:function(n,i,e){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var t=this._[n],o=0,r=t.length;o<r;++o)t[o].value.apply(i,e)}};function rfe(n,i){for(var e=0,t=n.length,o;e<t;++e)if((o=n[e]).name===i)return o.value}function KV(n,i,e){for(var t=0,o=n.length;t<o;++t)if(n[t].name===i){n[t]=ife,n=n.slice(0,t).concat(n.slice(t+1));break}return e!=null&&n.push({name:i,value:e}),n}var bu=YV;var ZV={passive:!1},xu={capture:!0,passive:!1};function Fy(n){n.stopImmediatePropagation()}function Ym(n){n.preventDefault(),n.stopImmediatePropagation()}function cv(n){var i=n.document.documentElement,e=Wt(n).on("dragstart.drag",Ym,xu);"onselectstart"in i?e.on("selectstart.drag",Ym,xu):(i.__noselect=i.style.MozUserSelect,i.style.MozUserSelect="none")}function dv(n,i){var e=n.document.documentElement,t=Wt(n).on("dragstart.drag",null);i&&(t.on("click.drag",Ym,xu),setTimeout(function(){t.on("click.drag",null)},0)),"onselectstart"in e?t.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var mv=n=>()=>n;function pv(n,{sourceEvent:i,subject:e,target:t,identifier:o,active:r,x:a,y:c,dx:p,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}pv.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function afe(n){return!n.ctrlKey&&!n.button}function sfe(){return this.parentNode}function lfe(n,i){return i??{x:n.x,y:n.y}}function cfe(){return navigator.maxTouchPoints||"ontouchstart"in this}function fs(){var n=afe,i=sfe,e=lfe,t=cfe,o={},r=bu("start","drag","end"),a=0,c,p,u,h,_=0;function S(D){D.on("mousedown.drag",x).filter(t).on("touchstart.drag",w).on("touchmove.drag",y,ZV).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(D,N){if(!(h||!n.call(this,D,N))){var P=I(this,i.call(this,D,N),D,N,"mouse");P&&(Wt(D.view).on("mousemove.drag",b,xu).on("mouseup.drag",M,xu),cv(D.view),Fy(D),u=!1,c=D.clientX,p=D.clientY,P("start",D))}}function b(D){if(Ym(D),!u){var N=D.clientX-c,P=D.clientY-p;u=N*N+P*P>_}o.mouse("drag",D)}function M(D){Wt(D.view).on("mousemove.drag mouseup.drag",null),dv(D.view,u),Ym(D),o.mouse("end",D)}function w(D,N){if(n.call(this,D,N)){var P=D.changedTouches,L=i.call(this,D,N),re=P.length,oe,G;for(oe=0;oe<re;++oe)(G=I(this,L,D,N,P[oe].identifier,P[oe]))&&(Fy(D),G("start",D,P[oe]))}}function y(D){var N=D.changedTouches,P=N.length,L,re;for(L=0;L<P;++L)(re=o[N[L].identifier])&&(Ym(D),re("drag",D,N[L]))}function E(D){var N=D.changedTouches,P=N.length,L,re;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),L=0;L<P;++L)(re=o[N[L].identifier])&&(Fy(D),re("end",D,N[L]))}function I(D,N,P,L,re,oe){var G=r.copy(),$=Zr(oe||P,N),ue,be,me;if((me=e.call(D,new pv("beforestart",{sourceEvent:P,target:S,identifier:re,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:G}),L))!=null)return ue=me.x-$[0]||0,be=me.y-$[1]||0,function De(he,B,X){var se=$,ce;switch(he){case"start":o[re]=De,ce=a++;break;case"end":delete o[re],--a;case"drag":$=Zr(X||B,N),ce=a;break}G.call(he,D,new pv(he,{sourceEvent:B,subject:me,target:S,identifier:re,active:ce,x:$[0]+ue,y:$[1]+be,dx:$[0]-se[0],dy:$[1]-se[1],dispatch:G}),L)}}return S.filter=function(D){return arguments.length?(n=typeof D=="function"?D:mv(!!D),S):n},S.container=function(D){return arguments.length?(i=typeof D=="function"?D:mv(D),S):i},S.subject=function(D){return arguments.length?(e=typeof D=="function"?D:mv(D),S):e},S.touchable=function(D){return arguments.length?(t=typeof D=="function"?D:mv(!!D),S):t},S.on=function(){var D=r.on.apply(r,arguments);return D===r?S:D},S.clickDistance=function(D){return arguments.length?(_=(D=+D)*D,S):Math.sqrt(_)},S}function Ry(n,i,e){n.prototype=i.prototype=e,e.constructor=n}function X3(n,i){var e=Object.create(n.prototype);for(var t in i)e[t]=i[t];return e}function fv(){}var uv=.7,By=1/uv,Pf="\\s*([+-]?\\d+)\\s*",hv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dfe=/^#([0-9a-f]{3,8})$/,mfe=new RegExp(`^rgb\\(${Pf},${Pf},${Pf}\\)$`),pfe=new RegExp(`^rgb\\(${qc},${qc},${qc}\\)$`),ufe=new RegExp(`^rgba\\(${Pf},${Pf},${Pf},${hv}\\)$`),hfe=new RegExp(`^rgba\\(${qc},${qc},${qc},${hv}\\)$`),ffe=new RegExp(`^hsl\\(${hv},${qc},${qc}\\)$`),gfe=new RegExp(`^hsla\\(${hv},${qc},${qc},${hv}\\)$`),JV={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ry(fv,Zm,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:eB,formatHex:eB,formatHex8:_fe,formatHsl:vfe,formatRgb:tB,toString:tB});function eB(){return this.rgb().formatHex()}function _fe(){return this.rgb().formatHex8()}function vfe(){return sB(this).formatHsl()}function tB(){return this.rgb().formatRgb()}function Zm(n){var i,e;return n=(n+"").trim().toLowerCase(),(i=dfe.exec(n))?(e=i[1].length,i=parseInt(i[1],16),e===6?nB(i):e===3?new gs(i>>8&15|i>>4&240,i>>4&15|i&240,(i&15)<<4|i&15,1):e===8?Ly(i>>24&255,i>>16&255,i>>8&255,(i&255)/255):e===4?Ly(i>>12&15|i>>8&240,i>>8&15|i>>4&240,i>>4&15|i&240,((i&15)<<4|i&15)/255):null):(i=mfe.exec(n))?new gs(i[1],i[2],i[3],1):(i=pfe.exec(n))?new gs(i[1]*255/100,i[2]*255/100,i[3]*255/100,1):(i=ufe.exec(n))?Ly(i[1],i[2],i[3],i[4]):(i=hfe.exec(n))?Ly(i[1]*255/100,i[2]*255/100,i[3]*255/100,i[4]):(i=ffe.exec(n))?rB(i[1],i[2]/100,i[3]/100,1):(i=gfe.exec(n))?rB(i[1],i[2]/100,i[3]/100,i[4]):JV.hasOwnProperty(n)?nB(JV[n]):n==="transparent"?new gs(NaN,NaN,NaN,0):null}function nB(n){return new gs(n>>16&255,n>>8&255,n&255,1)}function Ly(n,i,e,t){return t<=0&&(n=i=e=NaN),new gs(n,i,e,t)}function Cfe(n){return n instanceof fv||(n=Zm(n)),n?(n=n.rgb(),new gs(n.r,n.g,n.b,n.opacity)):new gs}function If(n,i,e,t){return arguments.length===1?Cfe(n):new gs(n,i,e,t??1)}function gs(n,i,e,t){this.r=+n,this.g=+i,this.b=+e,this.opacity=+t}Ry(gs,If,X3(fv,{brighter(n){return n=n==null?By:Math.pow(By,n),new gs(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?uv:Math.pow(uv,n),new gs(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new gs(Su(this.r),Su(this.g),Su(this.b),zy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:iB,formatHex:iB,formatHex8:bfe,formatRgb:oB,toString:oB}));function iB(){return`#${yu(this.r)}${yu(this.g)}${yu(this.b)}`}function bfe(){return`#${yu(this.r)}${yu(this.g)}${yu(this.b)}${yu((isNaN(this.opacity)?1:this.opacity)*255)}`}function oB(){let n=zy(this.opacity);return`${n===1?"rgb(":"rgba("}${Su(this.r)}, ${Su(this.g)}, ${Su(this.b)}${n===1?")":`, ${n})`}`}function zy(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Su(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function yu(n){return n=Su(n),(n<16?"0":"")+n.toString(16)}function rB(n,i,e,t){return t<=0?n=i=e=NaN:e<=0||e>=1?n=i=NaN:i<=0&&(n=NaN),new Xl(n,i,e,t)}function sB(n){if(n instanceof Xl)return new Xl(n.h,n.s,n.l,n.opacity);if(n instanceof fv||(n=Zm(n)),!n)return new Xl;if(n instanceof Xl)return n;n=n.rgb();var i=n.r/255,e=n.g/255,t=n.b/255,o=Math.min(i,e,t),r=Math.max(i,e,t),a=NaN,c=r-o,p=(r+o)/2;return c?(i===r?a=(e-t)/c+(e<t)*6:e===r?a=(t-i)/c+2:a=(i-e)/c+4,c/=p<.5?r+o:2-r-o,a*=60):c=p>0&&p<1?0:a,new Xl(a,c,p,n.opacity)}function lB(n,i,e,t){return arguments.length===1?sB(n):new Xl(n,i,e,t??1)}function Xl(n,i,e,t){this.h=+n,this.s=+i,this.l=+e,this.opacity=+t}Ry(Xl,lB,X3(fv,{brighter(n){return n=n==null?By:Math.pow(By,n),new Xl(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?uv:Math.pow(uv,n),new Xl(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,i=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,t=e+(e<.5?e:1-e)*i,o=2*e-t;return new gs(K3(n>=240?n-240:n+120,o,t),K3(n,o,t),K3(n<120?n+240:n-120,o,t),this.opacity)},clamp(){return new Xl(aB(this.h),Vy(this.s),Vy(this.l),zy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let n=zy(this.opacity);return`${n===1?"hsl(":"hsla("}${aB(this.h)}, ${Vy(this.s)*100}%, ${Vy(this.l)*100}%${n===1?")":`, ${n})`}`}}));function aB(n){return n=(n||0)%360,n<0?n+360:n}function Vy(n){return Math.max(0,Math.min(1,n||0))}function K3(n,i,e){return(n<60?i+(e-i)*n/60:n<180?e:n<240?i+(e-i)*(240-n)/60:i)*255}function Y3(n,i,e,t,o){var r=n*n,a=r*n;return((1-3*n+3*r-a)*i+(4-6*r+3*a)*e+(1+3*n+3*r-3*a)*t+a*o)/6}function cB(n){var i=n.length-1;return function(e){var t=e<=0?e=0:e>=1?(e=1,i-1):Math.floor(e*i),o=n[t],r=n[t+1],a=t>0?n[t-1]:2*o-r,c=t<i-1?n[t+2]:2*r-o;return Y3((e-t/i)*i,a,o,r,c)}}function dB(n){var i=n.length;return function(e){var t=Math.floor(((e%=1)<0?++e:e)*i),o=n[(t+i-1)%i],r=n[t%i],a=n[(t+1)%i],c=n[(t+2)%i];return Y3((e-t/i)*i,o,r,a,c)}}var Z3=n=>()=>n;function xfe(n,i){return function(e){return n+e*i}}function yfe(n,i,e){return n=Math.pow(n,e),i=Math.pow(i,e)-n,e=1/e,function(t){return Math.pow(n+t*i,e)}}function mB(n){return(n=+n)==1?jy:function(i,e){return e-i?yfe(i,e,n):Z3(isNaN(i)?e:i)}}function jy(n,i){var e=i-n;return e?xfe(n,e):Z3(isNaN(n)?i:n)}var $y=(function n(i){var e=mB(i);function t(o,r){var a=e((o=If(o)).r,(r=If(r)).r),c=e(o.g,r.g),p=e(o.b,r.b),u=jy(o.opacity,r.opacity);return function(h){return o.r=a(h),o.g=c(h),o.b=p(h),o.opacity=u(h),o+""}}return t.gamma=n,t})(1);function pB(n){return function(i){var e=i.length,t=new Array(e),o=new Array(e),r=new Array(e),a,c;for(a=0;a<e;++a)c=If(i[a]),t[a]=c.r||0,o[a]=c.g||0,r[a]=c.b||0;return t=n(t),o=n(o),r=n(r),c.opacity=1,function(p){return c.r=t(p),c.g=o(p),c.b=r(p),c+""}}}var Sfe=pB(cB),wfe=pB(dB);function wl(n,i){return n=+n,i=+i,function(e){return n*(1-e)+i*e}}var eA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,J3=new RegExp(eA.source,"g");function Mfe(n){return function(){return n}}function kfe(n){return function(i){return n(i)+""}}function tA(n,i){var e=eA.lastIndex=J3.lastIndex=0,t,o,r,a=-1,c=[],p=[];for(n=n+"",i=i+"";(t=eA.exec(n))&&(o=J3.exec(i));)(r=o.index)>e&&(r=i.slice(e,r),c[a]?c[a]+=r:c[++a]=r),(t=t[0])===(o=o[0])?c[a]?c[a]+=o:c[++a]=o:(c[++a]=null,p.push({i:a,x:wl(t,o)})),e=J3.lastIndex;return e<i.length&&(r=i.slice(e),c[a]?c[a]+=r:c[++a]=r),c.length<2?p[0]?kfe(p[0].x):Mfe(i):(i=p.length,function(u){for(var h=0,_;h<i;++h)c[(_=p[h]).i]=_.x(u);return c.join("")})}var uB=180/Math.PI,Hy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nA(n,i,e,t,o,r){var a,c,p;return(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a),(p=n*e+i*t)&&(e-=n*p,t-=i*p),(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c,p/=c),n*t<i*e&&(n=-n,i=-i,p=-p,a=-a),{translateX:o,translateY:r,rotate:Math.atan2(i,n)*uB,skewX:Math.atan(p)*uB,scaleX:a,scaleY:c}}var Uy;function hB(n){let i=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return i.isIdentity?Hy:nA(i.a,i.b,i.c,i.d,i.e,i.f)}function fB(n){return n==null?Hy:(Uy||(Uy=document.createElementNS("http://www.w3.org/2000/svg","g")),Uy.setAttribute("transform",n),(n=Uy.transform.baseVal.consolidate())?(n=n.matrix,nA(n.a,n.b,n.c,n.d,n.e,n.f)):Hy)}function gB(n,i,e,t){function o(u){return u.length?u.pop()+" ":""}function r(u,h,_,S,x,b){if(u!==_||h!==S){var M=x.push("translate(",null,i,null,e);b.push({i:M-4,x:wl(u,_)},{i:M-2,x:wl(h,S)})}else(_||S)&&x.push("translate("+_+i+S+e)}function a(u,h,_,S){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),S.push({i:_.push(o(_)+"rotate(",null,t)-2,x:wl(u,h)})):h&&_.push(o(_)+"rotate("+h+t)}function c(u,h,_,S){u!==h?S.push({i:_.push(o(_)+"skewX(",null,t)-2,x:wl(u,h)}):h&&_.push(o(_)+"skewX("+h+t)}function p(u,h,_,S,x,b){if(u!==_||h!==S){var M=x.push(o(x)+"scale(",null,",",null,")");b.push({i:M-4,x:wl(u,_)},{i:M-2,x:wl(h,S)})}else(_!==1||S!==1)&&x.push(o(x)+"scale("+_+","+S+")")}return function(u,h){var _=[],S=[];return u=n(u),h=n(h),r(u.translateX,u.translateY,h.translateX,h.translateY,_,S),a(u.rotate,h.rotate,_,S),c(u.skewX,h.skewX,_,S),p(u.scaleX,u.scaleY,h.scaleX,h.scaleY,_,S),u=h=null,function(x){for(var b=-1,M=S.length,w;++b<M;)_[(w=S[b]).i]=w.x(x);return _.join("")}}}var iA=gB(hB,"px, ","px)","deg)"),oA=gB(fB,", ",")",")");var Tfe=1e-12;function _B(n){return((n=Math.exp(n))+1/n)/2}function Efe(n){return((n=Math.exp(n))-1/n)/2}function Dfe(n){return((n=Math.exp(2*n))-1)/(n+1)}var rA=(function n(i,e,t){function o(r,a){var c=r[0],p=r[1],u=r[2],h=a[0],_=a[1],S=a[2],x=h-c,b=_-p,M=x*x+b*b,w,y;if(M<Tfe)y=Math.log(S/u)/i,w=function(L){return[c+L*x,p+L*b,u*Math.exp(i*L*y)]};else{var E=Math.sqrt(M),I=(S*S-u*u+t*M)/(2*u*e*E),D=(S*S-u*u-t*M)/(2*S*e*E),N=Math.log(Math.sqrt(I*I+1)-I),P=Math.log(Math.sqrt(D*D+1)-D);y=(P-N)/i,w=function(L){var re=L*y,oe=_B(N),G=u/(e*E)*(oe*Dfe(i*re+N)-Efe(N));return[c+G*x,p+G*b,u*oe/_B(i*re+N)]}}return w.duration=y*1e3*i/Math.SQRT2,w}return o.rho=function(r){var a=Math.max(.001,+r),c=a*a,p=c*c;return n(a,c,p)},o})(Math.SQRT2,2,4);var Af=0,_v=0,gv=0,CB=1e3,Gy,vv,Wy=0,wu=0,qy=0,Cv=typeof performance=="object"&&performance.now?performance:Date,bB=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function xv(){return wu||(bB(Pfe),wu=Cv.now()+qy)}function Pfe(){wu=0}function bv(){this._call=this._time=this._next=null}bv.prototype=Qy.prototype={constructor:bv,restart:function(n,i,e){if(typeof n!="function")throw new TypeError("callback is not a function");e=(e==null?xv():+e)+(i==null?0:+i),!this._next&&vv!==this&&(vv?vv._next=this:Gy=this,vv=this),this._call=n,this._time=e,aA()},stop:function(){this._call&&(this._call=null,this._time=1/0,aA())}};function Qy(n,i,e){var t=new bv;return t.restart(n,i,e),t}function xB(){xv(),++Af;for(var n=Gy,i;n;)(i=wu-n._time)>=0&&n._call.call(void 0,i),n=n._next;--Af}function vB(){wu=(Wy=Cv.now())+qy,Af=_v=0;try{xB()}finally{Af=0,Afe(),wu=0}}function Ife(){var n=Cv.now(),i=n-Wy;i>CB&&(qy-=i,Wy=n)}function Afe(){for(var n,i=Gy,e,t=1/0;i;)i._call?(t>i._time&&(t=i._time),n=i,i=i._next):(e=i._next,i._next=null,i=n?n._next=e:Gy=e);vv=n,aA(t)}function aA(n){if(!Af){_v&&(_v=clearTimeout(_v));var i=n-wu;i>24?(n<1/0&&(_v=setTimeout(vB,n-Cv.now()-qy)),gv&&(gv=clearInterval(gv))):(gv||(Wy=Cv.now(),gv=setInterval(Ife,CB)),Af=1,bB(vB))}}function Xy(n,i,e){var t=new bv;return i=i==null?0:+i,t.restart(o=>{t.stop(),n(o+i)},i,e),t}var Ofe=bu("start","end","cancel","interrupt"),Nfe=[],wB=0,yB=1,Yy=2,Ky=3,SB=4,Zy=5,yv=6;function Jm(n,i,e,t,o,r){var a=n.__transition;if(!a)n.__transition={};else if(e in a)return;Ffe(n,e,{name:i,index:t,group:o,on:Ofe,tween:Nfe,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:wB})}function Sv(n,i){var e=Vr(n,i);if(e.state>wB)throw new Error("too late; already scheduled");return e}function pa(n,i){var e=Vr(n,i);if(e.state>Ky)throw new Error("too late; already running");return e}function Vr(n,i){var e=n.__transition;if(!e||!(e=e[i]))throw new Error("transition not found");return e}function Ffe(n,i,e){var t=n.__transition,o;t[i]=e,e.timer=Qy(r,0,e.time);function r(u){e.state=yB,e.timer.restart(a,e.delay,e.time),e.delay<=u&&a(u-e.delay)}function a(u){var h,_,S,x;if(e.state!==yB)return p();for(h in t)if(x=t[h],x.name===e.name){if(x.state===Ky)return Xy(a);x.state===SB?(x.state=yv,x.timer.stop(),x.on.call("interrupt",n,n.__data__,x.index,x.group),delete t[h]):+h<i&&(x.state=yv,x.timer.stop(),x.on.call("cancel",n,n.__data__,x.index,x.group),delete t[h])}if(Xy(function(){e.state===Ky&&(e.state=SB,e.timer.restart(c,e.delay,e.time),c(u))}),e.state=Yy,e.on.call("start",n,n.__data__,e.index,e.group),e.state===Yy){for(e.state=Ky,o=new Array(S=e.tween.length),h=0,_=-1;h<S;++h)(x=e.tween[h].value.call(n,n.__data__,e.index,e.group))&&(o[++_]=x);o.length=_+1}}function c(u){for(var h=u<e.duration?e.ease.call(null,u/e.duration):(e.timer.restart(p),e.state=Zy,1),_=-1,S=o.length;++_<S;)o[_].call(n,h);e.state===Zy&&(e.on.call("end",n,n.__data__,e.index,e.group),p())}function p(){e.state=yv,e.timer.stop(),delete t[i];for(var u in t)return;delete n.__transition}}function ep(n,i){var e=n.__transition,t,o,r=!0,a;if(e){i=i==null?null:i+"";for(a in e){if((t=e[a]).name!==i){r=!1;continue}o=t.state>Yy&&t.state<Zy,t.state=yv,t.timer.stop(),t.on.call(o?"interrupt":"cancel",n,n.__data__,t.index,t.group),delete e[a]}r&&delete n.__transition}}function MB(n){return this.each(function(){ep(this,n)})}function Rfe(n,i){var e,t;return function(){var o=pa(this,n),r=o.tween;if(r!==e){t=e=r;for(var a=0,c=t.length;a<c;++a)if(t[a].name===i){t=t.slice(),t.splice(a,1);break}}o.tween=t}}function Lfe(n,i,e){var t,o;if(typeof e!="function")throw new Error;return function(){var r=pa(this,n),a=r.tween;if(a!==t){o=(t=a).slice();for(var c={name:i,value:e},p=0,u=o.length;p<u;++p)if(o[p].name===i){o[p]=c;break}p===u&&o.push(c)}r.tween=o}}function kB(n,i){var e=this._id;if(n+="",arguments.length<2){for(var t=Vr(this.node(),e).tween,o=0,r=t.length,a;o<r;++o)if((a=t[o]).name===n)return a.value;return null}return this.each((i==null?Rfe:Lfe)(e,n,i))}function Of(n,i,e){var t=n._id;return n.each(function(){var o=pa(this,t);(o.value||(o.value={}))[i]=e.apply(this,arguments)}),function(o){return Vr(o,t).value[i]}}function Jy(n,i){var e;return(typeof i=="number"?wl:i instanceof Zm?$y:(e=Zm(i))?(i=e,$y):tA)(n,i)}function Vfe(n){return function(){this.removeAttribute(n)}}function Bfe(n){return function(){this.removeAttributeNS(n.space,n.local)}}function zfe(n,i,e){var t,o=e+"",r;return function(){var a=this.getAttribute(n);return a===o?null:a===t?r:r=i(t=a,e)}}function jfe(n,i,e){var t,o=e+"",r;return function(){var a=this.getAttributeNS(n.space,n.local);return a===o?null:a===t?r:r=i(t=a,e)}}function $fe(n,i,e){var t,o,r;return function(){var a,c=e(this),p;return c==null?void this.removeAttribute(n):(a=this.getAttribute(n),p=c+"",a===p?null:a===t&&p===o?r:(o=p,r=i(t=a,c)))}}function Hfe(n,i,e){var t,o,r;return function(){var a,c=e(this),p;return c==null?void this.removeAttributeNS(n.space,n.local):(a=this.getAttributeNS(n.space,n.local),p=c+"",a===p?null:a===t&&p===o?r:(o=p,r=i(t=a,c)))}}function TB(n,i){var e=Dd(n),t=e==="transform"?oA:Jy;return this.attrTween(n,typeof i=="function"?(e.local?Hfe:$fe)(e,t,Of(this,"attr."+n,i)):i==null?(e.local?Bfe:Vfe)(e):(e.local?jfe:zfe)(e,t,i))}function Ufe(n,i){return function(e){this.setAttribute(n,i.call(this,e))}}function Gfe(n,i){return function(e){this.setAttributeNS(n.space,n.local,i.call(this,e))}}function Wfe(n,i){var e,t;function o(){var r=i.apply(this,arguments);return r!==t&&(e=(t=r)&&Gfe(n,r)),e}return o._value=i,o}function qfe(n,i){var e,t;function o(){var r=i.apply(this,arguments);return r!==t&&(e=(t=r)&&Ufe(n,r)),e}return o._value=i,o}function EB(n,i){var e="attr."+n;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(i==null)return this.tween(e,null);if(typeof i!="function")throw new Error;var t=Dd(n);return this.tween(e,(t.local?Wfe:qfe)(t,i))}function Qfe(n,i){return function(){Sv(this,n).delay=+i.apply(this,arguments)}}function Xfe(n,i){return i=+i,function(){Sv(this,n).delay=i}}function DB(n){var i=this._id;return arguments.length?this.each((typeof n=="function"?Qfe:Xfe)(i,n)):Vr(this.node(),i).delay}function Kfe(n,i){return function(){pa(this,n).duration=+i.apply(this,arguments)}}function Yfe(n,i){return i=+i,function(){pa(this,n).duration=i}}function PB(n){var i=this._id;return arguments.length?this.each((typeof n=="function"?Kfe:Yfe)(i,n)):Vr(this.node(),i).duration}function Zfe(n,i){if(typeof i!="function")throw new Error;return function(){pa(this,n).ease=i}}function IB(n){var i=this._id;return arguments.length?this.each(Zfe(i,n)):Vr(this.node(),i).ease}function Jfe(n,i){return function(){var e=i.apply(this,arguments);if(typeof e!="function")throw new Error;pa(this,n).ease=e}}function AB(n){if(typeof n!="function")throw new Error;return this.each(Jfe(this._id,n))}function OB(n){typeof n!="function"&&(n=L0(n));for(var i=this._groups,e=i.length,t=new Array(e),o=0;o<e;++o)for(var r=i[o],a=r.length,c=t[o]=[],p,u=0;u<a;++u)(p=r[u])&&n.call(p,p.__data__,u,r)&&c.push(p);return new Ga(t,this._parents,this._name,this._id)}function NB(n){if(n._id!==this._id)throw new Error;for(var i=this._groups,e=n._groups,t=i.length,o=e.length,r=Math.min(t,o),a=new Array(t),c=0;c<r;++c)for(var p=i[c],u=e[c],h=p.length,_=a[c]=new Array(h),S,x=0;x<h;++x)(S=p[x]||u[x])&&(_[x]=S);for(;c<t;++c)a[c]=i[c];return new Ga(a,this._parents,this._name,this._id)}function ege(n){return(n+"").trim().split(/^|\s+/).every(function(i){var e=i.indexOf(".");return e>=0&&(i=i.slice(0,e)),!i||i==="start"})}function tge(n,i,e){var t,o,r=ege(i)?Sv:pa;return function(){var a=r(this,n),c=a.on;c!==t&&(o=(t=c).copy()).on(i,e),a.on=o}}function FB(n,i){var e=this._id;return arguments.length<2?Vr(this.node(),e).on.on(n):this.each(tge(e,n,i))}function nge(n){return function(){var i=this.parentNode;for(var e in this.__transition)if(+e!==n)return;i&&i.removeChild(this)}}function RB(){return this.on("end.remove",nge(this._id))}function LB(n){var i=this._name,e=this._id;typeof n!="function"&&(n=uu(n));for(var t=this._groups,o=t.length,r=new Array(o),a=0;a<o;++a)for(var c=t[a],p=c.length,u=r[a]=new Array(p),h,_,S=0;S<p;++S)(h=c[S])&&(_=n.call(h,h.__data__,S,c))&&("__data__"in h&&(_.__data__=h.__data__),u[S]=_,Jm(u[S],i,e,S,u,Vr(h,e)));return new Ga(r,this._parents,i,e)}function VB(n){var i=this._name,e=this._id;typeof n!="function"&&(n=R0(n));for(var t=this._groups,o=t.length,r=[],a=[],c=0;c<o;++c)for(var p=t[c],u=p.length,h,_=0;_<u;++_)if(h=p[_]){for(var S=n.call(h,h.__data__,_,p),x,b=Vr(h,e),M=0,w=S.length;M<w;++M)(x=S[M])&&Jm(x,i,e,M,S,b);r.push(S),a.push(h)}return new Ga(r,a,i,e)}var ige=Pd.prototype.constructor;function BB(){return new ige(this._groups,this._parents)}function oge(n,i){var e,t,o;return function(){var r=Bm(this,n),a=(this.style.removeProperty(n),Bm(this,n));return r===a?null:r===e&&a===t?o:o=i(e=r,t=a)}}function zB(n){return function(){this.style.removeProperty(n)}}function rge(n,i,e){var t,o=e+"",r;return function(){var a=Bm(this,n);return a===o?null:a===t?r:r=i(t=a,e)}}function age(n,i,e){var t,o,r;return function(){var a=Bm(this,n),c=e(this),p=c+"";return c==null&&(p=c=(this.style.removeProperty(n),Bm(this,n))),a===p?null:a===t&&p===o?r:(o=p,r=i(t=a,c))}}function sge(n,i){var e,t,o,r="style."+i,a="end."+r,c;return function(){var p=pa(this,n),u=p.on,h=p.value[r]==null?c||(c=zB(i)):void 0;(u!==e||o!==h)&&(t=(e=u).copy()).on(a,o=h),p.on=t}}function jB(n,i,e){var t=(n+="")=="transform"?iA:Jy;return i==null?this.styleTween(n,oge(n,t)).on("end.style."+n,zB(n)):typeof i=="function"?this.styleTween(n,age(n,t,Of(this,"style."+n,i))).each(sge(this._id,n)):this.styleTween(n,rge(n,t,i),e).on("end.style."+n,null)}function lge(n,i,e){return function(t){this.style.setProperty(n,i.call(this,t),e)}}function cge(n,i,e){var t,o;function r(){var a=i.apply(this,arguments);return a!==o&&(t=(o=a)&&lge(n,a,e)),t}return r._value=i,r}function $B(n,i,e){var t="style."+(n+="");if(arguments.length<2)return(t=this.tween(t))&&t._value;if(i==null)return this.tween(t,null);if(typeof i!="function")throw new Error;return this.tween(t,cge(n,i,e??""))}function dge(n){return function(){this.textContent=n}}function mge(n){return function(){var i=n(this);this.textContent=i??""}}function HB(n){return this.tween("text",typeof n=="function"?mge(Of(this,"text",n)):dge(n==null?"":n+""))}function pge(n){return function(i){this.textContent=n.call(this,i)}}function uge(n){var i,e;function t(){var o=n.apply(this,arguments);return o!==e&&(i=(e=o)&&pge(o)),i}return t._value=n,t}function UB(n){var i="text";if(arguments.length<1)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,uge(n))}function GB(){for(var n=this._name,i=this._id,e=eS(),t=this._groups,o=t.length,r=0;r<o;++r)for(var a=t[r],c=a.length,p,u=0;u<c;++u)if(p=a[u]){var h=Vr(p,i);Jm(p,n,e,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Ga(t,this._parents,n,e)}function WB(){var n,i,e=this,t=e._id,o=e.size();return new Promise(function(r,a){var c={value:a},p={value:function(){--o===0&&r()}};e.each(function(){var u=pa(this,t),h=u.on;h!==n&&(i=(n=h).copy(),i._.cancel.push(c),i._.interrupt.push(c),i._.end.push(p)),u.on=i}),o===0&&r()})}var hge=0;function Ga(n,i,e,t){this._groups=n,this._parents=i,this._name=e,this._id=t}function qB(n){return Pd().transition(n)}function eS(){return++hge}var Ld=Pd.prototype;Ga.prototype=qB.prototype={constructor:Ga,select:LB,selectAll:VB,selectChild:Ld.selectChild,selectChildren:Ld.selectChildren,filter:OB,merge:NB,selection:BB,transition:GB,call:Ld.call,nodes:Ld.nodes,node:Ld.node,size:Ld.size,empty:Ld.empty,each:Ld.each,on:FB,attr:TB,attrTween:EB,style:jB,styleTween:$B,text:HB,textTween:UB,remove:RB,tween:kB,delay:DB,duration:PB,ease:IB,easeVarying:AB,end:WB,[Symbol.iterator]:Ld[Symbol.iterator]};function tS(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var fge={time:null,delay:0,duration:250,ease:tS};function gge(n,i){for(var e;!(e=n.__transition)||!(e=e[i]);)if(!(n=n.parentNode))throw new Error(`transition ${i} not found`);return e}function QB(n){var i,e;n instanceof Ga?(i=n._id,n=n._name):(i=eS(),(e=fge).time=xv(),n=n==null?null:n+"");for(var t=this._groups,o=t.length,r=0;r<o;++r)for(var a=t[r],c=a.length,p,u=0;u<c;++u)(p=a[u])&&Jm(p,n,i,u,a,e||gge(p,i));return new Ga(t,this._parents,n,i)}Pd.prototype.interrupt=MB;Pd.prototype.transition=QB;var wv=n=>()=>n;function sA(n,{sourceEvent:i,target:e,transform:t,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:t,enumerable:!0,configurable:!0},_:{value:o}})}function Kl(n,i,e){this.k=n,this.x=i,this.y=e}Kl.prototype={constructor:Kl,scale:function(n){return n===1?this:new Kl(this.k*n,this.x,this.y)},translate:function(n,i){return n===0&i===0?this:new Kl(this.k,this.x+this.k*n,this.y+this.k*i)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Mv=new Kl(1,0,0);lA.prototype=Kl.prototype;function lA(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Mv;return n.__zoom}function nS(n){n.stopImmediatePropagation()}function Nf(n){n.preventDefault(),n.stopImmediatePropagation()}function _ge(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function vge(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function XB(){return this.__zoom||Mv}function Cge(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function bge(){return navigator.maxTouchPoints||"ontouchstart"in this}function xge(n,i,e){var t=n.invertX(i[0][0])-e[0][0],o=n.invertX(i[1][0])-e[1][0],r=n.invertY(i[0][1])-e[0][1],a=n.invertY(i[1][1])-e[1][1];return n.translate(o>t?(t+o)/2:Math.min(0,t)||Math.max(0,o),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function cA(){var n=_ge,i=vge,e=xge,t=Cge,o=bge,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,p=rA,u=bu("start","zoom","end"),h,_,S,x=500,b=150,M=0,w=10;function y(me){me.property("__zoom",XB).on("wheel.zoom",re,{passive:!1}).on("mousedown.zoom",oe).on("dblclick.zoom",G).filter(o).on("touchstart.zoom",$).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",be).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(me,De,he,B){var X=me.selection?me.selection():me;X.property("__zoom",XB),me!==X?N(me,De,he,B):X.interrupt().each(function(){P(this,arguments).event(B).start().zoom(null,typeof De=="function"?De.apply(this,arguments):De).end()})},y.scaleBy=function(me,De,he,B){y.scaleTo(me,function(){var X=this.__zoom.k,se=typeof De=="function"?De.apply(this,arguments):De;return X*se},he,B)},y.scaleTo=function(me,De,he,B){y.transform(me,function(){var X=i.apply(this,arguments),se=this.__zoom,ce=he==null?D(X):typeof he=="function"?he.apply(this,arguments):he,ke=se.invert(ce),ze=typeof De=="function"?De.apply(this,arguments):De;return e(I(E(se,ze),ce,ke),X,a)},he,B)},y.translateBy=function(me,De,he,B){y.transform(me,function(){return e(this.__zoom.translate(typeof De=="function"?De.apply(this,arguments):De,typeof he=="function"?he.apply(this,arguments):he),i.apply(this,arguments),a)},null,B)},y.translateTo=function(me,De,he,B,X){y.transform(me,function(){var se=i.apply(this,arguments),ce=this.__zoom,ke=B==null?D(se):typeof B=="function"?B.apply(this,arguments):B;return e(Mv.translate(ke[0],ke[1]).scale(ce.k).translate(typeof De=="function"?-De.apply(this,arguments):-De,typeof he=="function"?-he.apply(this,arguments):-he),se,a)},B,X)};function E(me,De){return De=Math.max(r[0],Math.min(r[1],De)),De===me.k?me:new Kl(De,me.x,me.y)}function I(me,De,he){var B=De[0]-he[0]*me.k,X=De[1]-he[1]*me.k;return B===me.x&&X===me.y?me:new Kl(me.k,B,X)}function D(me){return[(+me[0][0]+ +me[1][0])/2,(+me[0][1]+ +me[1][1])/2]}function N(me,De,he,B){me.on("start.zoom",function(){P(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(B).end()}).tween("zoom",function(){var X=this,se=arguments,ce=P(X,se).event(B),ke=i.apply(X,se),ze=he==null?D(ke):typeof he=="function"?he.apply(X,se):he,Ke=Math.max(ke[1][0]-ke[0][0],ke[1][1]-ke[0][1]),Qe=X.__zoom,ye=typeof De=="function"?De.apply(X,se):De,q=p(Qe.invert(ze).concat(Ke/Qe.k),ye.invert(ze).concat(Ke/ye.k));return function(Oe){if(Oe===1)Oe=ye;else{var We=q(Oe),ct=Ke/We[2];Oe=new Kl(ct,ze[0]-We[0]*ct,ze[1]-We[1]*ct)}ce.zoom(null,Oe)}})}function P(me,De,he){return!he&&me.__zooming||new L(me,De)}function L(me,De){this.that=me,this.args=De,this.active=0,this.sourceEvent=null,this.extent=i.apply(me,De),this.taps=0}L.prototype={event:function(me){return me&&(this.sourceEvent=me),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(me,De){return this.mouse&&me!=="mouse"&&(this.mouse[1]=De.invert(this.mouse[0])),this.touch0&&me!=="touch"&&(this.touch0[1]=De.invert(this.touch0[0])),this.touch1&&me!=="touch"&&(this.touch1[1]=De.invert(this.touch1[0])),this.that.__zoom=De,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(me){var De=Wt(this.that).datum();u.call(me,this.that,new sA(me,{sourceEvent:this.sourceEvent,target:y,type:me,transform:this.that.__zoom,dispatch:u}),De)}};function re(me,...De){if(!n.apply(this,arguments))return;var he=P(this,De).event(me),B=this.__zoom,X=Math.max(r[0],Math.min(r[1],B.k*Math.pow(2,t.apply(this,arguments)))),se=Zr(me);if(he.wheel)(he.mouse[0][0]!==se[0]||he.mouse[0][1]!==se[1])&&(he.mouse[1]=B.invert(he.mouse[0]=se)),clearTimeout(he.wheel);else{if(B.k===X)return;he.mouse=[se,B.invert(se)],ep(this),he.start()}Nf(me),he.wheel=setTimeout(ce,b),he.zoom("mouse",e(I(E(B,X),he.mouse[0],he.mouse[1]),he.extent,a));function ce(){he.wheel=null,he.end()}}function oe(me,...De){if(S||!n.apply(this,arguments))return;var he=me.currentTarget,B=P(this,De,!0).event(me),X=Wt(me.view).on("mousemove.zoom",ze,!0).on("mouseup.zoom",Ke,!0),se=Zr(me,he),ce=me.clientX,ke=me.clientY;cv(me.view),nS(me),B.mouse=[se,this.__zoom.invert(se)],ep(this),B.start();function ze(Qe){if(Nf(Qe),!B.moved){var ye=Qe.clientX-ce,q=Qe.clientY-ke;B.moved=ye*ye+q*q>M}B.event(Qe).zoom("mouse",e(I(B.that.__zoom,B.mouse[0]=Zr(Qe,he),B.mouse[1]),B.extent,a))}function Ke(Qe){X.on("mousemove.zoom mouseup.zoom",null),dv(Qe.view,B.moved),Nf(Qe),B.event(Qe).end()}}function G(me,...De){if(n.apply(this,arguments)){var he=this.__zoom,B=Zr(me.changedTouches?me.changedTouches[0]:me,this),X=he.invert(B),se=he.k*(me.shiftKey?.5:2),ce=e(I(E(he,se),B,X),i.apply(this,De),a);Nf(me),c>0?Wt(this).transition().duration(c).call(N,ce,B,me):Wt(this).call(y.transform,ce,B,me)}}function $(me,...De){if(n.apply(this,arguments)){var he=me.touches,B=he.length,X=P(this,De,me.changedTouches.length===B).event(me),se,ce,ke,ze;for(nS(me),ce=0;ce<B;++ce)ke=he[ce],ze=Zr(ke,this),ze=[ze,this.__zoom.invert(ze),ke.identifier],X.touch0?!X.touch1&&X.touch0[2]!==ze[2]&&(X.touch1=ze,X.taps=0):(X.touch0=ze,se=!0,X.taps=1+!!h);h&&(h=clearTimeout(h)),se&&(X.taps<2&&(_=ze[0],h=setTimeout(function(){h=null},x)),ep(this),X.start())}}function ue(me,...De){if(this.__zooming){var he=P(this,De).event(me),B=me.changedTouches,X=B.length,se,ce,ke,ze;for(Nf(me),se=0;se<X;++se)ce=B[se],ke=Zr(ce,this),he.touch0&&he.touch0[2]===ce.identifier?he.touch0[0]=ke:he.touch1&&he.touch1[2]===ce.identifier&&(he.touch1[0]=ke);if(ce=he.that.__zoom,he.touch1){var Ke=he.touch0[0],Qe=he.touch0[1],ye=he.touch1[0],q=he.touch1[1],Oe=(Oe=ye[0]-Ke[0])*Oe+(Oe=ye[1]-Ke[1])*Oe,We=(We=q[0]-Qe[0])*We+(We=q[1]-Qe[1])*We;ce=E(ce,Math.sqrt(Oe/We)),ke=[(Ke[0]+ye[0])/2,(Ke[1]+ye[1])/2],ze=[(Qe[0]+q[0])/2,(Qe[1]+q[1])/2]}else if(he.touch0)ke=he.touch0[0],ze=he.touch0[1];else return;he.zoom("touch",e(I(ce,ke,ze),he.extent,a))}}function be(me,...De){if(this.__zooming){var he=P(this,De).event(me),B=me.changedTouches,X=B.length,se,ce;for(nS(me),S&&clearTimeout(S),S=setTimeout(function(){S=null},x),se=0;se<X;++se)ce=B[se],he.touch0&&he.touch0[2]===ce.identifier?delete he.touch0:he.touch1&&he.touch1[2]===ce.identifier&&delete he.touch1;if(he.touch1&&!he.touch0&&(he.touch0=he.touch1,delete he.touch1),he.touch0)he.touch0[1]=this.__zoom.invert(he.touch0[0]);else if(he.end(),he.taps===2&&(ce=Zr(ce,this),Math.hypot(_[0]-ce[0],_[1]-ce[1])<w)){var ke=Wt(this).on("dblclick.zoom");ke&&ke.apply(this,arguments)}}}return y.wheelDelta=function(me){return arguments.length?(t=typeof me=="function"?me:wv(+me),y):t},y.filter=function(me){return arguments.length?(n=typeof me=="function"?me:wv(!!me),y):n},y.touchable=function(me){return arguments.length?(o=typeof me=="function"?me:wv(!!me),y):o},y.extent=function(me){return arguments.length?(i=typeof me=="function"?me:wv([[+me[0][0],+me[0][1]],[+me[1][0],+me[1][1]]]),y):i},y.scaleExtent=function(me){return arguments.length?(r[0]=+me[0],r[1]=+me[1],y):[r[0],r[1]]},y.translateExtent=function(me){return arguments.length?(a[0][0]=+me[0][0],a[1][0]=+me[1][0],a[0][1]=+me[0][1],a[1][1]=+me[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(me){return arguments.length?(e=me,y):e},y.duration=function(me){return arguments.length?(c=+me,y):c},y.interpolate=function(me){return arguments.length?(p=me,y):p},y.on=function(){var me=u.on.apply(u,arguments);return me===u?y:me},y.clickDistance=function(me){return arguments.length?(M=(me=+me)*me,y):Math.sqrt(M)},y.tapDistance=function(me){return arguments.length?(w=+me,y):w},y}var Ff=(()=>{class n{context;zoom;enabled=!1;needsDeactivate=!1;needsActivate=!1;constructor(e){this.context=e,this.zoom=cA().scaleExtent([1/2,8])}setEnabled(e){this.enabled!=e&&(e?this.needsActivate=!0:this.needsDeactivate=!0),this.enabled=e}draw(e,t){this.needsActivate&&(this.activate(e),this.needsActivate=!1),this.needsDeactivate&&(this.deactivate(e),this.needsDeactivate=!1)}activate(e){let t=this,o=function(r){let a=e.select("g.canvas"),c=r;a.attr("transform",()=>{t.context.transformation.x=c.transform.x,t.context.transformation.y=c.transform.y,t.context.transformation.k=c.transform.k;let p=t.context.getZeroZeroTransformationPoint().x+t.context.transformation.x,u=t.context.getZeroZeroTransformationPoint().y+t.context.transformation.y,h=t.context.transformation.k;return`translate(${p}, ${u}) scale(${h})`})};this.zoom.filter(r=>r.type==="mousedown"),this.zoom.on("zoom",o),e.call(this.zoom)}deactivate(e){e.on("mousedown.zoom",null),this.zoom.on("zoom",null)}static \u0275fac=function(t){return new(t||n)(ge(Eo))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var iS=class{x;y;width;height;constructor(i,e,t,o){this.x=i,this.y=e,this.width=t,this.height=o}};var Rf=(()=>{class n{selected=new He;static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var tp=(()=>{class n{context;selectionEventSource;static SELECTABLE_CLASS=".selectable";rectangleSelected=new He;contextMenuOpened=new ve;path;enabled=!1;constructor(e,t){this.context=e,this.selectionEventSource=t}disableContextMenu(){}setEnabled(e){this.enabled=e,this.contextMenuOpened.emit(!0)}activate(e){let t=this,o=e.node();e.on("mousedown",function(r){if(r.button==2){e.on("contextmenu",()=>{r.preventDefault()}),t.contextMenuOpened.emit(r);return}let a=Wt(window),c=t.transformation(Zr(r,o));t.startSelection(c),e.selectAll(n.SELECTABLE_CLASS).classed("selected",!1),a.on("mousemove.selection",function(p){let u=t.transformation(Zr(p,o));t.moveSelection(c,u)}).on("mouseup.selection",function(p){let u=t.transformation(Zr(p,o));t.endSelection(c,u),a.on("mousemove.selection",null).on("mouseup.selection",null)})})}deactivate(e){e.on("mousedown",null)}draw(e,t){let o=e.select("g.canvas");if(!o.select("g.selection-line-tool").node()){let c=o.append("g");c.attr("class","selection-line-tool"),this.path=c.append("path"),this.path.attr("class","selection").attr("visibility","hidden")}let r=o.select("g.selection-line-tool"),a=r.attr("status");a!=="activated"&&this.enabled&&(this.activate(e),r.attr("status","activated")),a!=="deactivated"&&!this.enabled&&(this.deactivate(e),r.attr("status","deactivated"))}startSelection(e){e[0]==null||e[1]==null||isNaN(e[0])||isNaN(e[1])||this.path.attr("d",this.rect(e[0],e[1],0,0)).attr("visibility","visible")}moveSelection(e,t){let o=this.context.transformation.k;if(!o||o===0||isNaN(o))return;let r=e[0]/o,a=e[1]/o;if(isNaN(r)||isNaN(a))return;let c=t[0]/o-r,p=t[1]/o-a;isNaN(c)||isNaN(p)||(this.path.attr("d",this.rect(r,a,c,p)),this.selectedEvent(e,t))}endSelection(e,t){this.path.attr("visibility","hidden"),this.selectedEvent(e,t)}selectedEvent(e,t){let o=Math.min(e[0],t[0]),r=Math.min(e[1],t[1]),a=Math.abs(e[0]-t[0]),c=Math.abs(e[1]-t[1]);this.selectionEventSource.selected.next(new iS(o,r,a,c))}rect(e,t,o,r){return"M"+[e,t]+" l"+[o,0]+" l"+[0,r]+" l"+[-o,0]+"z"}transformation(e){let t=this.context.getZeroZeroTransformationPoint();return[e[0]-t.x-this.context.transformation.x,e[1]-t.y-this.context.transformation.y]}static \u0275fac=function(t){return new(t||n)(ge(Eo),ge(Rf))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var{abs:Mdt,max:kdt,min:Tdt}=Math;function KB(n){return[+n[0],+n[1]]}function Mge(n){return[KB(n[0]),KB(n[1])]}var Edt={name:"x",handles:["w","e"].map(dA),input:function(n,i){return n==null?null:[[+n[0],i[0][1]],[+n[1],i[1][1]]]},output:function(n){return n&&[n[0][0],n[1][0]]}},Ddt={name:"y",handles:["n","s"].map(dA),input:function(n,i){return n==null?null:[[i[0][0],+n[0]],[i[1][0],+n[1]]]},output:function(n){return n&&[n[0][1],n[1][1]]}},Pdt={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(dA),input:function(n){return n==null?null:Mge(n)},output:function(n){return n}};function dA(n){return{type:n}}var mA=Math.PI,pA=2*mA,Mu=1e-6,kge=pA-Mu;function YB(n){this._+=n[0];for(let i=1,e=n.length;i<e;++i)this._+=arguments[i]+n[i]}function Tge(n){let i=Math.floor(n);if(!(i>=0))throw new Error(`invalid digits: ${n}`);if(i>15)return YB;let e=10**i;return function(t){this._+=t[0];for(let o=1,r=t.length;o<r;++o)this._+=Math.round(arguments[o]*e)/e+t[o]}}var ku=class{constructor(i){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=i==null?YB:Tge(i)}moveTo(i,e){this._append`M${this._x0=this._x1=+i},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(i,e){this._append`L${this._x1=+i},${this._y1=+e}`}quadraticCurveTo(i,e,t,o){this._append`Q${+i},${+e},${this._x1=+t},${this._y1=+o}`}bezierCurveTo(i,e,t,o,r,a){this._append`C${+i},${+e},${+t},${+o},${this._x1=+r},${this._y1=+a}`}arcTo(i,e,t,o,r){if(i=+i,e=+e,t=+t,o=+o,r=+r,r<0)throw new Error(`negative radius: ${r}`);let a=this._x1,c=this._y1,p=t-i,u=o-e,h=a-i,_=c-e,S=h*h+_*_;if(this._x1===null)this._append`M${this._x1=i},${this._y1=e}`;else if(S>Mu)if(!(Math.abs(_*p-u*h)>Mu)||!r)this._append`L${this._x1=i},${this._y1=e}`;else{let x=t-a,b=o-c,M=p*p+u*u,w=x*x+b*b,y=Math.sqrt(M),E=Math.sqrt(S),I=r*Math.tan((mA-Math.acos((M+S-w)/(2*y*E)))/2),D=I/E,N=I/y;Math.abs(D-1)>Mu&&this._append`L${i+D*h},${e+D*_}`,this._append`A${r},${r},0,0,${+(_*x>h*b)},${this._x1=i+N*p},${this._y1=e+N*u}`}}arc(i,e,t,o,r,a){if(i=+i,e=+e,t=+t,a=!!a,t<0)throw new Error(`negative radius: ${t}`);let c=t*Math.cos(o),p=t*Math.sin(o),u=i+c,h=e+p,_=1^a,S=a?o-r:r-o;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Mu||Math.abs(this._y1-h)>Mu)&&this._append`L${u},${h}`,t&&(S<0&&(S=S%pA+pA),S>kge?this._append`A${t},${t},0,1,${_},${i-c},${e-p}A${t},${t},0,1,${_},${this._x1=u},${this._y1=h}`:S>Mu&&this._append`A${t},${t},0,${+(S>=mA)},${_},${this._x1=i+t*Math.cos(r)},${this._y1=e+t*Math.sin(r)}`)}rect(i,e,t,o){this._append`M${this._x0=this._x1=+i},${this._y0=this._y1=+e}h${t=+t}v${+o}h${-t}Z`}toString(){return this._}};function np(){return new ku}np.prototype=ku.prototype;function Tu(n){return function(){return n}}var uA=1e-12,ZB=Math.PI,Hdt=ZB/2,Udt=2*ZB;function JB(n){let i=3;return n.digits=function(e){if(!arguments.length)return i;if(e==null)i=null;else{let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);i=t}return n},()=>new ku(i)}var Qdt=Array.prototype.slice;function ez(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function tz(n){this._context=n}tz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,i){switch(n=+n,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 1:this._point=2;default:this._context.lineTo(n,i);break}}};function nz(n){return new tz(n)}function iz(n){return n[0]}function oz(n){return n[1]}function Eu(n,i){var e=Tu(!0),t=null,o=nz,r=null,a=JB(c);n=typeof n=="function"?n:n===void 0?iz:Tu(n),i=typeof i=="function"?i:i===void 0?oz:Tu(i);function c(p){var u,h=(p=ez(p)).length,_,S=!1,x;for(t==null&&(r=o(x=a())),u=0;u<=h;++u)!(u<h&&e(_=p[u],u,p))===S&&((S=!S)?r.lineStart():r.lineEnd()),S&&r.point(+n(_,u,p),+i(_,u,p));if(x)return r=null,x+""||null}return c.x=function(p){return arguments.length?(n=typeof p=="function"?p:Tu(+p),c):n},c.y=function(p){return arguments.length?(i=typeof p=="function"?p:Tu(+p),c):i},c.defined=function(p){return arguments.length?(e=typeof p=="function"?p:Tu(!!p),c):e},c.curve=function(p){return arguments.length?(o=p,t!=null&&(r=o(t)),c):o},c.context=function(p){return arguments.length?(p==null?t=r=null:r=o(t=p),c):t},c}function rz(n,i,e){n._context.bezierCurveTo((2*n._x0+n._x1)/3,(2*n._y0+n._y1)/3,(n._x0+2*n._x1)/3,(n._y0+2*n._y1)/3,(n._x0+4*n._x1+i)/6,(n._y0+4*n._y1+e)/6)}function az(n){this._context=n}az.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:rz(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,i){switch(n=+n,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:rz(this,n,i);break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i}};function kv(n){return new az(n)}function sz(n,i,e){n._context.bezierCurveTo(n._x1+n._k*(n._x2-n._x0),n._y1+n._k*(n._y2-n._y0),n._x2+n._k*(n._x1-i),n._y2+n._k*(n._y1-e),n._x2,n._y2)}function oS(n,i){this._context=n,this._k=(1-i)/6}oS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:sz(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,i){switch(n=+n,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 1:this._point=2,this._x1=n,this._y1=i;break;case 2:this._point=3;default:sz(this,n,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=n,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var rmt=(function n(i){function e(t){return new oS(t,i)}return e.tension=function(t){return n(+t)},e})(0);function Ege(n,i,e){var t=n._x1,o=n._y1,r=n._x2,a=n._y2;if(n._l01_a>uA){var c=2*n._l01_2a+3*n._l01_a*n._l12_a+n._l12_2a,p=3*n._l01_a*(n._l01_a+n._l12_a);t=(t*c-n._x0*n._l12_2a+n._x2*n._l01_2a)/p,o=(o*c-n._y0*n._l12_2a+n._y2*n._l01_2a)/p}if(n._l23_a>uA){var u=2*n._l23_2a+3*n._l23_a*n._l12_a+n._l12_2a,h=3*n._l23_a*(n._l23_a+n._l12_a);r=(r*u+n._x1*n._l23_2a-i*n._l12_2a)/h,a=(a*u+n._y1*n._l23_2a-e*n._l12_2a)/h}n._context.bezierCurveTo(t,o,r,a,n._x2,n._y2)}function lz(n,i){this._context=n,this._alpha=i}lz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,i){if(n=+n,i=+i,this._point){var e=this._x2-n,t=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+t*t,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Ege(this,n,i);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=n,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Du=(function n(i){function e(t){return i?new lz(t,i):new oS(t,0)}return e.alpha=function(t){return n(+t)},e})(.5);function cz(n){return n<0?-1:1}function dz(n,i,e){var t=n._x1-n._x0,o=i-n._x1,r=(n._y1-n._y0)/(t||o<0&&-0),a=(e-n._y1)/(o||t<0&&-0),c=(r*o+a*t)/(t+o);return(cz(r)+cz(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(c))||0}function mz(n,i){var e=n._x1-n._x0;return e?(3*(n._y1-n._y0)/e-i)/2:i}function hA(n,i,e){var t=n._x0,o=n._y0,r=n._x1,a=n._y1,c=(r-t)/3;n._context.bezierCurveTo(t+c,o+c*i,r-c,a-c*e,r,a)}function rS(n){this._context=n}rS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:hA(this,this._t0,mz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,i){var e=NaN;if(n=+n,i=+i,!(n===this._x1&&i===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 1:this._point=2;break;case 2:this._point=3,hA(this,mz(this,e=dz(this,n,i)),e);break;default:hA(this,this._t0,e=dz(this,n,i));break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e}}};function Dge(n){this._context=new pz(n)}(Dge.prototype=Object.create(rS.prototype)).point=function(n,i){rS.prototype.point.call(this,i,n)};function pz(n){this._context=n}pz.prototype={moveTo:function(n,i){this._context.moveTo(i,n)},closePath:function(){this._context.closePath()},lineTo:function(n,i){this._context.lineTo(i,n)},bezierCurveTo:function(n,i,e,t,o,r){this._context.bezierCurveTo(i,n,t,e,r,o)}};function Tv(n){return new rS(n)}var ua=class{height;width;stroke;stroke_width;stroke_dasharray;points;curve_type;arrow_start;arrow_end};var Ev=class{x;y;dx;dy},fA=class extends Ev{datum;constructor(i){super(),this.datum=i}},gA=class extends Ev{datum;constructor(i){super(),this.datum=i}},_A=class extends Ev{datum;constructor(i){super(),this.datum=i}},Qc=class{start=new ve;drag=new ve;end=new ve;call(i){i.call(this.behaviour())}behaviour(){let i;return fs().on("start",e=>{i=new fA(e.subject),i.dx=e.dx,i.dy=e.dy,i.x=e.x,i.y=e.y,this.start.emit(i)}).on("drag",e=>{let t=new gA(e.subject);t.dx=e.dx,t.dy=e.dy,this.drag.emit(t)}).on("end",e=>{let t=new _A(e.subject);t.dx=e.x-i.x,t.dy=e.y-i.y,this.end.emit(t)})}};var vA=class{datum;dx;dy;constructor(i,e,t){this.datum=i,this.dx=e,this.dy=t}},Pu=class extends vA{},aS=class{datum;x;y;width;height;rotation;constructor(i,e,t,o,r,a){this.datum=i,this.x=e,this.y=t,this.width=o,this.height=r,this.rotation=a}},sS=class{x;y;constructor(i,e){this.x=i,this.y=e}},lS=class{datum;x;y;constructor(i,e,t){this.datum=i,this.x=e,this.y=t}},cS=class{savedText;x;y;constructor(i,e,t){this.savedText=i,this.x=e,this.y=t}},dS=class{textDrawingId;editedText;textElement;constructor(i,e,t){this.textDrawingId=i,this.editedText=e,this.textElement=t}},mS=class{event;drawing;constructor(i,e){this.event=i,this.drawing=e}},Yl=class{event;link;constructor(i,e){this.event=i,this.link=e}},pS=class{event;interfaceLabel;constructor(i,e){this.event=i,this.interfaceLabel=e}},uS=class{event;label;constructor(i,e){this.event=i,this.label=e}};var CA=class{event;node;constructor(i,e){this.event=i,this.node=e}};var Dv=class extends CA{};var Ho=(()=>{class n{selection={};selected=new ve;unselected=new ve;setSelected(e){let t=this.convertToKeyDict(e),o=Object.keys(t).filter(a=>!this.isSelectedByKey(a)).map(a=>t[a]),r=Object.keys(this.selection).filter(a=>!(a in t)).map(a=>this.selection[a]);this.selection=t,o.length>0&&this.selected.emit(o),r.length>0&&this.unselected.emit(r)}getSelected(){return Object.keys(this.selection).map(e=>this.selection[e])}isSelected(e){let t=this.getKey(e);return this.isSelectedByKey(t)}isSelectedByKey(e){return e in this.selection}getKey(e){return`${e.constructor.name}-${e.id}`}convertToKeyDict(e){let t={};return e.forEach(o=>{t[this.getKey(o)]=o}),t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ip=(()=>{class n{cssFixer;fontFixer;selectionManager;mapSettings;onContextMenu=new ve;draggable=new Qc;static NODE_LABEL_MARGIN=3;constructor(e,t,o,r){this.cssFixer=e,this.fontFixer=t,this.selectionManager=o,this.mapSettings=r}redrawLabel(e,t){this.drawLabel(this.selectLabel(e,t))}draw(e){let t=this,o=e.selectAll("g.label_container").data(c=>[c.label]),r=o.enter().append("g").attr("class","label_container").attr("label_id",c=>c.id),a=o.merge(r).on("contextmenu",function(c,p){c.preventDefault(),t.onContextMenu.emit(new uS(c,p))});this.drawLabel(a),o.exit().remove(),this.mapSettings.isReadOnly||this.draggable.call(o)}removeInlineFillColor(e){return e.replace(/fill:\s*[^;]+;?/gi,"")}drawLabel(e){let t=e.selectAll("g.label_body").data(a=>[a]),o=t.enter().append("g").attr("class","label_body");o.append("text").attr("class","label"),o.append("rect").attr("class","label_selection");let r=t.merge(o);r.select("text.label").attr("label_id",a=>a.id).attr("style",a=>{let c=this.cssFixer.fix(a.style);return c=this.fontFixer.fixStyles(c),c=this.removeInlineFillColor(c),c}).text(a=>a.text).attr("x",a=>a.x).attr("y",a=>a.y).attr("transform",a=>`rotate(${a.rotation}, ${a.x}, ${a.y})`),r.select("rect.label_selection").attr("visibility",a=>this.selectionManager.isSelected(a)?"visible":"hidden").attr("stroke","black").attr("stroke-dasharray","3,3").attr("stroke-width","0.5").attr("fill","none").each(function(a){let c=Wt(this),u=r.select(`text[label_id="${a.id}"]`).node().getBBox(),h=2;c.attr("width",u.width+h*2),c.attr("height",u.height+h*2),c.attr("x",u.x-h),c.attr("y",u.y-h),c.attr("transform",`rotate(${a.rotation}, ${a.x}, ${a.y})`)})}selectLabel(e,t){return e.selectAll(`g.label_container[label_id="${t.id}"]`)}static \u0275fac=function(t){return new(t||n)(ge(xl),ge(ta),ge(Ho),ge(Sl))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Ml=(()=>{class n{dragged=new ve;labelDragged=new ve;clicked=new ve;static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Oge="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z",Nge="M18 8h-8V6c0-1.1.9-2 2-2s2 .9 2 2h2c0-2.21-1.79-4-4-4S8 3.79 8 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2z",Fge="var(--gns3-lock-badge-locked-color)",Rge="var(--gns3-lock-badge-unlocked-color)",bA="var(--gns3-lock-badge-outline-color)",Vf=(()=>{class n{selectionManager;labelWidget;nodesEventSource;mapSettingsService;onContextMenu=new ve;onContextConsoleMenu=new ve;onNodeClicked=new ve;constructor(e,t,o,r){this.selectionManager=e,this.labelWidget=t,this.nodesEventSource=o,this.mapSettingsService=r}draw(e){let t=this,o=e.selectAll("g.node_body").data(c=>[c]),r=o.enter().append("g").attr("class","node_body");r.append("image");let a=o.merge(r).classed("selected",c=>this.selectionManager.isSelected(c)).classed("locked",c=>c.locked).on("click",(c,p)=>{this.nodesEventSource.clicked.emit(new lS(p,c.pageX,c.pageY))});if(a.select(".layer_label_wrapper").remove(),this.mapSettingsService.isLayerNumberVisible&&a.append("rect").attr("class","layer_label_wrapper").attr("width","26").attr("height","26").attr("x",c=>c.width/2-13).attr("y",c=>c.height/2-13).attr("fill","red"),a.select(".layer_label").remove(),this.mapSettingsService.isLayerNumberVisible&&a.append("text").attr("class","layer_label").text(c=>c.z).attr("x",function(c){return c.z>=100?c.width/2-13:c.z>=10?c.width/2-9:c.width/2-5}).attr("y",c=>c.height/2+5).attr("style",()=>{let c=[];return c.push('font-family: "Noto Sans"'),c.push("font-size: 11pt"),c.push("font-weight: bold"),c.join("; ")}).attr("fill","#ffffff"),a.select(".node_lock_status_badge").remove(),this.mapSettingsService.isItemLockStatusVisible){let c=a.append("g").attr("class","node_lock_status_badge").attr("pointer-events","none").attr("transform",_=>{let S=_.width>0?_.width:60,x=_.height>0?_.height:60;if(_.nodeType==="cloud"||_.nodeType==="nat"||_.symbol&&(_.symbol.toLowerCase().includes("nat")||_.symbol.toLowerCase().includes("cloud"))){let M=S/2+(S/2-12)/Math.SQRT2,w=x/2-(x/2-12)/Math.SQRT2;return`translate(${M}, ${w})`}return`translate(${S*.8}, ${x*.2})`});c.filter(_=>_.locked).append("path").attr("d",Oge).attr("transform","translate(-7.68, -7.68) scale(0.64)").attr("fill",Fge).attr("stroke",bA).attr("stroke-width",1.2).attr("stroke-linejoin","round").attr("paint-order","stroke fill");let h=c.filter(_=>!_.locked).append("g").attr("transform","translate(-7.68, -7.68) scale(0.64)");h.append("path").attr("d",Nge).attr("fill",Rge).attr("stroke",bA).attr("stroke-width",1.2).attr("stroke-linejoin","round").attr("paint-order","stroke fill"),h.append("circle").attr("cx",12).attr("cy",15).attr("r",2).attr("fill",bA)}a.select("image").on("contextmenu",function(c,p){c.preventDefault(),t.onContextMenu.emit(new Dv(c,p))}).on("dblclick",function(c,p){c.preventDefault(),t.onContextConsoleMenu.emit(new Dv(c,p))}).each(function(c){this.getAttribute("href")!==c.symbolUrl&&(this.removeAttribute("href"),this.getClientRects(),this.setAttribute("href",c.symbolUrl))}).attr("width",c=>c.width?c.width:60).attr("height",c=>c.height?c.height:60).attr("x",c=>0).attr("y",c=>0).on("mouseover",function(c){Wt(this).attr("class","over")}).on("mouseout",function(c){Wt(this).attr("class","")}),a.attr("transform",c=>c.width?`translate(${c.x},${c.y})`:`translate(${c.x-30},${c.y-30})`),this.labelWidget.draw(a)}static \u0275fac=function(t){return new(t||n)(ge(Ho),ge(ip),ge(Ml),ge(go))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var op=(()=>{class n{nodeWidget;mapSettings;static NODE_LABEL_MARGIN=3;draggable=new Qc;constructor(e,t){this.nodeWidget=e,this.mapSettings=t}redrawNode(e,t){this.nodeWidget.draw(this.selectNode(e,t))}updateNodePosition(e,t){this.selectNode(e,t).select("g.node_body").attr("transform",()=>t.width?`translate(${t.x},${t.y})`:`translate(${t.x-30},${t.y-30})`)}draw(e){let t=e.selectAll("g.node").data(a=>a.nodes?a.nodes:[],a=>a.id),o=t.enter().append("g").attr("class","node").attr("node_id",a=>a.id),r=t.merge(o);this.nodeWidget.draw(r),t.exit().remove(),this.mapSettings.isReadOnly||this.draggable.call(r)}selectNode(e,t){return e.selectAll(`g.node[node_id="${t.id}"]`)}static \u0275fac=function(t){return new(t||n)(ge(Vf),ge(Sl))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var hS=class{points};var Bf=(()=>{class n{drawingLine=new hS;selection;drawing=!1;data={};start(e,t,o){let r=this;this.drawing=!0,this.data=o,this.drawingLine.points=[new zm(e,t)];let a=function(p,u){let h=r.selection.select("g.canvas").node(),_=Zr(p,h);r.drawing&&(r.drawingLine.points=[r.drawingLine.points[0],new zm(_[0],_[1])]),r.draw(null,null)},c=function(p,u){p.key==="Escape"&&r.cancel()};this.selection.on("mousemove",a),this.selection.on("keydown",c),this.draw(null,null)}isDrawing(){return this.drawing}cancel(){this.drawing=!1,this.drawingLine.points=[],this.selection.on("mousemove",null),this.selection.on("keydown",null),this.draw(null,null)}stop(){return this.drawing=!1,this.selection.on("mousemove",null),this.selection.on("keydown",null),this.draw(null,null),this.data}connect(e,t){this.selection=e}draw(e,t){let o=this.selection.select("g.canvas");o.select("g.drawing-line-tool").node()||o.append("g").attr("class","drawing-line-tool");let r=this.selection.select("g.drawing-line-tool"),a=[];this.drawing&&this.drawingLine.points.length>0&&(a=[this.drawingLine.points.map(h=>[h.x,h.y])]);let c=Eu(),p=r.selectAll("path").data(a);p.exit().remove();let u=p.enter().append("path");p.merge(u).attr("d",c).attr("stroke","#000").attr("stroke-width","2").attr("fill","none")}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Yt=(()=>{class n{static DEFAULT_LINK_TYPE="straight";static BEZIER_CURVINESS_DEFAULT=150;static BEZIER_CURVINESS_MIN=-2500;static BEZIER_CURVINESS_MAX=2500;static BEZIER_CURVINESS_STEP=1;static STATE_MACHINE_CURVINESS_DEFAULT=0;static STATE_MACHINE_CURVINESS_MIN=-2500;static STATE_MACHINE_CURVINESS_MAX=2500;static STATE_MACHINE_CURVINESS_STEP=1;static STATE_MACHINE_ZERO_CURVE_OFFSET=10;static STATE_MACHINE_TRANSLATE_Y=3;static FLOWCHART_ROUNDNESS_DEFAULT=0;static FLOWCHART_ROUNDNESS_MIN=-250;static FLOWCHART_ROUNDNESS_MAX=250;static FLOWCHART_ROUNDNESS_STEP=1;static getLinkStyle(e){return e.type==2?"10, 10":e.type==3?`${e.width}, ${e.width}`:e.type==4?`20, 10, ${e.width}, 10`:e.type==5?`20, 10, ${e.width}, ${e.width}, ${e.width}, 10`:"0, 0"}static normalizeLinkType(e){let t=(e||"").toLowerCase().replace(/[\s_-]/g,"");return t==="bezier"?"bezier":t==="flowchart"?"flowchart":t==="statemachine"?"statemachine":t==="freeform"?"freeform":n.DEFAULT_LINK_TYPE}static getLinkPath(e,t,o,r){let a=n.normalizeLinkType(o?.link_type);if(a==="bezier"){let c=typeof r?.bezierVariation=="number"&&!Number.isNaN(r.bezierVariation)?r.bezierVariation:0,p=n.getEffectiveBezierMajorAnchor(o?.bezier_curviness,c);return n.getJsPlumbBezierPath(e,t,p,r?.sourceOrientation,r?.targetOrientation)}if(a==="flowchart"){let c=n.normalizeFlowchartRoundness(o?.flowchart_roundness);return n.getFlowchartPath(e,t,c,r?.flowchartDistance)}if(a==="statemachine"){let c=n.normalizeStateMachineCurviness(o?.bezier_curviness);return n.getStateMachinePath(e,t,c)}return n.getStraightPath(e,t)}static getFreeformBezierPath(e,t,o,r,a){let c=np();if(c.moveTo(e[0],e[1]),a){let p=2*a[0]-.5*(e[0]+t[0]),u=2*a[1]-.5*(e[1]+t[1]);c.quadraticCurveTo(p,u,t[0],t[1])}else c.lineTo(t[0],t[1]);return c.toString()}static getLinkTransform(e){return n.normalizeLinkType(e?.link_type)==="statemachine"?`translate(0,${n.STATE_MACHINE_TRANSLATE_Y})`:null}static normalizeBezierCurviness(e){let t=typeof e=="number"&&!Number.isNaN(e)?e:n.BEZIER_CURVINESS_DEFAULT,o=Math.round(t/n.BEZIER_CURVINESS_STEP)*n.BEZIER_CURVINESS_STEP;return Math.max(n.BEZIER_CURVINESS_MIN,Math.min(n.BEZIER_CURVINESS_MAX,o))}static getEffectiveBezierMajorAnchor(e,t=0){let o=n.normalizeBezierCurviness(e),r=typeof t=="number"&&!Number.isNaN(t)?t:0;return-o+r}static normalizeFlowchartRoundness(e){let t=typeof e=="number"&&!Number.isNaN(e)?e:n.FLOWCHART_ROUNDNESS_DEFAULT,o=Math.round(t/n.FLOWCHART_ROUNDNESS_STEP)*n.FLOWCHART_ROUNDNESS_STEP;return Math.max(n.FLOWCHART_ROUNDNESS_MIN,Math.min(n.FLOWCHART_ROUNDNESS_MAX,o))}static normalizeStateMachineCurviness(e){let t=typeof e=="number"&&!Number.isNaN(e)?e:n.STATE_MACHINE_CURVINESS_DEFAULT,o=Math.round(t/n.STATE_MACHINE_CURVINESS_STEP)*n.STATE_MACHINE_CURVINESS_STEP;return Math.max(n.STATE_MACHINE_CURVINESS_MIN,Math.min(n.STATE_MACHINE_CURVINESS_MAX,o))}static getContinuousOrientation(e,t){let o=t[0]-e[0],r=t[1]-e[1];return Math.abs(o)>=Math.abs(r)?[o>=0?1:-1,0]:[0,r>=0?1:-1]}static getBezierControlPoints(e,t,o,r,a){let c=n.sanitizeOrientation(r||n.getContinuousOrientation(e,t)),p=n.sanitizeOrientation(a||n.getContinuousOrientation(t,e)),u=n.findBezierControlPoint(e,e,t,c,p,o),h=n.findBezierControlPoint(t,t,e,p,c,o);return{sourceControlPoint:u,targetControlPoint:h,sourceOrientation:c,targetOrientation:p}}static getBezierSideSign(e,t,o,r,a){let{sourceControlPoint:c}=n.getBezierControlPoints(e,t,o,r,a),p=t[0]-e[0],u=t[1]-e[1],h=c[0]-e[0],_=c[1]-e[1],S=p*_-u*h;return Math.abs(S)<1e-4||S>0?1:-1}static getStraightPath(e,t){let o=np();return o.moveTo(e[0],e[1]),o.lineTo(t[0],t[1]),o.toString()}static getFlowchartPath(e,t,o,r=0){let a=t[0]-e[0],c=t[1]-e[1],p=Math.abs(a),u=Math.abs(c),h=Math.abs(a)>=Math.abs(c),_=6,S=Math.hypot(a,c)||1,x=typeof r=="number"&&!Number.isNaN(r)?r:0,b=-c/S*x,M=a/S*x;if(p<=_||u<=_)return n.getStraightPath(e,t);let w=[[e[0],e[1]]];if(h){let y=(b<0?-1:1)*Math.abs(M),E=e[0]+a/2+(y-b);w.push([E,e[1]]),w.push([E,t[1]])}else{let y=(M<0?-1:1)*Math.abs(b),E=e[1]+c/2+(y-M);w.push([e[0],E]),w.push([t[0],E])}return w.push([t[0],t[1]]),n.getRoundedPolylinePath(w,Math.abs(o))}static getRoundedPolylinePath(e,t){let o=np(),r=e.filter((p,u,h)=>{if(u===0)return!0;let _=h[u-1];return p[0]!==_[0]||p[1]!==_[1]});if(r.length===0)return"";if(o.moveTo(r[0][0],r[0][1]),r.length===1)return o.toString();if(t<=0){for(let p=1;p<r.length;p++){let u=r[p];o.lineTo(u[0],u[1])}return o.toString()}let a=1e-4;for(let p=1;p<r.length-1;p++){let u=r[p-1],h=r[p],_=r[p+1],S=h[0]-u[0],x=h[1]-u[1],b=_[0]-h[0],M=_[1]-h[1],w=Math.sqrt(S*S+x*x),y=Math.sqrt(b*b+M*M);if(w<a||y<a){o.lineTo(h[0],h[1]);continue}let E=S/w,I=x/w,D=b/y,N=M/y,P=E*N-I*D;if(Math.abs(P)<a){o.lineTo(h[0],h[1]);continue}let L=Math.min(t,w/2,y/2);if(L<a){o.lineTo(h[0],h[1]);continue}let re=[h[0]-E*L,h[1]-I*L],oe=[h[0]+D*L,h[1]+N*L];o.lineTo(re[0],re[1]),o.quadraticCurveTo(h[0],h[1],oe[0],oe[1])}let c=r[r.length-1];return o.lineTo(c[0],c[1]),o.toString()}static getStateMachinePath(e,t,o){let r=np(),a=(e[0]+t[0])/2,c=(e[1]+t[1])/2,p=n.getContinuousOrientation(e,t),u=-p[1],h=p[0],_=o+n.STATE_MACHINE_ZERO_CURVE_OFFSET,S=[a+u*_,c+h*_];return r.moveTo(e[0],e[1]),r.bezierCurveTo(S[0],S[1],S[0],S[1],t[0],t[1]),r.toString()}static getJsPlumbBezierPath(e,t,o,r,a){let{sourceControlPoint:c,targetControlPoint:p}=n.getBezierControlPoints(e,t,o,r,a),u=np();return u.moveTo(e[0],e[1]),u.bezierCurveTo(c[0],c[1],p[0],p[1],t[0],t[1]),u.toString()}static sanitizeOrientation(e){let t=o=>o>0?1:o<0?-1:0;return[t(e[0]),t(e[1])]}static findBezierControlPoint(e,t,o,r,a,c){let u=r[0]!==a[0]||r[1]===a[1],h=[0,0];return u?(a[0]===0?h[0]=o[0]<t[0]?e[0]+10:e[0]-10:h[0]=e[0]+c*a[0],a[1]===0?h[1]=o[1]<t[1]?e[1]+10:e[1]-10:h[1]=e[1]+c*r[1]):(r[0]===0?h[0]=t[0]<o[0]?e[0]+10:e[0]-10:h[0]=e[0]-c*r[0],r[1]===0?h[1]=t[1]<o[1]?e[1]+10:e[1]-10:h[1]=e[1]+c*a[1]),h}}return n})();var Xc=(()=>{class n{cssFixer;fontFixer;selectionManager;mapSettings;themeService=f(ci);onContextMenu=new ve;draggable=new Qc;static SURROUNDING_TEXT_BORDER=5;enabled=!0;constructor(e,t,o,r){this.cssFixer=e,this.fontFixer=t,this.selectionManager=o,this.mapSettings=r}applyThemeLabelColor(e){let t=this.themeService.getCanvasLabelColor();return e.replace(/fill:\s*[^;]+;?/gi,`fill: ${t};`)}getRenderedLabelX(e){let t=this.selectionManager.isSelected(e)?0:e.bezierRenderOffsetX||0;return e.label.x+t}getRenderedLabelY(e){let t=this.selectionManager.isSelected(e)?0:e.bezierRenderOffsetY||0;return e.label.y+t}setEnabled(e){this.enabled=e}draw(e){let t=this,o=e.selectAll("g.link_node_position").data(h=>{let _=h.link_style?.type===0;return[[h.source,h.nodes[0],_],[h.target,h.nodes[1],_]]}),r=o.enter().append("g").classed("link_node_position",!0),a=o.merge(r);a.attr("transform",h=>`translate(${h[0].x}, ${h[0].y})`).classed("link-hidden",h=>h[2]);let c=a.selectAll("g.interface_label_container").data(h=>this.enabled?[h[1]]:[]),p=c.enter().append("g").classed("interface_label_container",!0);p.append("rect").attr("class","interface_label_selection"),p.append("text").attr("class","interface_label noselect").attr("interface_label_id",h=>`${h.id}`);let u=c.merge(p).on("contextmenu",function(h,_){h.preventDefault(),t.onContextMenu.emit(new pS(h,_))});u.select("text.interface_label").text(h=>h.label.text).attr("style",h=>{let _=this.cssFixer.fix(h.label.style);return _=this.fontFixer.fixStyles(_),_=this.applyThemeLabelColor(_),_}).attr("x",h=>this.getRenderedLabelX(h)).attr("y",h=>this.getRenderedLabelY(h)).attr("transform",h=>{let _=this.getRenderedLabelX(h),S=this.getRenderedLabelY(h);return`rotate(${h.label.rotation}, ${_}, ${S})`}),u.select("rect.interface_label_selection").attr("visibility",h=>this.selectionManager.isSelected(h)?"visible":"hidden").attr("stroke","black").attr("stroke-dasharray","3,3").attr("stroke-width","0.5").attr("fill","none").each(function(h){let _=Wt(this),x=u.select(`text[interface_label_id="${h.id}"]`).node().getBBox(),b=2;_.attr("width",x.width+b*2),_.attr("height",x.height+b*2),_.attr("x",x.x-b),_.attr("y",x.y-b),_.attr("transform",`rotate(${h.label.rotation}, ${x.x-b}, ${x.y-b})`)}),c.exit().remove(),this.mapSettings.isReadOnly||this.draggable.call(u)}static \u0275fac=function(t){return new(t||n)(ge(xl),ge(ta),ge(Ho),ge(Sl))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Pv=class{x;y;status;port;constructor(i,e,t,o){this.x=i,this.y=e,this.status=t,this.port=o}};var fS=(()=>{class n{mapSettingsService;static MAX_INLINE_LABELS_PARALLEL_LINKS=4;static LABEL_DISTANCE=60;static MIN_LINK_LENGTH_FOR_LABELS=180;static LABEL_HEIGHT=18;static LABEL_MIN_WIDTH=34;static LABEL_HORIZONTAL_PADDING=2;static LABEL_RADIUS=8;static LABEL_STROKE_WIDTH=3;static LABEL_FONT_SIZE=10;static LABEL_FONT_FAMILY='"Noto Sans", "DejaVu Sans", "Segoe UI", sans-serif';static LABEL_BACKGROUND_COLOR="#E2E8FF";constructor(e){this.mapSettingsService=e}draw(e){let t=this;e.each(function(o){o.isMultiplied=(o.parallelLinksCount||1)>1;let r=Wt(this),a=r.select("path"),c=t.mapSettingsService.showInterfaceLabels,p=o.link_style?.type===0,u=c&&t.mapSettingsService.integrateLinkLabelsToLinks,h=c&&t.shouldRenderTooltipOnly(o),_=[],S=a.node();if(S){let x=S.getTotalLength();if(o.source&&o.target&&(h||x>n.MIN_LINK_LENGTH_FOR_LABELS)){let b=h?Math.min(n.LABEL_DISTANCE,x/4):n.LABEL_DISTANCE,M=S.getPointAtLength(b),w=S.getPointAtLength(x-b),y=o.nodes?.find(I=>I.nodeId===o.source.id)?.label?.text||"",E=o.nodes?.find(I=>I.nodeId===o.target.id)?.label?.text||"";_=[new Pv(M.x,M.y,o.suspend?"suspended":o.source.status,y),new Pv(w.x,w.y,o.suspend?"suspended":o.target.status,E)]}}if(t.renderEndpointHoverTooltips(r,_,h),t.bindEndpointTooltipHover(a,r,h),r.selectAll("circle.status_started").remove(),r.selectAll("circle.status_stopped").remove(),r.selectAll("circle.status_suspended").remove(),r.selectAll("rect.status_started").remove(),r.selectAll("text.status_started_label").remove(),r.selectAll("rect.status_stopped").remove(),r.selectAll("text.status_stopped_label").remove(),r.selectAll("rect.status_suspended").remove(),r.selectAll("text.status_suspended_label").remove(),u&&!h){let x=r.selectAll("g.status_label").data(_),b=x.enter().append("g").attr("class","status_label"),M=x.merge(b).attr("transform",E=>`translate(${E.x}, ${E.y})`).classed("link-hidden",()=>p),w=M.selectAll("rect").data(E=>[E]);w.enter().append("rect").merge(w).attr("class",E=>`status_${E.status}`).attr("width",E=>t.getLabelWidth(E.port)).attr("height",n.LABEL_HEIGHT).attr("x",E=>-(t.getLabelWidth(E.port)/2)).attr("y",-n.LABEL_HEIGHT/2).attr("rx",n.LABEL_RADIUS).attr("ry",n.LABEL_RADIUS).style("fill",n.LABEL_BACKGROUND_COLOR).style("fill-opacity",1).attr("stroke",E=>t.getStatusStrokeColor(E.status)).attr("stroke-width",n.LABEL_STROKE_WIDTH),w.exit().remove();let y=M.selectAll("text").data(E=>[E]);y.enter().append("text").merge(y).attr("class",E=>`status_${E.status}_label`).text(E=>E.port||"").attr("x",0).attr("y",0).attr("dy","0em").attr("text-anchor","middle").attr("dominant-baseline","central").attr("alignment-baseline","central").attr("fill","#111111").style("font-family",n.LABEL_FONT_FAMILY).style("font-size",`${n.LABEL_FONT_SIZE}px`).style("font-weight","500"),y.exit().remove(),x.exit().remove()}else{r.selectAll("g.status_label").remove();let x=r.selectAll("circle.status_started").data(_.filter(D=>D.status==="started")),b=x.enter().append("circle");x.merge(b).attr("class","status_started").attr("cx",D=>D.x).attr("cy",D=>D.y).attr("r",6).attr("text",D=>D.port||"").attr("fill","#2ecc71").classed("link-hidden",()=>p),x.exit().remove();let M=r.selectAll("rect.status_stopped").data(_.filter(D=>D.status==="stopped")),w=M.enter().append("rect"),y=10;M.merge(w).attr("class","status_stopped").attr("x",D=>D.x-y/2).attr("y",D=>D.y-y/2).attr("width",y).attr("height",y).attr("fill","red").classed("link-hidden",()=>p),M.exit().remove();let E=r.selectAll("circle.status_suspended").data(_.filter(D=>D.status==="suspended")),I=E.enter().append("circle");E.merge(I).attr("class","status_suspended").attr("cx",D=>D.x).attr("cy",D=>D.y).attr("r",6).attr("fill","#FFFF00").classed("link-hidden",()=>p),E.exit().remove()}})}getLabelWidth(e){let t=e||"",o=n.LABEL_FONT_SIZE*.62,r=t.length*o+n.LABEL_HORIZONTAL_PADDING*2;return Math.max(n.LABEL_MIN_WIDTH,Math.ceil(r))}getStatusStrokeColor(e){return e==="started"?"#2ecc71":e==="stopped"?"red":"#FFFF00"}shouldRenderTooltipOnly(e){return(e.parallelLinksCount||1)>n.MAX_INLINE_LABELS_PARALLEL_LINKS}renderEndpointHoverTooltips(e,t,o){let r=e.selectAll("g.status_hover_tooltip").data(o?t:[]),a=r.enter().append("g").attr("class","status_hover_tooltip").attr("visibility","hidden"),c=r.merge(a).style("pointer-events","none").attr("transform",h=>`translate(${h.x}, ${h.y})`);c.raise();let p=c.selectAll("rect").data(h=>[h]);p.enter().append("rect").merge(p).attr("class","status_hover_tooltip_rect").attr("width",h=>this.getLabelWidth(h.port)).attr("height",n.LABEL_HEIGHT).attr("x",h=>-(this.getLabelWidth(h.port)/2)).attr("y",-n.LABEL_HEIGHT/2).attr("rx",n.LABEL_RADIUS).attr("ry",n.LABEL_RADIUS).style("fill",n.LABEL_BACKGROUND_COLOR).style("fill-opacity",1).attr("stroke",h=>this.getStatusStrokeColor(h.status)).attr("stroke-width",n.LABEL_STROKE_WIDTH),p.exit().remove();let u=c.selectAll("text").data(h=>[h]);u.enter().append("text").merge(u).attr("class","status_hover_tooltip_label").text(h=>h.port||"").attr("x",0).attr("y",0).attr("dy","0em").attr("text-anchor","middle").attr("dominant-baseline","central").attr("alignment-baseline","central").attr("fill","#111111").style("font-family",n.LABEL_FONT_FAMILY).style("font-size",`${n.LABEL_FONT_SIZE}px`).style("font-weight","500"),u.exit().remove(),r.exit().remove()}bindEndpointTooltipHover(e,t,o){let r=t.node(),a=r&&r.parentNode?Wt(r.parentNode):null;if(!o){e.on("mouseover.status_hover_tooltip",null),e.on("mouseout.status_hover_tooltip",null),e.attr("pointer-events",null),t.selectAll("g.status_hover_tooltip").attr("visibility","hidden");return}e.attr("pointer-events","stroke"),e.on("mouseover.status_hover_tooltip",()=>{a&&a.raise(),t.selectAll("g.status_hover_tooltip").raise().attr("visibility","visible")}).on("mouseout.status_hover_tooltip",()=>{t.selectAll("g.status_hover_tooltip").attr("visibility","hidden")});let c=e.node(),p=c?c.matches(":hover"):!1,u=t.selectAll("g.status_hover_tooltip");p&&(a&&a.raise(),u.raise()),u.attr("visibility",p?"visible":"hidden")}static \u0275fac=function(t){return new(t||n)(ge(go))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var zf=class{endpointOrder=new Map;getEndpointOrderKey(i,e){return`${i||""}:${e}`}getEndpointOrder(i,e){return this.endpointOrder.get(this.getEndpointOrderKey(i.id,e))||0}hasDistanceBasedParallelSpacing(i){return i.parallelLinksCount>1&&typeof i.distance=="number"&&!Number.isNaN(i.distance)}getRenderEndpointOrder(i,e){return this.hasDistanceBasedParallelSpacing(i)?0:this.getEndpointOrder(i,e)}getEndpointPoint(i,e,t,o=0){let r=-e[1],a=e[0],p=t*14+o;return[i[0]+r*p,i[1]+a*p]}getFaceEndpointOrder(i,e){let t=e-(i-1)/2;return i===2?e===0?-1:1:t}buildEndpointOrder(i){this.endpointOrder.clear();let e=new Map;i.forEach(t=>{if(!t.source||!t.target||!t.nodes||t.nodes.length<2||Yt.normalizeLinkType(t.link_style?.link_type)!=="bezier")return;let r=[t.source.x+t.source.width/2,t.source.y+t.source.height/2],a=[t.target.x+t.target.width/2,t.target.y+t.target.height/2],c=t.nodes[0].nodeId||t.source.id,p=t.nodes[1].nodeId||t.target.id;if(c){let u=Yt.getContinuousOrientation(r,a),h=`${c}:${u[0]},${u[1]}`,_=-u[1],S=u[0],x=a[0]-r[0],b=a[1]-r[1],M=x*_+b*S,w=e.get(h)||[];w.push({link:t,endpointIndex:0,projection:M}),e.set(h,w)}if(p){let u=Yt.getContinuousOrientation(a,r),h=`${p}:${u[0]},${u[1]}`,_=-u[1],S=u[0],x=r[0]-a[0],b=r[1]-a[1],M=x*_+b*S,w=e.get(h)||[];w.push({link:t,endpointIndex:1,projection:M}),e.set(h,w)}}),e.forEach(t=>{t.sort((o,r)=>o.projection-r.projection),t.forEach((o,r)=>{let a=this.getFaceEndpointOrder(t.length,r);this.endpointOrder.set(this.getEndpointOrderKey(o.link.id,o.endpointIndex),a)})})}clearLabelRenderOffsets(i){i.nodes&&i.nodes.forEach(e=>{e.bezierRenderOffsetX=0,e.bezierRenderOffsetY=0})}applyLabelRenderOffsets(i,e,t,o,r){if(!i.nodes||i.nodes.length<2)return;let a=t[0]-e[0],c=t[1]-e[1],p=Math.hypot(a,c)||1,u=-c/p,h=a/p,_=o>=0?1:-1,S=Math.min(16,Math.max(7,7+Math.abs(r)*.03)),x=6,b=this.getRenderEndpointOrder(i,0),M=this.getRenderEndpointOrder(i,1),w=S*_+b*x,y=-S*_+M*x;i.nodes[0].bezierRenderOffsetX=u*w,i.nodes[0].bezierRenderOffsetY=h*w,i.nodes[1].bezierRenderOffsetX=u*y,i.nodes[1].bezierRenderOffsetY=h*y}getVariation(i){let e=this.getEndpointOrder(i,0),t=this.getEndpointOrder(i,1),o=(e-t)*6;return Math.round(Math.max(-24,Math.min(24,o)))}};var xA=class{link;source;target;style;bezierVariation;sourceOrientation;targetOrientation;controlOffset;constructor(i,e,t,o,r=0,a,c,p){this.link=i,this.source=e,this.target=t,this.style=o,this.bezierVariation=r,this.sourceOrientation=a,this.targetOrientation=c,this.controlOffset=p}},jf=(()=>{class n{onContextMenu=new ve;bezierLayout=new zf;defaultEthernetLinkStyle={color:"#000000",width:2,type:1,link_type:Yt.DEFAULT_LINK_TYPE,bezier_curviness:Yt.BEZIER_CURVINESS_DEFAULT,flowchart_roundness:Yt.FLOWCHART_ROUNDNESS_DEFAULT};constructor(){}linktoEthernetLink(e){let t=Yt.normalizeLinkType(e.link_style?.link_type),o=[e.source.x+e.source.width/2,e.source.y+e.source.height/2],r=[e.target.x+e.target.width/2,e.target.y+e.target.height/2],a=Yt.getContinuousOrientation(o,r),c=Yt.getContinuousOrientation(r,o),p=t==="bezier"?this.bezierLayout.getVariation(e):0,u=typeof e.link_style?.color=="string"&&e.link_style.color.length>0,h=typeof e.link_style?.width=="number"&&e.link_style.width>=this.defaultEthernetLinkStyle.width,_={color:u?e.link_style.color:this.defaultEthernetLinkStyle.color,width:h?e.link_style.width:this.defaultEthernetLinkStyle.width,type:e.link_style?.type!==void 0?e.link_style.type:this.defaultEthernetLinkStyle.type,link_type:t,bezier_curviness:t==="statemachine"?Yt.normalizeStateMachineCurviness(e.link_style?.bezier_curviness):Yt.normalizeBezierCurviness(e.link_style?.bezier_curviness),flowchart_roundness:Yt.normalizeFlowchartRoundness(e.link_style?.flowchart_roundness),control_offset:e.link_style?.control_offset},S=o,x=r;if(t==="bezier"){S=this.bezierLayout.getEndpointPoint(o,a,this.bezierLayout.getRenderEndpointOrder(e,0)),x=this.bezierLayout.getEndpointPoint(r,c,this.bezierLayout.getRenderEndpointOrder(e,1));let b=Yt.getEffectiveBezierMajorAnchor(_.bezier_curviness,p),M=Yt.getBezierSideSign(S,x,b,a,c);this.bezierLayout.applyLabelRenderOffsets(e,S,x,M,b)}else this.bezierLayout.clearLabelRenderOffsets(e);return new xA(e,S,x,_,p,a,c,_.control_offset)}draw(e){let t=e.data();this.bezierLayout.buildEndpointOrder(Array.isArray(t)?t:[]);let o=e.selectAll("path.ethernet_link").data(c=>{if(c.linkType==="ethernet"){let p=this.linktoEthernetLink(c);return p?[p]:[]}return[]}),r=o.enter().append("path").attr("class","ethernet_link");o.merge(r).on("contextmenu",(c,p)=>{let u=p;u&&this.onContextMenu.emit(new Yl(c,u))}).attr("transform",c=>Yt.getLinkTransform(c.style)).attr("fill","none").attr("stroke",c=>!c.style.color||c.style.color===this.defaultEthernetLinkStyle.color?"var(--gns3-canvas-link-color)":c.style.color).attr("stroke-width",c=>c.style.width).attr("stroke-dasharray",c=>Yt.getLinkStyle(c.style)).classed("link_hidden",c=>c.style.type===0).attr("pointer-events",c=>c.style.type===0?"stroke":null).attr("d",c=>c.style.link_type==="freeform"||c.controlOffset?Yt.getFreeformBezierPath(c.source,c.target,c.sourceOrientation,c.targetOrientation,c.controlOffset):Yt.getLinkPath(c.source,c.target,c.style,{bezierVariation:c.bezierVariation,sourceOrientation:c.sourceOrientation,targetOrientation:c.targetOrientation,flowchartDistance:typeof c.link.distance=="number"&&!Number.isNaN(c.link.distance)?c.link.distance:0}))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var yA=class{link;source;target;style;bezierVariation;useLegacySerialPattern;sourceOrientation;targetOrientation;controlOffset;constructor(i,e,t,o,r=0,a=!1,c,p,u){this.link=i,this.source=e,this.target=t,this.style=o,this.bezierVariation=r,this.useLegacySerialPattern=a,this.sourceOrientation=c,this.targetOrientation=p,this.controlOffset=u}},$f=(()=>{class n{onContextMenu=new ve;bezierLayout=new zf;defaultSerialLinkStyle={color:"#800000",width:2,type:1,link_type:Yt.DEFAULT_LINK_TYPE,bezier_curviness:Yt.BEZIER_CURVINESS_DEFAULT,flowchart_roundness:Yt.FLOWCHART_ROUNDNESS_DEFAULT};constructor(){}getLegacySerialPath(e,t){let o=t[0]-e[0],r=t[1]-e[1],c=Math.atan2(r,o)-Math.PI/4,p=Math.cos(c),u=Math.sin(c),h=15,_=e[0]+o/2,S=e[1]+r/2,x=[_+h*p,S+h*u],b=[_-h*p,S-h*u];return`M${e[0]},${e[1]}L${x[0]},${x[1]}L${b[0]},${b[1]}L${t[0]},${t[1]}`}linkToSerialLink(e){let t=Yt.normalizeLinkType(e.link_style?.link_type),o=[e.source.x+e.source.width/2,e.source.y+e.source.height/2],r=[e.target.x+e.target.width/2,e.target.y+e.target.height/2],a=Yt.getContinuousOrientation(o,r),c=Yt.getContinuousOrientation(r,o),p=t==="bezier"?this.bezierLayout.getVariation(e):0,u=typeof e.link_style?.color=="string"&&e.link_style.color.length>0,h=typeof e.link_style?.width=="number"&&e.link_style.width>=this.defaultSerialLinkStyle.width,_={color:u?e.link_style.color:this.defaultSerialLinkStyle.color,width:h?e.link_style.width:this.defaultSerialLinkStyle.width,type:e.link_style?.type!==void 0?e.link_style.type:this.defaultSerialLinkStyle.type,link_type:t,bezier_curviness:t==="statemachine"?Yt.normalizeStateMachineCurviness(e.link_style?.bezier_curviness):Yt.normalizeBezierCurviness(e.link_style?.bezier_curviness),flowchart_roundness:Yt.normalizeFlowchartRoundness(e.link_style?.flowchart_roundness),control_offset:e.link_style?.control_offset},S=o,x=r;if(t==="bezier"){S=this.bezierLayout.getEndpointPoint(o,a,this.bezierLayout.getRenderEndpointOrder(e,0)),x=this.bezierLayout.getEndpointPoint(r,c,this.bezierLayout.getRenderEndpointOrder(e,1));let b=Yt.getEffectiveBezierMajorAnchor(_.bezier_curviness,p),M=Yt.getBezierSideSign(S,x,b,a,c);this.bezierLayout.applyLabelRenderOffsets(e,S,x,M,b)}else this.bezierLayout.clearLabelRenderOffsets(e);return new yA(e,S,x,_,p,t===Yt.DEFAULT_LINK_TYPE,a,c,_.control_offset)}draw(e){let t=e.data();this.bezierLayout.buildEndpointOrder(Array.isArray(t)?t:[]);let o=e.selectAll("path.serial_link").data(c=>{if(c.linkType==="serial"){let p=this.linkToSerialLink(c);return p?[p]:[]}return[]}),r=o.enter().append("path").attr("class","serial_link");o.merge(r).on("contextmenu",(c,p)=>{let u=p;u&&this.onContextMenu.emit(new Yl(c,u))}).attr("transform",c=>Yt.getLinkTransform(c.style)).attr("fill","none").attr("stroke",c=>c.style.color).attr("stroke-width",c=>c.style.width).attr("stroke-dasharray",c=>Yt.getLinkStyle(c.style)).classed("link_hidden",c=>c.style.type===0).attr("pointer-events",c=>c.style.type===0?"stroke":null).attr("d",c=>c.useLegacySerialPattern?this.getLegacySerialPath(c.source,c.target):c.style.link_type==="freeform"||c.controlOffset?Yt.getFreeformBezierPath(c.source,c.target,c.sourceOrientation,c.targetOrientation,c.controlOffset):Yt.getLinkPath(c.source,c.target,c.style,{bezierVariation:c.bezierVariation,sourceOrientation:c.sourceOrientation,targetOrientation:c.targetOrientation,flowchartDistance:typeof c.link.distance=="number"&&!Number.isNaN(c.link.distance)?c.link.distance:0}))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Da=(()=>{class n{created=new ve;edited=new ve;interfaceDragged=new ve;static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Hf=(()=>{class n{multiLinkCalculatorHelper;interfaceLabelWidget;interfaceStatusWidget;selectionManager;ethernetLinkWidget;serialLinkWidget;linksEventSource;mapLinksDataSource;onContextMenu=new ve;subscription;constructor(e,t,o,r,a,c,p,u){this.multiLinkCalculatorHelper=e,this.interfaceLabelWidget=t,this.interfaceStatusWidget=o,this.selectionManager=r,this.ethernetLinkWidget=a,this.serialLinkWidget=c,this.linksEventSource=p,this.mapLinksDataSource=u,this.subscription=this.mapLinksDataSource.itemChanged.subscribe(h=>{this.updateFilterIconsVisibility(h)})}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}updateFilterIconsVisibility(e){let t=e.show_filters_icon!==!1;Wt("svg").selectAll("g.link_body").filter(o=>o&&o.id===e.id).selectAll(".filter-capture-icon, .filter-icon").style("display",t?null:"none")}draw(e){let t=e.selectAll("g.link_body").data(c=>[c]),o=t.enter().append("g").attr("class","link_body"),r=t.merge(o).attr("transform",c=>{let p=this.multiLinkCalculatorHelper.linkTranslation(c.distance,c.source,c.target);return`translate (${p.dx}, ${p.dy})`});t.select(".capture-icon").remove(),t.filter(c=>c.capturing&&!c.suspend&&(c.show_filters_icon===!1||!(c.filters.bpf||c.filters.corrupt||c.filters.delay||c.filters.frequency_drop||c.filters.packet_loss))).append("g").on("contextmenu",(c,p)=>{let u=c;this.onContextMenu.emit(new Yl(u,p))}).attr("class","capture-icon").attr("transform",c=>c.link_style?.link_type==="freeform"&&c.link_style?.control_offset?`translate (${c.link_style.control_offset[0]-5}, ${c.link_style.control_offset[1]-5}) scale(0.5)`:`translate (${(c.source.x+c.target.x)/2+24}, ${(c.source.y+c.target.y)/2+24}) scale(0.5)`).attr("viewBox","0 0 20 20").append("image").attr("xlink:href","assets/resources/images/inspect.svg"),t.select(".filter-capture-icon").remove(),t.filter(c=>c.show_filters_icon!==!1&&c.capturing&&!c.suspend&&(c.filters.bpf||c.filters.corrupt||c.filters.delay||c.filters.frequency_drop||c.filters.packet_loss)).append("g").on("contextmenu",(c,p)=>{let u=c;this.onContextMenu.emit(new Yl(u,p))}).attr("class","filter-capture-icon").attr("transform",c=>c.link_style?.link_type==="freeform"&&c.link_style?.control_offset?`translate (${c.link_style.control_offset[0]-5}, ${c.link_style.control_offset[1]-5}) scale(0.5)`:`translate (${(c.source.x+c.target.x)/2+24}, ${(c.source.y+c.target.y)/2+24}) scale(0.5)`).attr("viewBox","0 0 20 20").append("image").attr("xlink:href","assets/resources/images/filter-capture.svg"),t.select(".filter-icon").remove(),t.filter(c=>c.show_filters_icon!==!1&&!c.capturing&&!c.suspend&&(c.filters.bpf||c.filters.corrupt||c.filters.delay||c.filters.frequency_drop||c.filters.packet_loss)).append("g").on("contextmenu",(c,p)=>{let u=c;this.onContextMenu.emit(new Yl(u,p))}).attr("class","filter-icon").attr("width","48px").attr("height","48px").attr("transform",c=>c.link_style?.link_type==="freeform"&&c.link_style?.control_offset?`translate (${c.link_style.control_offset[0]-5}, ${c.link_style.control_offset[1]-5}) scale(0.5)`:`translate (${(c.source.x+c.target.x)/2+24}, ${(c.source.y+c.target.y)/2+24}) scale(0.5)`).attr("viewBox","0 0 20 20").append("image").attr("width","48px").attr("height","48px").attr("xlink:href","assets/resources/images/filter.svg"),t.select(".pause-icon").remove(),t.filter(c=>c.suspend).append("g").on("contextmenu",(c,p)=>{let u=c;this.onContextMenu.emit(new Yl(u,p))}).attr("class","pause-icon").attr("transform",c=>c.link_style?.link_type==="freeform"&&c.link_style?.control_offset?`translate (${c.link_style.control_offset[0]-5}, ${c.link_style.control_offset[1]-5}) scale(0.5)`:`translate (${(c.source.x+c.target.x)/2+24}, ${(c.source.y+c.target.y)/2+24}) scale(0.5)`).attr("viewBox","0 0 20 20").append("image").attr("xlink:href","assets/resources/images/pause.svg"),this.serialLinkWidget.draw(r),this.ethernetLinkWidget.draw(r),r.select("path").classed("selected",c=>this.selectionManager.isSelected(c));let a=this;r.each(function(c){if(Yt.normalizeLinkType(c.link_style?.link_type)!=="freeform")return;let h=Wt(this).select("path");if(h.empty())return;let _=c.source.x+c.source.width/2,S=c.source.y+c.source.height/2,x=c.target.x+c.target.width/2,b=c.target.y+c.target.height/2,M=(_+x)/2,w=(S+b)/2,y={startX:0,startY:0,startOffset:[0,0]};h.attr("cursor","grab").on("mouseenter",function(){Wt(this).attr("cursor","grab")}).on("mouseleave",function(){Wt(this).attr("cursor","default")}).call(fs().on("start",function(E){Wt(this).attr("cursor","grabbing"),y.startX=E.x,y.startY=E.y,c.link_style?.control_offset?y.startOffset=[c.link_style.control_offset[0],c.link_style.control_offset[1]]:y.startOffset=[M,w]}).on("drag",function(E,I){let D=[E.x,E.y],N=y.startX,P=y.startY,L=y.startOffset,re=D[0]-N,oe=D[1]-P,G=L[0]+re,$=L[1]+oe,ue=[_,S],be=[x,b],me=Yt.getContinuousOrientation(ue,be),De=Yt.getContinuousOrientation(be,ue),he=Yt.getFreeformBezierPath(ue,be,me,De,[G,$]);Wt(this).attr("d",he);let B=Wt(this.parentNode),X=B.select("g.capture-icon");X.empty()||X.attr("transform",`translate (${G-5}, ${$-5}) scale(0.5)`);let se=B.select("g.filter-capture-icon");se.empty()||se.attr("transform",`translate (${G-5}, ${$-5}) scale(0.5)`);let ce=B.select("g.filter-icon");ce.empty()||ce.attr("transform",`translate (${G-5}, ${$-5}) scale(0.5)`);let ke=B.select("g.pause-icon");ke.empty()||ke.attr("transform",`translate (${G-5}, ${$-5}) scale(0.5)`),I.link_style||(I.link_style={}),I.link_style.control_offset=[G,$]}).on("end",function(E){Wt(this).attr("cursor","grab"),a.linksEventSource.edited.next(c)}))}),this.interfaceLabelWidget.draw(r),this.interfaceStatusWidget.draw(r)}static \u0275fac=function(t){return new(t||n)(ge(Qm),ge(Xc),ge(fS),ge(Ho),ge(jf),ge($f),ge(Da),ge(jc))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var rp=(()=>{class n{multiLinkCalculatorHelper;linkWidget;constructor(e,t){this.multiLinkCalculatorHelper=e,this.linkWidget=t}redrawLink(e,t){let o=this.selectLink(e,t),r=null;o.each(u=>{this.mergeDefinedFields(u,t),t.link_style&&(u.link_style=K(K({},u.link_style||{}),t.link_style)),r=u}),o.attr("map-source",u=>u.source?.id?u.source.id:"").attr("map-target",u=>u.target?.id?u.target.id:"");let a=this.selectRelatedLinks(e,r||t),c=a.empty()?o:a,p=c.data();Array.isArray(p)&&p.length>0&&this.multiLinkCalculatorHelper.assignDataToLinks(p),this.linkWidget.draw(c)}draw(e){let t=e.selectAll("g.link").data(a=>{if(a.links){let c=a.links.filter(p=>p.target&&p.source);return this.multiLinkCalculatorHelper.assignDataToLinks(c),c}return[]},a=>a.id),o=t.enter().append("g").attr("class","link").attr("link_id",a=>a.id).attr("map-source",a=>a.source.id).attr("map-target",a=>a.target.id),r=t.merge(o).attr("link_id",a=>a.id).attr("map-source",a=>a.source.id).attr("map-target",a=>a.target.id);this.linkWidget.draw(r),t.exit().remove()}selectLink(e,t){return e.selectAll(`g.link[link_id="${t.id}"]`)}selectRelatedLinks(e,t){let o=t.source?.id,r=t.target?.id;if(!o||!r)return this.selectLink(e,t);let a=`g.link[map-source="${o}"], g.link[map-target="${o}"], g.link[map-source="${r}"], g.link[map-target="${r}"]`;return e.selectAll(a)}mergeDefinedFields(e,t){!e||!t||Object.keys(t).forEach(o=>{let r=t[o];r!==void 0&&o!=="link_style"&&(e[o]=r)})}static \u0275fac=function(t){return new(t||n)(ge(Qm),ge(Hf))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var gS=class{datum;x;y;width;height;rotation};var _S=class{convert(i){let e=new ua,t=i.attributes.getNamedItem("stroke");t&&(e.stroke=t.value);let o=i.attributes.getNamedItem("stroke-width");o&&(e.stroke_width=parseInt(o.value,10));let r=i.attributes.getNamedItem("stroke-dasharray");r&&(e.stroke_dasharray=r.value);let a=i.attributes.getNamedItem("data-curve-type");a?e.curve_type=a.value:e.curve_type="catmullrom";let c=i.attributes.getNamedItem("data-arrow-start");c&&(e.arrow_start=c.value==="true");let p=i.attributes.getNamedItem("data-arrow-end");p&&(e.arrow_end=p.value==="true");let u=i.attributes.getNamedItem("d");return u&&(e.points=this.parsePathData(u.value)),e}parsePathData(i){let e=[],t=i.match(/[MLQCZ][^MLQCZ]*/gi);if(!t)return e;for(let o of t){let r=o[0].toUpperCase(),a=o.slice(1).trim().split(/[\s,]+/).map(Number);if(r==="M"||r==="L")for(let c=0;c<a.length;c+=2)!isNaN(a[c])&&!isNaN(a[c+1])&&e.push({x:a[c],y:a[c+1]});else if(r==="Q")for(let c=0;c<a.length;c+=4)!isNaN(a[c])&&isNaN(a[c+1]),!isNaN(a[c+2])&&!isNaN(a[c+3])&&e.push({x:a[c+2],y:a[c+3]});else if(r==="C")for(let c=0;c<a.length;c+=6)!isNaN(a[c+4])&&!isNaN(a[c+5])&&e.push({x:a[c+4],y:a[c+5]})}return e}};var xi=class{height;width;cx;cy;fill;fill_opacity;rx;ry;stroke;stroke_width;stroke_dasharray};var vS=class{convert(i){let e=new xi,t=i.attributes.getNamedItem("fill");t&&(e.fill=t.value);let o=i.attributes.getNamedItem("fill-opacity");t&&(e.fill_opacity=parseFloat(o.value));let r=i.attributes.getNamedItem("stroke");r&&(e.stroke=r.value);let a=i.attributes.getNamedItem("stroke-width");r&&(e.stroke_width=parseInt(a.value,10));let c=i.attributes.getNamedItem("stroke-dasharray");c&&(e.stroke_dasharray=c.value);let p=i.attributes.getNamedItem("cx");p&&(e.cx=parseInt(p.value,10));let u=i.attributes.getNamedItem("cy");u&&(e.cy=parseInt(u.value,10));let h=i.attributes.getNamedItem("rx");h&&(e.rx=parseInt(h.value,10));let _=i.attributes.getNamedItem("ry");return _&&(e.ry=parseInt(_.value,10)),e}};var Kc=class{height;width;data};var CS=class{convert(i){let e=new Kc,t=i.attributes.getNamedItem("xlink:href");t&&(e.data=t.value);let o=i.attributes.getNamedItem("width");o&&(e.width=parseInt(o.value,10));let r=i.attributes.getNamedItem("height");return r&&(e.height=parseInt(r.value,10)),e}};var Pa=class{height;width;stroke;stroke_width;stroke_dasharray;x1;x2;y1;y2;arrow_start;arrow_end;drawing_type;control_offset;text;text_font_family;text_font_size;text_font_weight;text_fill;text_x;text_y};var bS=class{convert(i){let e=new Pa,t=i.attributes.getNamedItem("stroke");t&&(e.stroke=t.value);let o=i.attributes.getNamedItem("stroke-width");o&&(e.stroke_width=parseInt(o.value,10));let r=i.attributes.getNamedItem("stroke-dasharray");r&&(e.stroke_dasharray=r.value);let a=i.attributes.getNamedItem("x1");a&&(e.x1=parseInt(a.value,10));let c=i.attributes.getNamedItem("x2");c&&(e.x2=parseInt(c.value,10));let p=i.attributes.getNamedItem("y1");p&&(e.y1=parseInt(p.value,10));let u=i.attributes.getNamedItem("y2");u&&(e.y2=parseInt(u.value,10));let h=i.attributes.getNamedItem("marker-start"),_=i.attributes.getNamedItem("marker-end");h&&h.value.includes("line-start")?e.arrow_start=!0:e.arrow_start=!1,_&&_.value.includes("line-end")?e.arrow_end=!0:e.arrow_end=!1;let S=i.attributes.getNamedItem("data-drawing-type");S&&(S.value==="straight"||S.value==="freeform")?e.drawing_type=S.value:e.drawing_type="straight";let x=i.attributes.getNamedItem("data-control-offset");if(x&&x.value){let b=x.value.split(",");b.length===2?e.control_offset=[parseInt(b[0],10),parseInt(b[1],10)]:e.control_offset=[0,0]}else e.control_offset=[0,0];return e.arrow_start=e.arrow_start??!1,e.arrow_end=e.arrow_end??!1,e}};var kr=class{height;width;fill;fill_opacity;stroke;stroke_width;stroke_dasharray;rx;ry};var xS=class{convert(i){let e=new kr,t=i.attributes.getNamedItem("fill");t&&(e.fill=t.value);let o=i.attributes.getNamedItem("fill-opacity");t&&(e.fill_opacity=parseFloat(o.value));let r=i.attributes.getNamedItem("stroke");r&&(e.stroke=r.value);let a=i.attributes.getNamedItem("stroke-width");r&&(e.stroke_width=parseInt(a.value,10));let c=i.attributes.getNamedItem("stroke-dasharray");c&&(e.stroke_dasharray=c.value);let p=i.attributes.getNamedItem("width");p&&(e.width=parseInt(p.value,10));let u=i.attributes.getNamedItem("height");u&&(e.height=parseInt(u.value,10));let h=i.attributes.getNamedItem("rx");h&&(e.rx=parseInt(h.value,0));let _=i.attributes.getNamedItem("ry");return _&&(e.ry=parseInt(_.value,0)),e}};var _s=class{height;width;text;fill;fill_opacity;font_family;font_size;font_weight;text_decoration};var yS=class{convert(i){let e=new _s;e.text=i.textContent;let t=i.attributes.getNamedItem("fill");t&&(e.fill=t.value);let o=i.attributes.getNamedItem("fill-opacity");o&&(e.fill_opacity=parseFloat(o.value));let r=i.attributes.getNamedItem("font-family");r&&(e.font_family=r.value);let a=i.attributes.getNamedItem("font-size");a&&(e.font_size=+a.value);let c=i.attributes.getNamedItem("font-weight");c&&(e.font_weight=c.value);let p=i.attributes.getNamedItem("text-decoration");return p&&(e.text_decoration=p.value),e}};var ap=(()=>{class n{parser;elementParsers;constructor(){this.parser=new DOMParser,this.elementParsers={text:new yS,image:new CS,rect:new xS,line:new bS,ellipse:new vS,path:new _S}}supportedTags(){return Object.keys(this.elementParsers)}convert(e){let o=this.parser.parseFromString(e,"text/xml").getElementsByTagName("svg");if(o.length!==1)throw new Error(`Cannot locate svg element root in '${e}'`);let r=o[0],a=null,c=null;for(let u in r.children){c=r.children[u];let h=c.nodeName;if(h in this.elementParsers){a=this.elementParsers[h];break}}if(a===null)throw new Error(`Cannot find parser for '${e}'`);let p=a.convert(c);return p.width=+r.getAttribute("width"),p.height=+r.getAttribute("height"),p}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var SS=(()=>{class n{fontFixer;static MARGIN=4;constructor(e){this.fontFixer=e}draw(e){let t=e.selectAll("text.text_element").data(u=>u.element&&u.element instanceof _s?[u.element]:[]),o=t.enter().append("text").attr("class","text_element noselect"),r=t.merge(o);r.attr("style",u=>{let h=this.fontFixer.fix(u),_=[];return h.font_family&&_.push(`font-family: "${u.font_family}"`),h.font_size&&_.push(`font-size: ${u.font_size}pt`),h.font_weight&&_.push(`font-weight: ${u.font_weight}`),_.join("; ")}).attr("dominant-baseline","text-before-edge").attr("fill",u=>u.fill).attr("text-decoration",u=>u.text_decoration);let a=r.selectAll("tspan").data(u=>u.text.split(/\r?\n/)),c=a.enter().append("tspan");a.merge(c).text(u=>u).attr("xml:space","preserve").attr("x",0).attr("dy",(u,h)=>h===0?"0em":"1.4em"),a.exit().remove(),r.attr("transform",function(u){let h=this.getBBox(),_=Number(u.height),S=_>0?h.height/_:0;return`translate(0, ${isFinite(_)&&S>.5?_/2-(h.y+h.height/2):0})`}),t.exit().remove()}static \u0275fac=function(t){return new(t||n)(ge(ta))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var wS=(()=>{class n{draw(e){let t=e.selectAll("image.image_element").data(a=>a.element&&a.element instanceof Kc?[a.element]:[]),o=t.enter().append("image").attr("class","image_element noselect");t.merge(o).attr("xlink:href",a=>a.data).attr("width",a=>a.width).attr("height",a=>a.height),t.exit().remove()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Yc=(()=>{class n{static MAPPING={"25, 25":"10, 2","5, 25":"4, 2","5, 25, 25":"12, 3, 5, 3","25, 25, 5, 25, 5":"12, 3, 5, 3, 5, 3"};fix(e){if(e||e=="")return e in n.MAPPING?n.MAPPING[e]:e}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var MS=(()=>{class n{qtDasharrayFixer;constructor(e){this.qtDasharrayFixer=e}draw(e){let t=e.selectAll("rect.rect_element").data(a=>a.element&&a.element instanceof kr?[a.element]:[]);t.enter().append("line").attr("class","top"),t.enter().append("line").attr("class","bottom"),t.enter().append("line").attr("class","right"),t.enter().append("line").attr("class","left");let o=t.enter().append("rect").attr("class","rect_element noselect");t.merge(o).attr("fill",a=>a.fill).attr("fill-opacity",a=>a.fill_opacity).attr("stroke",a=>a.stroke).attr("stroke-width",a=>a.stroke_width).attr("stroke-dasharray",a=>this.qtDasharrayFixer.fix(a.stroke_dasharray)).attr("width",a=>a.width).attr("height",a=>a.height).attr("rx",a=>a.rx).attr("ry",a=>a.ry),t.exit().remove()}static \u0275fac=function(t){return new(t||n)(ge(Yc))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var kS=(()=>{class n{qtDasharrayFixer;constructor(e){this.qtDasharrayFixer=e}getCurveInterpolator(e){switch(e){case"basis":return kv;case"catmullrom":return Du;case"monotone":return Tv;case"none":return null;default:return Du}}draw(e){this.drawLineElements(e),this.drawCurveElements(e)}drawLineElements(e){let t=this,o=e.select("defs");o.empty()&&(o=e.append("defs"));let r=e.selectAll("line.line_element").data(_=>_.element&&_.element instanceof Pa&&_.element.drawing_type!=="freeform"?[_]:[]);r.enter().append("circle").attr("class","right"),r.enter().append("circle").attr("class","left");let a=r.enter().append("line").attr("class","line_element noselect");a.append("text").attr("class","line_text_label noselect"),r.merge(a).each(function(_){let S=_.element,x=S.stroke;S.arrow_end&&t.createOrUpdateArrowMarkerForLine(o,_.id,"end",S.stroke,S.stroke_width),S.arrow_start&&t.createOrUpdateArrowMarkerForLine(o,_.id,"start",S.stroke,S.stroke_width),Wt(this).attr("stroke",S.stroke).attr("stroke-width",S.stroke_width).attr("stroke-dasharray",t.qtDasharrayFixer.fix(S.stroke_dasharray)).attr("x1",S.x1).attr("x2",S.x2).attr("y1",S.y1).attr("y2",S.y2).attr("cursor","pointer").attr("marker-end",S.arrow_end?`url(#line-end-${_.id})`:null).attr("marker-start",S.arrow_start?`url(#line-start-${_.id})`:null).on("mouseenter",function(){let M=getComputedStyle(document.documentElement).getPropertyValue("--mat-sys-error").trim();Wt(this).attr("stroke",M),S.arrow_end&&o.select(`#line-end-${_.id} path`).attr("fill",M),S.arrow_start&&o.select(`#line-start-${_.id} path`).attr("fill",M)}).on("mouseleave",function(){Wt(this).attr("stroke",x),S.arrow_end&&o.select(`#line-end-${_.id} path`).attr("fill",x),S.arrow_start&&o.select(`#line-start-${_.id} path`).attr("fill",x)});let b=Wt(this.parentNode).select("text.line_text_label");S.text&&S.text.trim()!==""?b.text(S.text).attr("x",S.text_x).attr("y",S.text_y).attr("fill",S.text_fill).attr("font-family",S.text_font_family).attr("font-size",`${S.text_font_size}px`).attr("font-weight",S.text_font_weight).attr("visibility","visible").attr("class","line_text_label noselect"):b.attr("visibility","hidden")});let p=e.selectAll("path.line_element_freeform").data(_=>_.element&&_.element instanceof Pa&&_.element.drawing_type==="freeform"?[_]:[]);p.enter().append("circle").attr("class","right"),p.enter().append("circle").attr("class","left");let u=p.enter().append("path").attr("class","line_element_freeform noselect");u.append("text").attr("class","line_text_label noselect"),p.merge(u).each(function(_){let S=_.element;S.arrow_end&&t.createOrUpdateArrowMarkerForLine(o,_.id,"end",S.stroke,S.stroke_width),S.arrow_start&&t.createOrUpdateArrowMarkerForLine(o,_.id,"start",S.stroke,S.stroke_width);let x=[S.x1,S.y1],b=[S.x2,S.y2],M=S.control_offset||[(S.x1+S.x2)/2,(S.y1+S.y2)/2],w=Yt.getFreeformBezierPath(x,b,void 0,void 0,M);Wt(this).attr("d",w).attr("stroke",S.stroke).attr("stroke-width",S.stroke_width).attr("stroke-dasharray",t.qtDasharrayFixer.fix(S.stroke_dasharray)).attr("fill","none").attr("cursor","grab").attr("marker-end",S.arrow_end?`url(#line-end-${_.id})`:null).attr("marker-start",S.arrow_start?`url(#line-start-${_.id})`:null);let y=Wt(this.parentNode).select("text.line_text_label");S.text&&S.text.trim()!==""?y.text(S.text).attr("x",S.text_x).attr("y",S.text_y).attr("fill",S.text_fill).attr("font-family",S.text_font_family).attr("font-size",`${S.text_font_size}px`).attr("font-weight",S.text_font_weight).attr("visibility","visible").attr("class","line_text_label noselect"):y.attr("visibility","hidden")}),r.exit().remove(),p.exit().remove()}drawCurveElements(e){let t=this,o=e.select("defs");o.empty()&&(o=e.append("defs"));let r=e.selectAll("path.curve_element").data(u=>u.element&&u.element instanceof ua?[u]:[]);r.exit().remove();let a=r.enter().append("path").attr("class","curve_element noselect");r.merge(a).each(function(u){let h=u.element;if(h.points&&h.points.length>0){let _=h.points.map(M=>[M.x,M.y]),S=t.getCurveInterpolator(h.curve_type||"catmullrom"),x="";if(S===null){x=`M ${_[0][0]} ${_[0][1]}`;for(let M=1;M<_.length;M++)x+=` L ${_[M][0]} ${_[M][1]}`}else x=Eu().curve(S)(_)||"";h.arrow_end&&t.createOrUpdateArrowMarker(o,u.id,"end",h.stroke,h.stroke_width),h.arrow_start&&t.createOrUpdateArrowMarker(o,u.id,"start",h.stroke,h.stroke_width);let b=h.stroke;Wt(this).attr("d",x).attr("stroke",h.stroke).attr("stroke-width",h.stroke_width).attr("stroke-dasharray",t.qtDasharrayFixer.fix(h.stroke_dasharray)).attr("fill","none").attr("cursor","pointer").attr("marker-end",h.arrow_end?"url(#arrow-end-"+u.id+")":null).attr("marker-start",h.arrow_start?"url(#arrow-start-"+u.id+")":null).on("mouseenter",function(){let M=getComputedStyle(document.documentElement).getPropertyValue("--mat-sys-error").trim();Wt(this).attr("stroke",M),h.arrow_end&&o.select(`#arrow-end-${u.id} path`).attr("fill",M),h.arrow_start&&o.select(`#arrow-start-${u.id} path`).attr("fill",M)}).on("mouseleave",function(){Wt(this).attr("stroke",b),h.arrow_end&&o.select(`#arrow-end-${u.id} path`).attr("fill",b),h.arrow_start&&o.select(`#arrow-start-${u.id} path`).attr("fill",b)})}});let p=new Set(e.selectAll("path.curve_element").data().map(u=>u.id));o.selectAll('marker[id^="arrow-"]').each(function(){let u=Wt(this).attr("id");if(!u)return;let h=u.replace(/^arrow-(start|end)-/,"");p.has(h)||Wt(this).remove()})}createOrUpdateArrowMarkerForLine(e,t,o,r,a){let c=`line-${o}-${t}`,p=e.select(`marker#${c}`);p.empty()?(p=e.append("marker").attr("id",c).attr("markerWidth","4").attr("markerHeight","4").attr("refX",o==="end"?"0":"4").attr("refY","2").attr("orient","auto").attr("markerUnits","strokeWidth"),p.append("path").attr("d",o==="end"?"M0,0 L4,2 L0,4 z":"M4,0 L0,2 L4,4 z").attr("fill",r)):p.select("path").attr("fill",r)}createOrUpdateArrowMarker(e,t,o,r,a){let c=`arrow-${o}-${t}`,p=e.select(`marker#${c}`);p.empty()?(p=e.append("marker").attr("id",c).attr("markerWidth","4").attr("markerHeight","4").attr("refX",o==="end"?"0":"4").attr("refY","2").attr("orient","auto").attr("markerUnits","strokeWidth"),p.append("path").attr("d",o==="end"?"M0,0 L4,2 L0,4 z":"M4,0 L0,2 L4,4 z").attr("fill",r)):p.select("path").attr("fill",r)}static \u0275fac=function(t){return new(t||n)(ge(Yc))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var TS=(()=>{class n{qtDasharrayFixer;constructor(e){this.qtDasharrayFixer=e}draw(e){let t=e.selectAll("ellipse.ellipse_element").data(a=>a.element&&a.element instanceof xi?[a.element]:[]);t.enter().append("line").attr("class","top"),t.enter().append("line").attr("class","bottom"),t.enter().append("line").attr("class","right"),t.enter().append("line").attr("class","left");let o=t.enter().append("ellipse").attr("class","ellipse_element noselect");t.merge(o).attr("fill",a=>a.fill).attr("fill-opacity",a=>a.fill_opacity).attr("stroke",a=>a.stroke).attr("stroke-width",a=>a.stroke_width).attr("stroke-dasharray",a=>this.qtDasharrayFixer.fix(a.stroke_dasharray)).attr("cx",a=>a.cx).attr("cy",a=>a.cy).attr("rx",a=>a.rx).attr("ry",a=>a.ry),t.exit().remove()}static \u0275fac=function(t){return new(t||n)(ge(Yc))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var c_e="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z",d_e="M18 8h-8V6c0-1.1.9-2 2-2s2 .9 2 2h2c0-2.21-1.79-4-4-4S8 3.79 8 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2z",wA="var(--gns3-lock-badge-locked-color)",fz="var(--gns3-lock-badge-unlocked-color)",MA="var(--gns3-lock-badge-outline-color)",ES=(()=>{class n{textDrawingWidget;imageDrawingWidget;rectDrawingWidget;lineDrawingWidget;ellipseDrawingWidget;selectionManager;mapSettingsService;drawingWidgets=[];constructor(e,t,o,r,a,c,p){this.textDrawingWidget=e,this.imageDrawingWidget=t,this.rectDrawingWidget=o,this.lineDrawingWidget=r,this.ellipseDrawingWidget=a,this.selectionManager=c,this.mapSettingsService=p,this.drawingWidgets=[this.textDrawingWidget,this.imageDrawingWidget,this.rectDrawingWidget,this.lineDrawingWidget,this.ellipseDrawingWidget]}draw(e){let t=e.selectAll("g.drawing_body").data(a=>[a]),o=t.enter().append("g").attr("class","drawing_body"),r=t.merge(o).attr("transform",a=>`translate(${a.x},${a.y}) rotate(${a.rotation})`);if(this.drawingWidgets.forEach(a=>{a.draw(r)}),r.select(".layer_label_wrapper").remove(),this.mapSettingsService.isLayerNumberVisible&&r.filter(a=>a.element instanceof kr||a.element instanceof xi).append("rect").attr("class","layer_label_wrapper").attr("width","26").attr("height","26").attr("x",a=>a.element?a.element.width/2-13:0).attr("y",a=>a.element?a.element.height/2-13:0).attr("fill","red"),r.select(".layer_label").remove(),this.mapSettingsService.isLayerNumberVisible&&r.filter(a=>a.element instanceof kr||a.element instanceof xi).append("text").attr("class","layer_label").text(a=>a.z).attr("x",function(a){return a.z>=100?a.element?a.element.width/2-13:0:a.z>=10?a.element?a.element.width/2-9:0:a.element.width/2-5}).attr("y",a=>a.element?a.element.height/2+5:0).attr("style",()=>{let a=[];return a.push('font-family: "Noto Sans"'),a.push("font-size: 11pt"),a.push("font-weight: bold"),a.join("; ")}).attr("fill","#ffffff"),r.select(".drawing_lock_status_badge").remove(),this.mapSettingsService.isItemLockStatusVisible){let a=r.filter(h=>h.element instanceof kr||h.element instanceof xi||h.element instanceof Kc).append("g").attr("class","drawing_lock_status_badge").attr("pointer-events","none").attr("transform",h=>{if(h.element instanceof xi){let S=h.element.cx+(h.element.rx-12)/Math.SQRT2,x=h.element.cy-(h.element.ry-12)/Math.SQRT2;return`translate(${S}, ${x})`}return`translate(${(h.element.width>0?h.element.width:60)-12}, 12)`});a.filter(h=>h.locked).append("path").attr("d",c_e).attr("transform","translate(-7.68, -7.68) scale(0.64)").attr("fill",wA).attr("stroke",MA).attr("stroke-width",1.2).attr("stroke-linejoin","round").attr("paint-order","stroke fill");let u=a.filter(h=>!h.locked).append("g").attr("transform","translate(-7.68, -7.68) scale(0.64)");u.append("path").attr("d",d_e).attr("fill",fz).attr("stroke",MA).attr("stroke-width",1.2).attr("stroke-linejoin","round").attr("paint-order","stroke fill"),u.append("circle").attr("cx",12).attr("cy",15).attr("r",2).attr("fill",MA)}r.select(".rotation-handle-stem").remove(),r.select(".rotation-handle-knob").remove(),r.select(".rotation-center-point").remove(),r.filter(a=>(a.element instanceof kr||a.element instanceof xi)&&this.selectionManager.isSelected(a)).each(function(a){let c=Wt(this),p=a.element.width+30,u=-30;c.append("circle").attr("class","rotation-center-point").attr("pointer-events","none").attr("cx",0).attr("cy",0).attr("r",5).attr("fill",fz),c.append("line").attr("class","rotation-handle-stem").attr("pointer-events","none").attr("stroke",wA).attr("stroke-width","2").attr("stroke-dasharray","4 2").attr("x1",0).attr("y1",0).attr("x2",p).attr("y2",u),c.append("circle").attr("class","rotation-handle-knob").attr("pointer-events","all").attr("cx",p).attr("cy",u).attr("r",8).attr("fill",wA).attr("cursor","grab")}),r.select("line.top").attr("stroke","transparent").attr("stroke-width","8px").attr("x1",a=>a.element instanceof xi?a.element.cx-a.element.width/10:"0").attr("x2",a=>a.element instanceof xi?a.element.cx+a.element.width/10:a.element.width).attr("y1","0").attr("y2","0").attr("draggable","true").attr("cursor","ns-resize"),r.select("line.bottom").attr("stroke","transparent").attr("stroke-width","8px").attr("x1",a=>a.element instanceof xi?a.element.cx-a.element.width/10:"0").attr("x2",a=>a.element instanceof xi?a.element.cx+a.element.width/10:a.element.width).attr("y1",a=>a.element.height).attr("y2",a=>a.element.height).attr("draggable","true").attr("cursor","ns-resize"),r.select("line.right").attr("stroke","transparent").attr("stroke-width","8px").attr("x1","0").attr("x2","0").attr("y1",a=>a.element instanceof xi?a.element.cy-a.element.height/10:"0").attr("y2",a=>a.element instanceof xi?a.element.cy+a.element.height/10:a.element.height).attr("draggable","true").attr("cursor","ew-resize"),r.select("line.left").attr("stroke","transparent").attr("stroke-width","8px").attr("x1",a=>a.element.width).attr("x2",a=>a.element.width).attr("y1",a=>a.element instanceof xi?a.element.cy-a.element.height/10:"0").attr("y2",a=>a.element instanceof xi?a.element.cy+a.element.height/10:a.element.height).attr("draggable","true").attr("cursor","ew-resize"),r.select("circle.left").attr("draggable","true").attr("fill","transparent").attr("stroke","transparent").attr("cx",a=>a.element.x1).attr("cy",a=>a.element.y1).attr("r",10).attr("cursor","move"),r.select("circle.right").attr("draggable","true").attr("fill","transparent").attr("stroke","transparent").attr("cx",a=>a.element.x2).attr("cy",a=>a.element.y2).attr("r",10).attr("cursor","move"),r.classed("drawing_selected",a=>this.selectionManager.isSelected(a))}static \u0275fac=function(t){return new(t||n)(ge(SS),ge(wS),ge(MS),ge(kS),ge(TS),ge(Ho),ge(go))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Zc=(()=>{class n{drawingWidget;svgToDrawingConverter;context;mapSettings;draggable=new Qc;draggingEnabled=!1;resizingFinished=new ve;onContextMenu=new ve;constructor(e,t,o,r){this.drawingWidget=e,this.svgToDrawingConverter=t,this.context=o,this.mapSettings=r,this.svgToDrawingConverter=new ap}redrawDrawing(e,t){this.drawingWidget.draw(this.selectDrawing(e,t))}draw(e){let t=e.selectAll("g.drawing").data(oe=>(oe.drawings.forEach(G=>{try{G.element=this.svgToDrawingConverter.convert(G.svg)}catch{}}),oe.drawings),oe=>oe.id),o=t.enter().append("g").attr("class","drawing").attr("drawing_id",oe=>oe.id).on("contextmenu",(oe,G)=>{oe.preventDefault(),this.onContextMenu.emit(new mS(oe,G))}),r=t.merge(o);this.drawingWidget.draw(r),t.exit().remove(),this.mapSettings.isReadOnly||this.draggable.call(r);let a,c,p,u,h=!1,_=fs().on("start",(oe,G)=>{document.body.style.cursor="ns-resize",p=G.y}).on("drag",(oe,G)=>{let $=oe;h?(c=a-($.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y)),a=$.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),G.element.height+c<0?(h=!1,a=p,G.element.height=Math.abs(G.element.height+$.dy)):(G.y=$.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),G.element.height+=c,G.element instanceof xi&&(G.element.cy=G.element.cy+c/2<0?1:G.element.cy+=c/2,G.element.ry=G.element.ry+c/2<0?1:G.element.ry+=c/2))):G.element.height+$.dy<0?(h=!0,a=p,G.element.height=Math.abs(G.element.height+$.dy)):(G.element.height+=$.dy,G.element instanceof xi&&(G.element.cy=G.element.cy+$.dy/2<0?1:G.element.cy+=$.dy/2,G.element.ry=G.element.ry+$.dy/2<0?1:G.element.ry+=$.dy/2)),this.redrawDrawing(e,G)}).on("end",(oe,G)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(G))}),S=fs().on("start",(oe,G)=>{a=oe.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),u=a+G.element.height,document.body.style.cursor="ns-resize"}).on("drag",(oe,G)=>{let $=oe;h?G.element.height+$.dy<0?(h=!1,a=u,G.element.height=Math.abs(G.element.height+$.dy)):(G.element.height+=$.dy,G.element instanceof xi&&(G.element.cy=G.element.cy+$.dy/2<0?1:G.element.cy+=$.dy/2,G.element.ry=G.element.ry+$.dy/2<0?1:G.element.ry+=$.dy/2)):(c=a-($.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y)),a=$.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),G.element.height+c<0?(a=u,h=!0,G.element.height=Math.abs(G.element.height+$.dy)):(G.y=$.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),G.element.height+=c,G.element instanceof xi&&(G.element.cy=G.element.cy+c/2<0?1:G.element.cy+=c/2,G.element.ry=G.element.ry+c/2<0?1:G.element.ry+=c/2))),this.redrawDrawing(e,G)}).on("end",(oe,G)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(G))}),x,b,M,w,y=!1,E=fs().on("start",(oe,G)=>{x=oe.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),w=x+G.element.width,document.body.style.cursor="ew-resize"}).on("drag",(oe,G)=>{let $=oe;y?G.element.width+$.dx<0?(x=w,y=!1,G.element.width=Math.abs(G.element.width+$.dx)):(G.element instanceof xi&&(G.element.cx=G.element.cx+$.dx/2<0?1:G.element.cx+=$.dx/2,G.element.rx=G.element.rx+$.dx/2<0?1:G.element.rx+=$.dx/2),G.element.width=G.element.width+$.dx<0?1:G.element.width+=$.dx):(b=x-($.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x)),x=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),G.element.width+b<0?(x=w,y=!0,G.element.width=Math.abs(G.element.width+$.dx)):(G.x=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),G.element.width+=b,G.element instanceof xi&&(G.element.cx=G.element.cx+b/2<0?1:G.element.cx+=b/2,G.element.rx=G.element.rx+b/2<0?1:G.element.rx+=b/2))),this.redrawDrawing(e,G)}).on("end",(oe,G)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(G))}),I=fs().on("start",(oe,G)=>{document.body.style.cursor="ew-resize",M=G.x}).on("drag",(oe,G)=>{let $=oe;y?(b=x-($.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x)),x=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),G.element.width+b<0?(x=M,y=!1,G.element.width=Math.abs(G.element.width+$.dx)):(G.x=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),G.element.width+=b,G.element instanceof xi&&(G.element.cx=G.element.cx+b/2<0?1:G.element.cx+=b/2,G.element.rx=G.element.rx+b/2<0?1:G.element.rx+=b/2))):G.element.width+$.dx<0?(x=M,y=!0,G.element.width=Math.abs(G.element.width+$.dx)):(G.element instanceof xi&&(G.element.cx=G.element.cx+$.dx/2<0?1:G.element.cx+=$.dx/2,G.element.rx=G.element.rx+$.dx/2<0?1:G.element.rx+=$.dx/2),G.element.width=G.element.width+$.dx<0?1:G.element.width+=$.dx),this.redrawDrawing(e,G)}).on("end",(oe,G)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(G))}),D=fs().on("start",()=>{document.body.style.cursor="move"}).on("drag",(oe,G)=>{let $=oe;G.element.width+=$.dx,G.element.height+=$.dy,G.element.x2+=$.dx,G.element.y2+=$.dy,this.redrawDrawing(e,G)}).on("end",(oe,G)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(G))}),N=fs().on("start",()=>{document.body.style.cursor="move"}).on("drag",(oe,G)=>{let $=oe;G.element.width+=$.dx,G.element.height+=$.dy,G.element.x1+=$.dx,G.element.y1+=$.dy,this.redrawDrawing(e,G)}).on("end",(oe,G)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(G))});r.select("line.bottom").call(_),r.select("line.top").call(S),r.select("line.right").call(E),r.select("line.left").call(I),r.select("circle.right").call(D),r.select("circle.left").call(N),r.each(oe=>{if(oe.element instanceof Pa&&oe.element.drawing_type==="freeform"){let G=oe.element,$=e.select(`g.drawing[drawing_id="${oe.id}"] path.line_element_freeform`);if(!$.empty()){let ue={startX:0,startY:0,startOffset:[0,0]};$.call(fs().on("start",be=>{if(document.body.style.cursor="grabbing",ue.startX=be.x,ue.startY=be.y,G.control_offset)ue.startOffset=[G.control_offset[0],G.control_offset[1]];else{let me=(G.x1+G.x2)/2,De=(G.y1+G.y2)/2;ue.startOffset=[me,De]}}).on("drag",be=>{let me=[be.x,be.y],De=ue.startX,he=ue.startY,B=ue.startOffset,X=me[0]-De,se=me[1]-he,ce=B[0]+X,ke=B[1]+se;G.control_offset=[ce,ke];let ze=[G.x1,G.y1],Ke=[G.x2,G.y2],Qe=Yt.getFreeformBezierPath(ze,Ke,void 0,void 0,[ce,ke]);$.attr("d",Qe),this.redrawDrawing(e,oe)}).on("end",be=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(oe))}))}}});let P=0,L=0,re=fs().on("start",(oe,G)=>{document.body.style.cursor="grabbing";let $=oe.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),ue=oe.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y);P=Math.atan2(ue-G.y,$-G.x)*(180/Math.PI),L=G.rotation||0}).on("drag",(oe,G)=>{let $=oe.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),ue=oe.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),me=Math.atan2(ue-G.y,$-G.x)*(180/Math.PI)-P;me>180&&(me-=360),me<-180&&(me+=360);let De=L+me;for(;De>360;)De-=360;for(;De<-359;)De+=360;G.rotation=Math.round(De),this.redrawDrawing(e,G)}).on("end",(oe,G)=>{document.body.style.cursor="initial";let $=this.createResizingEvent(G);$.rotation=G.rotation,this.resizingFinished.emit($)});r.select("circle.rotation-handle-knob").call(re)}createResizingEvent(e){let t=new gS;return t.x=e.x,t.y=e.y,t.width=e.element.width,t.height=e.element.height,t.datum=e,t}selectDrawing(e,t){return e.selectAll(`g.drawing[drawing_id="${t.id}"]`)}static \u0275fac=function(t){return new(t||n)(ge(ES),ge(ap),ge(Eo),ge(Sl))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var DS=(()=>{class n{linksWidget;nodesWidget;drawingsWidget;constructor(e,t,o){this.linksWidget=e,this.nodesWidget=t,this.drawingsWidget=o}draw(e,t){let o=e.selectAll("g.layer").data(t,h=>h.index.toString()),r=o.enter().append("g").attr("class","layer");r.append("g").attr("class","links"),r.append("g").attr("class","nodes"),r.append("g").attr("class","drawings");let a=o.merge(r);a.attr("data-index",h=>h.index);let c=a.select("g.links"),p=a.select("g.nodes"),u=a.select("g.drawings");o.exit().remove(),this.linksWidget.draw(c),this.nodesWidget.draw(p),this.drawingsWidget.draw(u)}static \u0275fac=function(t){return new(t||n)(ge(rp),ge(op),ge(Zc))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var PS=(()=>{class n{nodesWidget;drawingLineTool;selectionTool;movingTool;layersWidget;layersManager;selectionManager;constructor(e,t,o,r,a,c,p){this.nodesWidget=e,this.drawingLineTool=t,this.selectionTool=o,this.movingTool=r,this.layersWidget=a,this.layersManager=c,this.selectionManager=p}getNodesWidget(){return this.nodesWidget}getDrawingLineTool(){return this.drawingLineTool}getSelectionTool(){return this.selectionTool}connect(e,t){this.drawingLineTool.connect(e,t)}draw(e,t){e.attr("width",t.size.width).attr("height",t.size.height);let o=e.selectAll("g.canvas").data([t]),r=o.enter().append("g").attr("class","canvas");o.merge(r).attr("transform",a=>{let c=a.getZeroZeroTransformationPoint().x+a.transformation.x,p=a.getZeroZeroTransformationPoint().y+a.transformation.y,u=a.transformation.k;return`translate(${c}, ${p}) scale(${u})`}),this.layersWidget.draw(o,this.layersManager.getLayersList()),this.drawingLineTool.draw(e,t),this.selectionTool.draw(e,t),this.movingTool.draw(e,t)}updateSelectionHighlights(e){let t=e.select("g.canvas"),o=e.select("defs");t.selectAll("g.node_body").classed("selected",c=>this.selectionManager.isSelected(c)),t.selectAll("g.link_body").classed("selected",c=>this.selectionManager.isSelected(c));let r=t.selectAll("g.drawing_body");r.classed("drawing_selected",c=>this.selectionManager.isSelected(c));let a=getComputedStyle(document.documentElement).getPropertyValue("--mat-sys-error").trim();r.each(function(c,p,u){let h=u[p],_=c.element&&this.selectionManager.isSelected(c);if(Wt(h).selectAll("path.curve_element").classed("selected",()=>this.selectionManager.isSelected(c)),c.element instanceof ua){let x=c.element,b=x.stroke||getComputedStyle(document.documentElement).getPropertyValue("--gns3-canvas-link-color").trim(),M=this.selectionManager.isSelected(c);if(x.arrow_end){let w=o.select(`#arrow-end-${c.id} path`);w.empty()||w.attr("fill",M?a:b)}if(x.arrow_start){let w=o.select(`#arrow-start-${c.id} path`);w.empty()||w.attr("fill",M?a:b)}}}.bind(this))}disconnect(e){e.empty&&!e.empty()&&e.selectAll("*").remove()}static \u0275fac=function(t){return new(t||n)(ge(op),ge(Bf),ge(tp),ge(Ff),ge(DS),ge(Df),ge(Ho))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Fi=(()=>{class n{httpController;constructor(e){this.httpController=e}createLink(e,t,o,r,a,c,p,u,h){return this.httpController.post(e,`/projects/${t.project_id}/links`,{nodes:[{node_id:t.node_id,port_number:o.port_number,adapter_number:o.adapter_number,label:{rotation:0,style:"font-size: 10; font-style: Verdana",text:o.short_name,x:c,y:p}},{node_id:r.node_id,port_number:a.port_number,adapter_number:a.adapter_number,label:{rotation:0,style:"font-size: 10; font-style: Verdana",text:a.short_name,x:u,y:h}}]})}getLink(e,t,o){return this.httpController.get(e,`/projects/${t}/links/${o}`)}deleteLink(e,t){return this.httpController.delete(e,`/projects/${t.project_id}/links/${t.link_id}`)}updateLink(e,t){let o={};return t.nodes!==void 0&&(o.nodes=t.nodes),t.filters!==void 0&&(o.filters=t.filters),t.suspend!==void 0&&(o.suspend=t.suspend),t.show_filters_icon!==void 0&&(o.show_filters_icon=t.show_filters_icon),this.httpController.put(e,`/projects/${t.project_id}/links/${t.link_id}`,o)}updateLinkStyle(e,t){return this.httpController.put(e,`/projects/${t.project_id}/links/${t.link_id}`,{link_style:t.link_style})}getAvailableFilters(e,t){return this.httpController.get(e,`/projects/${t.project_id}/links/${t.link_id}/available_filters`)}updateNodes(e,t,o){let r=o.map(a=>({node_id:a.node_id,port_number:a.port_number,adapter_number:a.adapter_number,label:{rotation:a.label.rotation,style:a.label.style,text:a.label.text,x:a.label.x,y:a.label.y}}));return this.httpController.put(e,`/projects/${t.project_id}/links/${t.link_id}`,{nodes:r})}startCaptureOnLink(e,t,o){return this.httpController.post(e,`/projects/${t.project_id}/links/${t.link_id}/capture/start`,o)}stopCaptureOnLink(e,t){return this.httpController.post(e,`/projects/${t.project_id}/links/${t.link_id}/capture/stop`,{})}restartWiresharkCapture(e,t){return this.httpController.post(e,`/projects/${t.project_id}/links/${t.link_id}/capture/wireshark/restart`,{})}resetLink(e,t){return this.httpController.post(e,`/projects/${t.project_id}/links/${t.link_id}/reset`,{})}streamPcap(e,t){return this.httpController.get(e,`/projects/${t.project_id}/links/${t.link_id}/capture/stream`)}downloadPcap(e,t){return this.httpController.getBlob(e,`/projects/${t.project_id}/links/${t.link_id}/capture/file`)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Uo=(()=>{class n{dragged=new ve;resized=new ve;selected=new ve;pointToAddSelected=new ve;saved=new ve;drawingCompleted=new ve;textAdded=new ve;textEdited=new ve;textSaved=new ve;static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var h_e=["temporaryTextElement"],gz=(()=>{class n{temporaryTextElement=Nt("temporaryTextElement");svg=le(void 0);controller=le(void 0);leftPosition=ae("0px");topPosition=ae("0px");innerText=ae("");editingDrawingId;editedElement;editedLink;editedNode;mapListener;textListener;textAddingSubscription;addingFinished=new ve;drawingsEventSource=f(Uo);toolsService=f(gl);context=f(Eo);renderer=f(Si);mapScaleService=f(zc);linkService=f(Fi);linksDataSource=f(zo);nodesDataSource=f(di);selectionManager=f(Ho);fontFixer=f(ta);ngOnInit(){this.textAddingSubscription=this.toolsService.isTextAddingToolActivated.subscribe(e=>{e?this.activateTextAdding():this.deactivateTextAdding()}),this.activateTextEditingForDrawings(),this.activateTextEditingForNodeLabels()}activateTextAdding(){let e=t=>{let o=this.context.getZeroZeroTransformationPoint().x,r=this.context.getZeroZeroTransformationPoint().y,a=this.context.transformation.x,c=this.context.transformation.y,p=this.context.transformation.k,u=(t.pageX-(o+a))/p,h=(t.pageY-(r+c))/p,_=u*p+o+a,S=h*p+r+c;this.leftPosition.set(_.toString()+"px"),this.topPosition.set(S.toString()+"px");let x=this.temporaryTextElement();this.renderer.setStyle(x.nativeElement,"display","initial"),this.renderer.setStyle(x.nativeElement,"transform",`scale(${this.mapScaleService.getScale()})`),x.nativeElement.focus(),document.documentElement.style.cursor="default";let b=()=>{let M=this.temporaryTextElement();this.drawingsEventSource.textAdded.emit(new cS(M.nativeElement.innerText.replace(/\n$/,""),u,h)),this.deactivateTextAdding(),this.innerText.set(""),M.nativeElement.innerText="",M.nativeElement.removeEventListener("focusout",this.textListener),this.renderer.setStyle(M.nativeElement,"display","none")};this.textListener=b,x.nativeElement.addEventListener("focusout",this.textListener)};this.deactivateTextAdding(),this.mapListener=e,this.svg().addEventListener("click",this.mapListener)}deactivateTextAdding(){this.svg().removeEventListener("click",this.mapListener)}activateTextEditingForNodeLabels(){let e=this,t=Wt(this.svg());t.selectAll("g.interface_label_container").select("text.interface_label").on("dblclick",function(o,r){e.selectionManager.setSelected([]);let a=e.temporaryTextElement();e.renderer.setStyle(a.nativeElement,"display","initial"),e.renderer.setStyle(a.nativeElement,"transform",`scale(${e.mapScaleService.getScale()})`),e.editedLink=r,Wt(o.currentTarget).attr("visibility","hidden"),Wt(o.currentTarget).classed("editingMode",!0),e.editedNode=e.nodesDataSource.get(r.nodeId),e.editedLink=r;let c=(r.label.originalX+e.editedNode.x-1)*e.context.transformation.k+e.context.getZeroZeroTransformationPoint().x+e.context.transformation.x,p=(r.label.originalY+e.editedNode.y+4)*e.context.transformation.k+e.context.getZeroZeroTransformationPoint().y+e.context.transformation.y;e.leftPosition.set(c.toString()+"px"),e.topPosition.set(p.toString()+"px"),a.nativeElement.innerText=r.label.text;let u=[];for(let S of r.label.style.split(";"))u.push({property:S.split(": ")[0],value:S.split(": ")[1]});let h={font_family:u.find(S=>S.property==="font-family")?u.find(S=>S.property==="font-family").value:"TypeWriter",font_size:u.find(S=>S.property==="font-size")?Number(u.find(S=>S.property==="font-size").value):10,font_weight:u.find(S=>S.property==="font-weight")?u.find(S=>S.property==="font-weight").value:"normal"};h=e.fontFixer.fix(h),e.renderer.setStyle(a.nativeElement,"color",u.find(S=>S.property==="fill")?u.find(S=>S.property==="fill").value:"#000000"),e.renderer.setStyle(a.nativeElement,"font-family",h.font_family),e.renderer.setStyle(a.nativeElement,"font-size",`${h.font_size}pt`),e.renderer.setStyle(a.nativeElement,"font-weight",h.font_weight);let _=()=>{let S=e.temporaryTextElement().nativeElement.innerText,x=e.linksDataSource.get(e.editedLink.linkId);x.nodes.find(b=>b.node_id===e.editedNode.node_id).label.text=S,e.linkService.updateLink(e.controller(),x).subscribe(b=>{t.selectAll("text.editingMode").attr("visibility","visible").classed("editingMode",!1),e.innerText.set(""),a.nativeElement.innerText="",a.nativeElement.removeEventListener("focusout",e.textListener),e.clearStyle(),e.renderer.setStyle(a.nativeElement,"display","none")})};e.textListener=_,a.nativeElement.addEventListener("focusout",e.textListener),a.nativeElement.focus()})}activateTextEditingForDrawings(){let e=this,t=Wt(this.svg());t.selectAll("text.text_element").on("dblclick",function(o,r){let a=e.temporaryTextElement();e.renderer.setStyle(a.nativeElement,"display","initial"),e.renderer.setStyle(a.nativeElement,"transform",`scale(${e.mapScaleService.getScale()})`),e.editedElement=r;let c=o.currentTarget;Wt(c).attr("visibility","hidden"),Wt(c).classed("editingMode",!0),e.editingDrawingId=c.parentElement.parentElement.getAttribute("drawing_id");var p=c.parentElement.getAttribute("transform").split(/\(|\)/),u=Number(p[1].split(/,/)[0])*e.context.transformation.k+e.context.getZeroZeroTransformationPoint().x+e.context.transformation.x,h=c.getAttribute("transform"),_=0;if(h){var S=h.match(/translate\(0,\s*([^)]+)\)/);S&&(_=parseFloat(S[1])||0)}var x=(Number(p[1].split(/,/)[1])+_)*e.context.transformation.k+e.context.getZeroZeroTransformationPoint().y+e.context.transformation.y;e.leftPosition.set(u.toString()+"px"),e.topPosition.set(x.toString()+"px"),a.nativeElement.innerText=r.text,e.renderer.setStyle(a.nativeElement,"color",r.fill),e.renderer.setStyle(a.nativeElement,"font-family",r.font_family),e.renderer.setStyle(a.nativeElement,"font-size",`${r.font_size}pt`),e.renderer.setStyle(a.nativeElement,"font-weight",r.font_weight);let b=()=>{let M=e.temporaryTextElement().nativeElement.innerText;e.drawingsEventSource.textEdited.emit(new dS(e.editingDrawingId,M.replace(/\n$/,""),e.editedElement)),t.selectAll("text.editingMode").attr("visibility","visible").classed("editingMode",!1),e.innerText.set(""),a.nativeElement.innerText="",a.nativeElement.removeEventListener("focusout",e.textListener),e.clearStyle(),e.renderer.setStyle(a.nativeElement,"display","none")};e.textListener=b,a.nativeElement.addEventListener("focusout",e.textListener),a.nativeElement.focus()})}ngOnDestroy(){this.textAddingSubscription.unsubscribe()}clearStyle(){let e=this.temporaryTextElement();this.renderer.setStyle(e.nativeElement,"color","#000000"),this.renderer.setStyle(e.nativeElement,"font-family","Noto Sans"),this.renderer.setStyle(e.nativeElement,"font-size","11pt"),this.renderer.setStyle(e.nativeElement,"font-weight","bold")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-text-editor"]],viewQuery:function(t,o){t&1&&Xt(o.temporaryTextElement,h_e,5),t&2&&Kt()},inputs:{svg:[1,"svg"],controller:[1,"controller"]},decls:3,vars:5,consts:[["temporaryTextElement",""],["id","temporaryElement","contenteditable","true",1,"temporaryElement"]],template:function(t,o){t&1&&(vo(0,"div",1,0),d(2),wo()),t&2&&(nn("top",o.topPosition())("left",o.leftPosition()),m(2),ee(" ",o.innerText(),`
`))},styles:[".temporaryElement[_ngcontent-%COMP%]{padding-left:4px;width:fit-content;position:absolute;z-index:99;font-family:Noto Sans;font-size:11pt;font-weight:700;color:var(--mat-app-on-surface-color);vertical-align:top;line-height:1.2;transform-origin:top left}"],changeDetection:0})}return n})();var _z=(()=>{class n{svg=le(void 0);mapListener;drawingSelected;drawingsEventSource=f(Uo);context=f(Eo);ngOnInit(){this.drawingSelected=this.drawingsEventSource.selected.subscribe(e=>{e===""?this.deactivate():this.activate()})}activate(){let e=t=>{let o=(t.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x))/this.context.transformation.k,r=(t.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y))/this.context.transformation.k;this.drawingsEventSource.pointToAddSelected.emit(new sS(o,r)),this.deactivate()};this.deactivate(),this.mapListener=e,this.svg().addEventListener("click",this.mapListener)}deactivate(){this.svg().removeEventListener("click",this.mapListener)}ngOnDestroy(){this.drawingSelected.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-drawing-adding"]],inputs:{svg:[1,"svg"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var Ei=(()=>{class n extends Qd{getItemKey(e){return e.drawing_id}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Ri=(()=>{class n{httpController;svgToDrawingConverter;constructor(e,t){this.httpController=e,this.svgToDrawingConverter=t}add(e,t,o,r,a){return this.httpController.post(e,`/projects/${t}/drawings`,{svg:a,x:Math.round(o),y:Math.round(r),z:1})}duplicate(e,t,o){return this.httpController.post(e,`/projects/${t}/drawings`,{svg:o.svg,rotation:o.rotation,x:o.x+10,y:o.y+10,z:o.z})}updatePosition(e,t,o,r,a){let c=Math.round(r),p=Math.round(a);return t.snap_to_grid&&(o.element=this.svgToDrawingConverter.convert(o.svg),c=Math.round((c+o.element.width/2)/t.drawing_grid_size)*t.drawing_grid_size,p=Math.round((p+o.element.height/2)/t.drawing_grid_size)*t.drawing_grid_size,c=Math.round(c-o.element.width/2),p=Math.round(p-o.element.height/2)),this.httpController.put(e,`/projects/${o.project_id}/drawings/${o.drawing_id}`,{x:c,y:p})}updateSizeAndPosition(e,t,o,r,a){return this.httpController.put(e,`/projects/${t.project_id}/drawings/${t.drawing_id}`,{svg:a,x:Math.round(o),y:Math.round(r)})}updateText(e,t,o){return this.httpController.put(e,`/projects/${t.project_id}/drawings/${t.drawing_id}`,{svg:o,x:Math.round(t.x),y:Math.round(t.y),z:t.z})}update(e,t){return this.httpController.put(e,`/projects/${t.project_id}/drawings/${t.drawing_id}`,{locked:t.locked,svg:t.svg,rotation:t.rotation,x:Math.round(t.x),y:Math.round(t.y),z:t.z})}delete(e,t){return this.httpController.delete(e,`/projects/${t.project_id}/drawings/${t.drawing_id}`)}lockAllNodes(e,t){return this.httpController.post(e,`/projects/${t.project_id}/lock`,{})}unLockAllNodes(e,t){return this.httpController.post(e,`/projects/${t.project_id}/unlock`,{})}static \u0275fac=function(t){return new(t||n)(ge(mn),ge(ap))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var vz=(()=>{class n{svg=le(void 0);controller=le(void 0);project=le(void 0);isDrawing=!1;points=[];drawingSelected;svgSelection;canvasGroup;previewPath;drawingsEventSource=f(Uo);context=f(Eo);drawingsDataSource=f(Ei);drawingService=f(Ri);toolsService=f(gl);ngOnInit(){this.svgSelection=Wt(this.svg()),this.canvasGroup=this.svgSelection.select("g.canvas"),this.drawingSelected=this.drawingsEventSource.selected.subscribe(e=>{e==="curve"?this.activate():this.deactivate()})}activate(){let e=this;this.toolsService.selectionToolActivation(!1);let t=a=>{a.preventDefault(),a.stopPropagation();let c=e.getCanvasCoordinates(a);e.isDrawing=!0,e.points=[{x:c[0],y:c[1]}],e.createPreviewPath(),document.addEventListener("mousemove",o,{passive:!1}),document.addEventListener("mouseup",r,{passive:!1})},o=a=>{if(!e.isDrawing)return;a.preventDefault();let c=e.getCanvasCoordinates(a);e.points.push({x:c[0],y:c[1]}),e.updatePreviewPath()},r=a=>{e.isDrawing&&(a.preventDefault(),e.isDrawing=!1,document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),e.points.length>1&&e.createCurveDrawing(),e.removePreviewPath(),e.drawingsEventSource.drawingCompleted.emit("curve"))};this.svg()._curveDrawingListener=t,this.svg().addEventListener("mousedown",t)}deactivate(){this.toolsService.selectionToolActivation(!0);let e=this.svg()._curveDrawingListener;e&&(this.svg().removeEventListener("mousedown",e),delete this.svg()._curveDrawingListener),this.removePreviewPath(),this.isDrawing=!1,this.points=[]}getCanvasCoordinates(e){let t=this.canvasGroup.node(),o=this.context.transformation,r=this.context.getZeroZeroTransformationPoint(),a=(e.pageX-(r.x+o.x))/o.k,c=(e.pageY-(r.y+o.y))/o.k;return[a,c]}createPreviewPath(){this.canvasGroup.select("g.curve-preview").node()||this.canvasGroup.append("g").attr("class","curve-preview");let e=this.canvasGroup.select("g.curve-preview");this.previewPath=e.append("path").attr("stroke","var(--gns3-canvas-link-color)").attr("stroke-width","2").attr("fill","none").attr("stroke-dasharray","5,5")}updatePreviewPath(){if(!this.previewPath||this.points.length<2)return;let e=`M ${this.points[0].x} ${this.points[0].y}`;for(let t=1;t<this.points.length;t++)e+=` L ${this.points[t].x} ${this.points[t].y}`;this.previewPath.attr("d",e)}removePreviewPath(){this.previewPath&&(this.previewPath.remove(),this.previewPath=null),this.canvasGroup.select("g.curve-preview").remove()}createCurveDrawing(){let e=this.points.map(x=>x.x),t=this.points.map(x=>x.y),o=Math.min(...e),r=Math.max(...e),a=Math.min(...t),c=Math.max(...t),p=r-o,u=c-a,h=new ua;h.points=this.points.map(x=>({x:x.x-o,y:x.y-a}));let _=getComputedStyle(document.documentElement).getPropertyValue("--gns3-canvas-link-color").trim()||"var(--gns3-canvas-link-color)";h.stroke=_,h.stroke_width=3,h.stroke_dasharray="none",h.curve_type="none",h.arrow_start=!1,h.arrow_end=!1,h.width=p,h.height=u;let S=this.convertCurveToSvg(h);this.drawingService.add(this.controller(),this.project().project_id,o,a,S).subscribe(x=>{this.drawingsDataSource.add(x)})}convertCurveToSvg(e){let t="";if(e.points.length>0){t=`M ${e.points[0].x} ${e.points[0].y}`;for(let o=1;o<e.points.length;o++)t+=` L ${e.points[o].x} ${e.points[o].y}`}return`<svg xmlns="http://www.w3.org/2000/svg" width="${e.width}" height="${e.height}">
<path d="${t}" stroke="${e.stroke}" stroke-width="${e.stroke_width}"
fill="none" stroke-dasharray="${e.stroke_dasharray}"
data-curve-type="none"
data-arrow-start="${e.arrow_start}"
data-arrow-end="${e.arrow_end}" />
</svg>`}ngOnDestroy(){this.deactivate(),this.drawingSelected.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-curve-drawing"]],inputs:{svg:[1,"svg"],controller:[1,"controller"],project:[1,"project"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var g_e=["*"],Cz=(()=>{class n{resizingFinished;drawingsWidget=f(Zc);drawingsEventSource=f(Uo);ngOnInit(){this.resizingFinished=this.drawingsWidget.resizingFinished.subscribe(e=>{this.drawingsEventSource.resized.emit(new aS(e.datum,e.x,e.y,e.width,e.height,e.rotation))})}ngOnDestroy(){this.resizingFinished.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-drawing-resizing"]],ngContentSelectors:g_e,decls:1,vars:0,template:function(t,o){t&1&&(ii(),on(0))},encapsulation:2,changeDetection:0})}return n})();var IS=(()=>{class n{inRectangle(e,t,o){return e.x<=t&&t<e.x+e.width&&e.y<=o&&o<e.y+e.height}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var bz=(()=>{class n{onSelection;selectionEventSource=f(Rf);graphDataManager=f(Xm);inRectangleHelper=f(IS);selectionManager=f(Ho);cd=f(Q);ngOnInit(){this.onSelection=this.selectionEventSource.selected.subscribe(e=>{let t=this.graphDataManager.getNodes().filter(_=>this.inRectangleHelper.inRectangle(e,_.x,_.y)),o=this.graphDataManager.getLinks().filter(_=>this.inRectangleHelper.inRectangle(e,_.x,_.y)),r=this.graphDataManager.getDrawings().filter(_=>this.inRectangleHelper.inRectangle(e,_.x,_.y)),a=this.graphDataManager.getNodes().filter(_=>{if(_.label===void 0)return!1;let S=_.x+_.label.x,x=_.y+_.label.y;return this.inRectangleHelper.inRectangle(e,S,x)}).map(_=>_.label),c=this.graphDataManager.getLinks().filter(_=>{if(_.source===void 0||_.nodes.length!=2||_.nodes[0].label===void 0)return!1;let S=_.source.x+_.nodes[0].label.x,x=_.source.y+_.nodes[0].label.y;return this.inRectangleHelper.inRectangle(e,S,x)}).map(_=>_.nodes[0]),p=this.graphDataManager.getLinks().filter(_=>{if(_.target===void 0||_.nodes.length!=2||_.nodes[1].label===void 0)return!1;let S=_.target.x+_.nodes[1].label.x,x=_.target.y+_.nodes[1].label.y;return this.inRectangleHelper.inRectangle(e,S,x)}).map(_=>_.nodes[1]),u=[...c,...p],h=[...t,...o,...r,...a,...u];this.selectionManager.setSelected(h),this.cd.markForCheck()})}ngOnDestroy(){this.onSelection.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-selection-control"]],decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var xz=(()=>{class n{onSelected;onUnselected;selectionManager=f(Ho);mapChangeDetectorRef=f(Km);ngOnInit(){this.onSelected=this.selectionManager.selected.subscribe(()=>{this.mapChangeDetectorRef.detectSelectionChanges()}),this.onUnselected=this.selectionManager.unselected.subscribe(()=>{this.mapChangeDetectorRef.detectSelectionChanges()})}ngOnDestroy(){this.onSelected.unsubscribe(),this.onUnselected.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-selection-select"]],decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var yz=(()=>{class n{start;drag;end;mapSettingsSubscription;isMapLocked=!1;svg;nodesWidget=f(op);drawingsWidget=f(Zc);linksWidget=f(rp);labelWidget=f(ip);interfaceWidget=f(Xc);selectionManager=f(Ho);nodesEventSource=f(Ml);drawingsEventSource=f(Uo);graphDataManager=f(Xm);linksEventSource=f(Da);mapSettingsService=f(go);ngOnInit(){let e=Wt(this.svg);this.mapSettingsSubscription=this.mapSettingsService.isMapLocked.subscribe(t=>{this.isMapLocked=t}),this.start=Hn(this.nodesWidget.draggable.start,this.drawingsWidget.draggable.start,this.labelWidget.draggable.start,this.interfaceWidget.draggable.start).subscribe(t=>{let o=this.selectionManager.getSelected();t.datum instanceof _l&&o.filter(r=>r instanceof _l&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum]),t.datum instanceof Ea&&o.filter(r=>r instanceof Ea&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum]),t.datum instanceof Wl&&o.filter(r=>r instanceof Wl&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum]),t.datum instanceof Rd&&o.filter(r=>r instanceof Rd&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum])}),this.drag=Hn(this.nodesWidget.draggable.drag,this.drawingsWidget.draggable.drag,this.labelWidget.draggable.drag,this.interfaceWidget.draggable.drag).subscribe(t=>{if(!this.isMapLocked){let o=this.selectionManager.getSelected(),r=o.filter(b=>b instanceof _l),a=r.filter(b=>b.locked),c=r.filter(b=>!b.locked);c.forEach(b=>{b.x+=t.dx,b.y+=t.dy,this.nodesWidget.updateNodePosition(e,b),this.graphDataManager.getLinks().filter(w=>w.target!==void 0&&w.target.id===b.id||w.source!==void 0&&w.source.id===b.id).forEach(w=>{this.linksWidget.redrawLink(e,w)})}),o.filter(b=>b instanceof Ea).filter(b=>!b.locked).forEach(b=>{b.x+=t.dx,b.y+=t.dy,this.drawingsWidget.redrawDrawing(e,b)}),o.filter(b=>b instanceof Wl).filter(b=>a.filter(M=>M.id===b.nodeId).length===0).forEach(b=>{if(c.filter(y=>y.id===b.nodeId).length>0)return;let w=this.graphDataManager.getNodes().filter(y=>y.id===b.nodeId)[0];b.x+=t.dx,b.y+=t.dy,w.label.x=b.x,w.label.y=b.y,this.labelWidget.redrawLabel(e,b)}),o.filter(b=>b instanceof Rd).filter(b=>a.filter(M=>M.id===b.nodeId).length===0).forEach(b=>{if(c.filter(y=>y.id===b.nodeId).length>0)return;let w=this.graphDataManager.getLinks().filter(y=>y.nodes[0].id===b.id||y.nodes[1].id===b.id)[0];w.nodes[0].id===b.id&&(w.nodes[0].label.x+=t.dx,w.nodes[0].label.y+=t.dy),w.nodes[1].id===b.id&&(w.nodes[1].label.x+=t.dx,w.nodes[1].label.y+=t.dy),this.linksWidget.redrawLink(e,w)})}}),this.end=Hn(this.nodesWidget.draggable.end,this.drawingsWidget.draggable.end,this.labelWidget.draggable.end,this.interfaceWidget.draggable.end).subscribe(t=>{if(!this.isMapLocked){let o=this.selectionManager.getSelected(),r=o.filter(b=>b instanceof _l),a=r.filter(b=>b.locked),c=r.filter(b=>!b.locked);c.forEach(b=>{this.nodesEventSource.dragged.emit(new Pu(b,t.dx,t.dy))}),o.filter(b=>b instanceof Ea).filter(b=>!b.locked).forEach(b=>{this.drawingsEventSource.dragged.emit(new Pu(b,t.dx,t.dy))}),o.filter(b=>b instanceof Wl).filter(b=>a.filter(M=>M.id===b.nodeId).length===0).forEach(b=>{c.filter(w=>w.id===b.nodeId).length>0||this.nodesEventSource.labelDragged.emit(new Pu(b,t.dx,t.dy))}),o.filter(b=>b instanceof Rd).filter(b=>a.filter(M=>M.id===b.nodeId).length===0).forEach(b=>{c.filter(w=>w.id===b.nodeId).length>0||this.linksEventSource.interfaceDragged.emit(new Pu(b,t.dx,t.dy))})}})}ngOnDestroy(){this.start.unsubscribe(),this.drag.unsubscribe(),this.end.unsubscribe(),this.mapSettingsSubscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-draggable-selection"]],inputs:{svg:"svg"},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var Sz=(()=>{class n{linkEditedSubscription;svg=le(void 0);controller=le(void 0);linksWidget=f(rp);linksEventSource=f(Da);linksDataSource=f(zo);linkService=f(Fi);ngOnInit(){let e=Wt(this.svg());this.linkEditedSubscription=this.linksEventSource.edited.subscribe(t=>{this.linksWidget.redrawLink(e,t);let o=this.controller();if(o&&t.link_style?.control_offset!==void 0){let r=this.linksDataSource.get(t.id);r&&(r.link_style=K({},t.link_style),this.linkService.updateLinkStyle(o,r).subscribe({error:()=>{}}))}})}ngOnDestroy(){this.linkEditedSubscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-link-editing"]],inputs:{svg:[1,"svg"],controller:[1,"controller"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var sp=(()=>{class n{movingModeState=new ve;static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Mz=(()=>{class n{element;movingEventSource;context;mouseupListener=null;mousemoveListener=null;movingModeState;activated=!1;isDragging=!1;constructor(e,t,o){this.element=e,this.movingEventSource=t,this.context=o}ngOnInit(){this.movingModeState=this.movingEventSource.movingModeState.subscribe(e=>{this.activated=e,e||this.removelisteners()})}ngOnDestroy(){this.movingModeState.unsubscribe(),this.removelisteners()}onMouseDown(e){this.activated&&!this.isDragging&&(this.isDragging=!0,this.mousemoveListener=t=>{Wt(this.element.nativeElement).selectAll("g.canvas").data([this.context]).attr("transform",()=>{this.context.transformation.x=this.context.transformation.x+t.movementX,this.context.transformation.y=this.context.transformation.y+t.movementY;let a=this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x,c=this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y,p=this.context.transformation.k;return`translate(${a}, ${c}) scale(${p})`})},this.mouseupListener=t=>{this.isDragging=!1,this.removelisteners()},this.element.nativeElement.addEventListener("mousemove",this.mousemoveListener),document.addEventListener("mouseup",this.mouseupListener))}removelisteners(){this.mousemoveListener&&(this.element.nativeElement.removeEventListener("mousemove",this.mousemoveListener),this.mousemoveListener=null),this.mouseupListener&&(document.removeEventListener("mouseup",this.mouseupListener),this.mouseupListener=null),this.isDragging=!1}static \u0275fac=function(t){return new(t||n)(ot(Zt),ot(sp),ot(Eo))};static \u0275dir=ft({type:n,selectors:[["","appMovingCanvas",""]],hostBindings:function(t,o){t&1&&g("mousedown",function(a){return o.onMouseDown(a)})}})}return n})();var kz=(()=>{class n{element;renderer;movingEventSource;context;mapsScaleService;wheelListener;movingModeState;constructor(e,t,o,r,a){this.element=e,this.renderer=t,this.movingEventSource=o,this.context=r,this.mapsScaleService=a}ngOnInit(){this.renderer.setStyle(this.element.nativeElement,"touch-action","none"),this.renderer.setStyle(this.element.nativeElement,"-ms-touch-action","none"),this.movingModeState=this.movingEventSource.movingModeState.subscribe(e=>{e?this.addListener():this.removeListener()})}ngOnDestroy(){this.movingModeState.unsubscribe()}addListener(){this.wheelListener=e=>{e.stopPropagation();let t=e.deltaY;t=e.deltaMode===0?t/100:t/3,Wt(this.element.nativeElement).selectAll("g.canvas").data([this.context]).attr("transform",()=>{this.context.transformation.k=this.context.transformation.k-t/10;let a=this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x,c=this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y,p=this.context.transformation.k;return this.mapsScaleService.setScale(p),`translate(${a}, ${c}) scale(${p})`})},this.element.nativeElement.addEventListener("wheel",this.wheelListener,{passive:!0})}removeListener(){this.element.nativeElement.removeEventListener("wheel",this.wheelListener)}static \u0275fac=function(t){return new(t||n)(ot(Zt),ot(Si),ot(sp),ot(Eo),ot(zc))};static \u0275dir=ft({type:n,selectors:[["","appZoomingCanvas",""]]})}return n})();var __e=["svg"],v_e=["textEditor"];function C_e(n,i){if(n&1&&(ei(),s(0,"defs")(1,"pattern",7),R(2,"path",8),l(),s(3,"pattern",9),R(4,"path",8),l()(),R(5,"rect",10)(6,"rect",11)),n&2){let e=v();m(),qt("x",e.drawingGridX)("y",e.drawingGridY)("width",e.project().drawing_grid_size)("height",e.project().drawing_grid_size),m(),qt("d","M "+e.project().drawing_grid_size+" 0 L 0 0 0 "+e.project().drawing_grid_size)("stroke","var(--gns3-grid-drawing-color)")("stroke-width",1),m(),qt("x",e.nodeGridX)("y",e.nodeGridY)("width",e.project().grid_size)("height",e.project().grid_size),m(),qt("d","M "+e.project().grid_size+" 0 L 0 0 0 "+e.project().grid_size)("stroke","var(--gns3-grid-node-color)")("stroke-width",1)}}var AS=(()=>{class n{nodes=le([]);links=le([]);drawings=le([]);symbols=le([]);project=le(void 0);controller=le(void 0);width=le(1500);height=le(600);svgRef=Nt("svg");textEditor=Nt("textEditor");parentNativeElement;svg;onChangesDetected;subscriptions=[];drawLinkTool;settings={show_interface_labels:!0};gridVisibility=ae(0);nodeGridX=0;nodeGridY=0;drawingGridX=0;drawingGridY=0;graphDataManager=f(Xm);context=f(Eo);mapChangeDetectorRef=f(Km);canvasSizeDetector=f($x);mapSettings=f(Sl);element=f(Zt);interfaceLabelWidget=f(Xc);selectionToolWidget=f(tp);movingToolWidget=f(Ff);graphLayout=f(PS);toolsService=f(gl);mapScaleService=f(zc);mapSettingsService=f(go);constructor(){this.parentNativeElement=this.element.nativeElement,ha(()=>{this.project()&&this.mapChangeDetectorRef.hasBeenDrawn&&(this.updateGrid(),this.mapChangeDetectorRef.detectChanges())})}set showInterfaceLabels(e){e&&!this.mapSettingsService.integrateLinkLabelsToLinks?(this.settings.show_interface_labels=!0,this.interfaceLabelWidget.setEnabled(!0)):(this.settings.show_interface_labels=!1,this.interfaceLabelWidget.setEnabled(!1)),this.mapChangeDetectorRef.detectChanges()}set readonly(e){this.mapSettings.isReadOnly=e}resize(e){if(e)this.svg.attr("height",window.innerHeight+window.scrollY-16);else{let t=window.innerHeight-16;this.height()>t?this.svg.attr("height",this.height()):this.svg.attr("height",t)}}ngOnChanges(e){(e.width&&!e.width.isFirstChange()||e.height&&!e.height.isFirstChange()||e.drawings&&!e.drawings.isFirstChange()||e.nodes&&!e.nodes.isFirstChange()||e.links&&!e.links.isFirstChange()||e.symbols&&!e.symbols.isFirstChange())&&this.svg.empty&&!this.svg.empty()&&(e.symbols&&this.onSymbolsChange(e.symbols),this.changeLayout())}ngOnInit(){this.parentNativeElement!==null&&this.createGraph(this.parentNativeElement),this.context.size=this.getSize(),this.project()&&this.updateGrid(),this.onChangesDetected=this.mapChangeDetectorRef.changesDetected.subscribe(()=>{this.mapChangeDetectorRef.hasBeenDrawn&&setTimeout(()=>this.redraw())}),this.subscriptions.push(this.mapChangeDetectorRef.selectionChangesDetected.subscribe(()=>{this.mapChangeDetectorRef.hasBeenDrawn&&this.graphLayout.updateSelectionHighlights(this.svg)})),this.subscriptions.push(this.mapScaleService.scaleChangeEmitter.subscribe(r=>this.redraw())),this.subscriptions.push(this.toolsService.isMovingToolActivated.subscribe(r=>{this.movingToolWidget.setEnabled(r),this.mapChangeDetectorRef.detectChanges()})),this.subscriptions.push(this.toolsService.isSelectionToolActivated.subscribe(r=>{this.selectionToolWidget.setEnabled(r),this.mapChangeDetectorRef.detectChanges()})),this.subscriptions.push(this.toolsService.isDrawLinkToolActivated.subscribe(r=>{this.drawLinkTool=r})),this.gridVisibility.set(localStorage.getItem("gridVisibility")==="true"?1:0),this.mapSettingsService.isScrollDisabled.subscribe(r=>this.resize(r));let t=null,o=null;this.subscriptions.push(this.graphLayout.getNodesWidget().draggable.start.subscribe(()=>{let r=this.context.getZeroZeroTransformationPoint();t=r.x,o=r.y})),this.subscriptions.push(this.graphLayout.getNodesWidget().draggable.drag.subscribe(()=>{let r=this.getSize();this.context.centerX=t,this.context.centerY=o,(r.width>this.context.size.width||r.height>this.context.size.height)&&(this.context.size=r,this.svg.attr("width",r.width).attr("height",r.height))})),this.subscriptions.push(this.graphLayout.getNodesWidget().draggable.end.subscribe(()=>{let r=t??this.context.size.width/2,a=o??this.context.size.height/2,c=this.getSize(),p=this.context.centerX??c.width/2,u=this.context.centerY??c.height/2;window.scrollBy(p-r,u-a),this.context.size=c,this.svg.attr("width",c.width).attr("height",c.height),this.graphLayout.draw(this.svg,this.context),t=null,o=null}))}ngOnDestroy(){this.graphLayout.disconnect(this.svg),this.onChangesDetected.unsubscribe(),this.subscriptions.forEach(e=>{e.unsubscribe()})}applyMapSettingsChanges(){this.redraw()}createGraph(e){let t=Wt(e);this.svg=t.select("svg"),this.graphLayout.connect(this.svg,this.context),this.graphLayout.draw(this.svg,this.context),this.mapChangeDetectorRef.hasBeenDrawn=!0}getSize(){let e=document.documentElement.clientWidth,t=document.documentElement.clientHeight,o=this.graphDataManager.getNodes(),r=this.graphDataManager.getDrawings();if(o.length===0&&r.length===0)return this.context.centerX=null,this.context.centerY=null,new jm(e,t);let a=this.context.transformation.k,c=30,p=0,u=0,h=0,_=0;for(let E of o){let I=(E.width||60)*a,D=(E.height||60)*a,N=E.width?E.x*a:(E.x-30)*a,P=E.width?E.y*a:(E.y-30)*a;p=Math.min(p,N),u=Math.max(u,N+I),h=Math.min(h,P),_=Math.max(_,P+D)}for(let E of r)p=Math.min(p,E.x*a),u=Math.max(u,E.x*a),h=Math.min(h,E.y*a),_=Math.max(_,E.y*a);let S=e/2,x=t/2,b=Math.max(S,-p+c),M=Math.max(S,u+c),w=Math.max(x,-h+c),y=Math.max(x,_+c);return this.context.centerX=b,this.context.centerY=w,this.canvasSizeDetector.getOptimalSize(b+M,w+y)}changeLayout(){this.parentNativeElement!=null&&(this.context.size=this.getSize()),this.redraw()}onSymbolsChange(e){this.graphDataManager.setSymbols(this.symbols())}redraw(){this.updateGrid(),this.graphDataManager.setNodes(this.nodes()),this.graphDataManager.setLinks(this.links()),this.graphDataManager.setDrawings(this.drawings());let e=this.context.centerX,t=this.context.centerY;this.context.size=this.getSize(),this.context.centerX=e,this.context.centerY=t,this.graphLayout.draw(this.svg,this.context),this.textEditor().activateTextEditingForDrawings(),this.textEditor().activateTextEditingForNodeLabels(),this.mapSettingsService.mapRenderedEmitter.emit(!0)}updateGrid(){let e=this.project();e.grid_size&&e.grid_size>0&&(this.nodeGridX=this.context.size.width/2-Math.floor(this.context.size.width/2/e.grid_size)*e.grid_size),e.grid_size&&e.grid_size>0&&(this.nodeGridY=this.context.size.height/2-Math.floor(this.context.size.height/2/e.grid_size)*e.grid_size),e.drawing_grid_size&&e.drawing_grid_size>0&&(this.drawingGridX=this.context.size.width/2-Math.floor(this.context.size.width/2/e.drawing_grid_size)*e.drawing_grid_size),e.drawing_grid_size&&e.drawing_grid_size>0&&(this.drawingGridY=this.context.size.height/2-Math.floor(this.context.size.height/2/e.drawing_grid_size)*e.drawing_grid_size)}onResize(e){this.changeLayout()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-d3-map"]],viewQuery:function(t,o){t&1&&Xt(o.svgRef,__e,5)(o.textEditor,v_e,5),t&2&&Kt(2)},hostBindings:function(t,o){t&1&&g("resize",function(a){return o.onResize(a)},lr)},inputs:{nodes:[1,"nodes"],links:[1,"links"],drawings:[1,"drawings"],symbols:[1,"symbols"],project:[1,"project"],controller:[1,"controller"],width:[1,"width"],height:[1,"height"],showInterfaceLabels:[0,"show-interface-labels","showInterfaceLabels"],readonly:"readonly"},features:[bn],decls:12,vars:10,consts:[["svg",""],["textEditor",""],["id","map","preserveAspectRatio","none","appMovingCanvas","","appZoomingCanvas","",1,"map"],[3,"svg"],[3,"svg","controller","project"],[3,"controller","svg"],[3,"svg","controller"],["id","gridDrawing","patternUnits","userSpaceOnUse"],["fill","none"],["id","gridNode","patternUnits","userSpaceOnUse"],["width","100%","height","100%","fill","url(#gridDrawing)"],["width","100%","height","100%","fill","url(#gridNode)"]],template:function(t,o){if(t&1&&(ei(),s(0,"svg",2,0),A(2,C_e,7,14),l(),Ir(),R(3,"app-drawing-adding",3)(4,"app-curve-drawing",4)(5,"app-drawing-resizing")(6,"app-selection-control")(7,"app-selection-select")(8,"app-text-editor",5,1)(10,"app-draggable-selection",3)(11,"app-link-editing",6)),t&2){let r=Pe(1);m(2),O(o.gridVisibility()>0&&o.project()?2:-1),m(),C("svg",r),m(),C("svg",r)("controller",o.controller())("project",o.project()),m(4),C("controller",o.controller())("svg",r),m(2),C("svg",r),m(),C("svg",r)("controller",o.controller())}},dependencies:[gz,_z,vz,Cz,bz,xz,yz,Sz,Mz,kz],styles:["svg[_ngcontent-%COMP%]{display:block}"],changeDetection:0})}return n})();var OS=class{drawing_id;project_id;rotation;svg;locked;x;y;z;element};var NS=(()=>{class n{constructor(){}convert(e){let t=new OS;return t.drawing_id=e.id,t.project_id=e.projectId,t.rotation=e.rotation,t.svg=e.svg,t.locked=e.locked,t.x=e.x,t.y=e.y,t.z=e.z,t.element=e.element,t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var FS=class{rotation;style;text;x;y};var Jc=(()=>{class n{fontBBoxCalculator;cssFixer;fontFixer;constructor(e,t,o){this.fontBBoxCalculator=e,this.cssFixer=t,this.fontFixer=o}convert(e){let t=this.cssFixer.fix(e.style),o=this.fontFixer.fixStyles(t),r=this.fontBBoxCalculator.calculate(e.text,o),a=new FS;return a.rotation=e.rotation,a.style=e.style,a.text=e.text,a.x=e.x,a.y=e.y,a.x!==null&&(a.x-=3),a.y!==null&&(a.y-=r.height),a}static \u0275fac=function(t){return new(t||n)(ge($c),ge(xl),ge(ta))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var RS=class{node_id;adapter_number;port_number;label};var Uf=(()=>{class n{mapLabelToLabel;constructor(e){this.mapLabelToLabel=e}convert(e){let t=new RS;return t.node_id=e.nodeId,t.adapter_number=e.adapterNumber,t.port_number=e.portNumber,t.label=this.mapLabelToLabel.convert(e.label),t}static \u0275fac=function(t){return new(t||n)(ge(Jc))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var LS=class{capture_file_name;capture_file_path;capturing;filters;link_id;link_type;nodes;project_id;suspend;link_style;show_filters_icon;wireshark;distance;length;source;target;x;y};var VS=(()=>{class n{mapLinkNodeToMapLinkNode;constructor(e){this.mapLinkNodeToMapLinkNode=e}convert(e){let t=new LS;return t.link_id=e.id,t.capture_file_name=e.captureFileName,t.capture_file_path=e.captureFilePath,t.capturing=e.capturing,t.filters=e.filters,t.link_type=e.linkType,t.link_style=e.link_style,t.nodes=e.nodes.map(o=>this.mapLinkNodeToMapLinkNode.convert(o)),t.project_id=e.projectId,t.suspend=e.suspend,t.show_filters_icon=e.show_filters_icon,t.wireshark=e.wireshark,t}static \u0275fac=function(t){return new(t||n)(ge(Uf))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var BS=class{command_line;compute_id;console;console_auto_start;console_host;console_type;custom_adapters;ethernet_adapters;serial_adapters;first_port_name;height;label;locked;name;node_directory;node_id;node_type;port_name_format;port_segment_size;ports;project_id;properties;status;symbol;symbol_url;tags;usage;width;x;y;z;aux_type};var zS=class{adapter_number;adapter_type;link_type;name;port_number;short_name;available};var Gf=(()=>{class n{convert(e){let t=new zS;return t.adapter_number=e.adapterNumber,t.link_type=e.linkType,t.name=e.name,t.port_number=e.portNumber,t.short_name=e.shortName,t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var lp=(()=>{class n{mapLabelToLabel;mapPortToPort;constructor(e,t){this.mapLabelToLabel=e,this.mapPortToPort=t}convert(e){let t=new BS;return t.node_id=e.id,t.command_line=e.commandLine,t.compute_id=e.computeId,t.console=e.console,t.console_host=e.consoleHost,t.console_type=e.consoleType,t.first_port_name=e.firstPortName,t.height=e.height,t.label=e.label?this.mapLabelToLabel.convert(e.label):void 0,t.locked=e.locked,t.name=e.name,t.node_directory=e.nodeDirectory,t.node_type=e.nodeType,t.port_name_format=e.portNameFormat,t.port_segment_size=e.portSegmentSize,t.ports=e.ports?e.ports.map(o=>this.mapPortToPort.convert(o)):[],t.properties=e.properties,t.project_id=e.projectId,t.status=e.status,t.symbol=e.symbol,t.symbol_url=e.symbolUrl,t.usage=e.usage,t.width=e.width,t.x=e.x,t.y=e.y,t.z=e.z,t}static \u0275fac=function(t){return new(t||n)(ge(Jc),ge(Gf))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Wf=(()=>{class n{nodesDataSource;linksDataSource;drawingsDataSource;nodeNotificationEmitter=new ve;linkNotificationEmitter=new ve;drawingNotificationEmitter=new ve;infoNotificationEmitter=new ve;warningNotificationEmitter=new ve;errorNotificationEmitter=new ve;constructor(e,t,o){this.nodesDataSource=e,this.linksDataSource=t,this.drawingsDataSource=o}handleMessage(e){e.action==="node.updated"&&(this.nodesDataSource.update(e.event),this.nodeNotificationEmitter.emit(e)),e.action==="node.created"&&(this.nodesDataSource.add(e.event),this.nodeNotificationEmitter.emit(e)),e.action==="node.deleted"&&(this.nodesDataSource.remove(e.event),this.nodeNotificationEmitter.emit(e)),e.action==="link.created"&&(this.linksDataSource.add(e.event),this.linkNotificationEmitter.emit(e)),e.action==="link.updated"&&(this.linksDataSource.update(e.event),this.linkNotificationEmitter.emit(e)),e.action==="link.deleted"&&(this.linksDataSource.remove(e.event),this.linkNotificationEmitter.emit(e)),e.action==="drawing.created"&&(this.drawingsDataSource.add(e.event),this.drawingNotificationEmitter.emit(e)),e.action==="drawing.updated"&&(this.drawingsDataSource.update(e.event),this.drawingNotificationEmitter.emit(e)),e.action==="drawing.deleted"&&(this.drawingsDataSource.remove(e.event),this.drawingNotificationEmitter.emit(e)),e.action==="log.error"&&this.errorNotificationEmitter.emit(e.event.message),e.action==="log.warning"&&this.warningNotificationEmitter.emit(e.event.message),e.action==="log.info"&&this.infoNotificationEmitter.emit(e.event.message)}static \u0275fac=function(t){return new(t||n)(ge(di),ge(zo),ge(Ei))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var rr=(()=>{class n{router;toasterService;mapSettingsService;nodeConsoleTrigger=new ve;closeNodeConsoleTrigger=new He;consoleResized=new He;openConsoles=0;defaultConsoleWidth=720;defaultConsoleHeight=408;defaultNumberOfColumns=80;defaultNumberOfRows=24;lastNumberOfColumns;lastNumberOfRows;constructor(e,t,o){this.router=e,this.toasterService=t,this.mapSettingsService=o}getNumberOfColumns(){return this.lastNumberOfColumns}getNumberOfRows(){return this.lastNumberOfRows}setNumberOfColumns(e){this.lastNumberOfColumns=e}setNumberOfRows(e){this.lastNumberOfRows=e}openConsoleForNode(e){this.nodeConsoleTrigger.emit(e)}closeConsoleForNode(e){this.closeNodeConsoleTrigger.next(e)}resizeTerminal(e){this.consoleResized.next(e)}getLineWidth(){return this.defaultConsoleWidth/this.defaultNumberOfColumns}getLineHeight(){return this.defaultConsoleHeight/this.defaultNumberOfRows}getUrl(e,t){let o="ws";return e.protocol==="https:"&&(o="wss"),`${o}://${e.host}:${e.port}/${wi.current_version}/projects/${t.project_id}/nodes/${t.node_id}/console/ws?token=${e.authToken}`}openConsolesForAllNodesInWidget(e){let t="Please start the following nodes if you want to open consoles for them: ",o=0;e.forEach(r=>{r.console_type!=="none"&&(r.status==="started"?(this.mapSettingsService.logConsoleSubject.next(!0),setTimeout(()=>{this.openConsoleForNode(r)},500)):(o++,t+=r.name+" "))}),o>0&&this.toasterService.error(t)}openConsolesForAllNodesInNewTabs(e){let t="Please start the following nodes if you want to open consoles in tabs for them: ",o=0;e.forEach(r=>{if(r.console_type==="telnet"||r.console_type==="ssh")if(r.status==="started"){let a=this.router.url.split("/"),c=`/static/web-ui/${a[1]}/${a[2]}/${a[3]}/${a[4]}/nodes/${r.node_id}`;window.open(c)}else o++,t+=r.name+" "}),o>0&&this.toasterService.error(t)}static \u0275fac=function(t){return new(t||n)(ge(ht),ge(te),ge(go))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ed=(()=>{class n{minimizedWindowsSignal=ae([]);minimizedWindows=this.minimizedWindowsSignal.asReadonly();minimizeWindow(e,t,o){let r=this.minimizedWindowsSignal();r.find(a=>a.id===e)||this.minimizedWindowsSignal.set([...r,{id:e,type:t,linkId:o}])}restoreWindow(e){let t=this.minimizedWindowsSignal();this.minimizedWindowsSignal.set(t.filter(o=>o.id!==e))}isMinimized(e){return!!this.minimizedWindowsSignal().find(t=>t.id===e)}toggleMinimize(e,t,o){this.isMinimized(e)?this.restoreWindow(e):this.minimizeWindow(e,t,o)}getMinimizedByType(e){return this.minimizedWindowsSignal().filter(t=>t.type===e)}clearAll(){this.minimizedWindowsSignal.set([])}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Rs=(()=>{class n{get(e){var t=new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\"<>\?]/);return t.test(e.value)?{invalidName:!0}:null}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var w_e=n=>({"is-invalid":n});function M_e(n,i){n&1&&R(0,"mat-spinner",4)}function k_e(n,i){n&1&&(s(0,"mat-error"),d(1,"Project name contains invalid characters"),l())}function T_e(n,i){n&1&&(s(0,"mat-error"),d(1,"Project with this name already exists"),l())}function E_e(n,i){n&1&&(s(0,"span"),d(1,"Checking..."),l())}function D_e(n,i){n&1&&(s(0,"span"),d(1,"Add project"),l())}var qf=(()=>{class n{dialogRef=f(Ie);router=f(ht);projectService=f(ki);toasterService=f(te);projectNameValidator=f(Rs);controller;projectName=U("");uuid=ae("");isCheckingName=ae(!1);nameExistsError=ae(!1);onAddProject=new ve;isNameValid=Jt(()=>{let e=this.projectName();return!e||e.trim().length===0?!1:!this.projectNameValidator.get({value:e})});hasInvalidCharacters=Jt(()=>{let e=this.projectName();return!e||e.trim().length===0?!1:this.projectNameValidator.get({value:e})?.invalidName===!0});onAddClick(){this.isNameValid()&&this.checkProjectNameExists()}onNoClick(){this.dialogRef.close()}onKeyDown(e){e.key==="Enter"&&this.onAddClick()}checkProjectNameExists(){this.isCheckingName.set(!0),this.nameExistsError.set(!1),this.projectService.list(this.controller).subscribe({next:e=>{let t=this.projectName().trim(),o=e.find(r=>r.name===t);this.isCheckingName.set(!1),o?(this.nameExistsError.set(!0),this.toasterService.error("Project with this name already exists.")):this.addProject()},error:e=>{this.isCheckingName.set(!1);let t=e.error?.message||e.message||"Failed to check project name";this.toasterService.error(t)}})}addProject(){this.uuid.set(Ai()),this.projectService.add(this.controller,this.projectName().trim(),this.uuid()).subscribe({next:e=>{this.dialogRef.close(),this.toasterService.success(`Project ${e.name} added`),this.router.navigate(["/controller",this.controller.id,"project",e.project_id]),this.onAddProject.emit(e.project_id)},error:e=>{let t=e.error?.message||e.message||"Cannot create new project";this.toasterService.error(t)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-blank-project-dialog"]],inputs:{projectName:[1,"projectName"]},outputs:{projectName:"projectNameChange"},features:[fn([Rs])],decls:16,vars:11,consts:[["mat-dialog-title",""],[1,"file-name-form"],[1,"file-name-form-field"],["matInput","","type","text","placeholder","Please enter name",3,"input","keydown","value","ngClass","disabled"],["matSuffix","","diameter","20"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click","disabled"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click","disabled"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Create new project"),l(),s(2,"form",1)(3,"mat-form-field",2)(4,"mat-label"),d(5,"Project name"),l(),s(6,"input",3),g("input",function(a){return o.projectName.set(a.target.value)})("keydown",function(a){return o.onKeyDown(a)}),l(),A(7,M_e,1,0,"mat-spinner",4),A(8,k_e,2,0,"mat-error"),A(9,T_e,2,0,"mat-error"),l(),s(10,"div",5)(11,"button",6),g("click",function(){return o.onNoClick()}),d(12,"Cancel"),l(),s(13,"button",7),g("click",function(){return o.onAddClick()}),A(14,E_e,2,0,"span")(15,D_e,2,0,"span"),l()()()),t&2&&(m(6),C("value",o.projectName())("ngClass",dn(9,w_e,o.hasInvalidCharacters()||o.nameExistsError()))("disabled",o.isCheckingName()),m(),O(o.isCheckingName()?7:-1),m(),O(o.hasInvalidCharacters()?8:-1),m(),O(o.nameExistsError()?9:-1),m(2),C("disabled",o.isCheckingName()),m(2),C("disabled",!o.isNameValid()||o.isCheckingName()),m(),O(o.isCheckingName()?14:15))},dependencies:[ne,Yi,Xe,at,rt,Gn,_e,Ne,Fe,W,pe,we,Me,et,fi,Mi,Se,Ee,pn,li],styles:[".file-name-form[_ngcontent-%COMP%]{width:100%;padding:0 24px;box-sizing:border-box}.file-name-form-field[_ngcontent-%COMP%]{width:100%}.project-snackbar[_ngcontent-%COMP%]{background:var(--mat-sys-primary)}"],changeDetection:0})}return n})();var P_e=n=>({lightTheme:n}),Wa=(()=>{class n{data;bottomSheetRef=f(Vm);themeService=f(ci);message=ae("");isLightThemeEnabled=ae(!1);constructor(e){this.data=e}ngOnInit(){this.data&&this.data.message&&this.message.set(this.data.message),this.themeService.getActualTheme()==="light"?this.isLightThemeEnabled.set(!0):this.isLightThemeEnabled.set(!1)}onNoClick(){this.bottomSheetRef.dismiss(!1)}onYesClick(){this.bottomSheetRef.dismiss(!0)}static \u0275fac=function(t){return new(t||n)(ot(cP))};static \u0275cmp=F({type:n,selectors:[["app-confirmation-bottomsheet"]],decls:8,vars:4,consts:[[1,"dialogWrapper",3,"ngClass"],[1,"title"],[1,"dialogActions"],["mat-button","",1,"cancelBtn",3,"click"],["mat-button","",1,"confirmBtn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1),d(2),l(),s(3,"div",2)(4,"button",3),g("click",function(){return o.onNoClick()}),d(5,"No"),l(),s(6,"button",4),g("click",function(){return o.onYesClick()}),d(7,"Yes"),l()()()),t&2&&(C("ngClass",dn(2,P_e,o.isLightThemeEnabled())),m(2),j(o.message()))},dependencies:[ne,Yi,Bc,W,pe],styles:[".dialogWrapper[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container);color:var(--mat-sys-on-surface);padding:var(--mat-sys-spacing, 16px) 24px;margin-bottom:-8px;display:flex;justify-content:space-between;align-items:center;gap:16px;border-radius:28px 28px 0 0}.title[_ngcontent-%COMP%]{flex:1;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface);white-space:pre-line}.dialogActions[_ngcontent-%COMP%]{display:flex;gap:8px}.dialogActions[_ngcontent-%COMP%] .cancelBtn[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);border:1px solid var(--mat-sys-outline);padding:8px 16px;border-radius:20px;transition:all .2s cubic-bezier(.4,0,.2,1)}.dialogActions[_ngcontent-%COMP%] .cancelBtn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent);border-color:var(--mat-sys-on-surface-variant)}.dialogActions[_ngcontent-%COMP%] .confirmBtn[_ngcontent-%COMP%]{background-color:var(--mat-sys-error);color:var(--mat-sys-on-error);padding:8px 16px;border-radius:20px;transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 2px 6px color-mix(in srgb,var(--mat-sys-error) 25%,transparent)}.dialogActions[_ngcontent-%COMP%] .confirmBtn[_ngcontent-%COMP%]:hover{opacity:.9;transform:translateY(-1px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-error) 35%,transparent)}.dialogActions[_ngcontent-%COMP%] .confirmBtn[_ngcontent-%COMP%]:active{transform:translateY(0)}"],changeDetection:0})}return n})();function Ls(n){n||(n=f(Pl));let i=new Dr(e=>{if(n.destroyed){e.next();return}return n.onDestroy(e.next.bind(e))});return e=>e.pipe(tt(i))}function jS(n,i){let e=i?.injector??f(Jo),t=new Hd(1),o=ha(()=>{let r;try{r=n()}catch(a){lk(()=>t.error(a));return}lk(()=>t.next(r))},{injector:e,manualCleanup:!0});return e.get(Pl).onDestroy(()=>{o.destroy(),t.complete()}),t.asObservable()}function Ez(n,i){let t=!i?.manualCleanup?i?.injector?.get(Pl)??f(Pl):null,o=I_e(i?.equal),r;i?.requireSync?r=ae({kind:0},{equal:o}):r=ae({kind:1,value:i?.initialValue},{equal:o});let a,c=n.subscribe({next:p=>r.set({kind:1,value:p}),error:p=>{r.set({kind:2,error:p}),a?.()},complete:()=>{a?.()}});if(i?.requireSync&&r().kind===0)throw new yi(601,!1);return a=t?.onDestroy(c.unsubscribe.bind(c)),Jt(()=>{let p=r();switch(p.kind){case 1:return p.value;case 2:throw p.error;case 0:throw new yi(601,!1)}},{equal:i?.equal})}function I_e(n=Object.is){return(i,e)=>i.kind===1&&e.kind===1&&n(i.value,e.value)}function DA(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ou=DA();function Fz(n){Ou=n}var Iu={exec:()=>null};function Li(n,i=""){let e=typeof n=="string"?n:n.source,t={replace:(o,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(qa.caret,"$1"),e=e.replace(o,a),t},getRegex:()=>new RegExp(e,i)};return t}var A_e=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),qa={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},O_e=/^(?:[ \t]*(?:\n|$))+/,N_e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,F_e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fv=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,R_e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,PA=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Rz=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Lz=Li(Rz).replace(/bull/g,PA).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L_e=Li(Rz).replace(/bull/g,PA).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),IA=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,V_e=/^[^\n]+/,AA=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,B_e=Li(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",AA).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),z_e=Li(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,PA).getRegex(),GS="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",OA=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,j_e=Li("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",OA).replace("tag",GS).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vz=Li(IA).replace("hr",Fv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",GS).getRegex(),$_e=Li(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vz).getRegex(),NA={blockquote:$_e,code:N_e,def:B_e,fences:F_e,heading:R_e,hr:Fv,html:j_e,lheading:Lz,list:z_e,newline:O_e,paragraph:Vz,table:Iu,text:V_e},Dz=Li("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Fv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",GS).getRegex(),H_e=it(K({},NA),{lheading:L_e,table:Dz,paragraph:Li(IA).replace("hr",Fv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Dz).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",GS).getRegex()}),U_e=it(K({},NA),{html:Li(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",OA).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Iu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Li(IA).replace("hr",Fv).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Lz).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),G_e=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,W_e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bz=/^( {2,}|\\)\n(?!\s*$)/,q_e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qf=/[\p{P}\p{S}]/u,WS=/[\s\p{P}\p{S}]/u,FA=/[^\s\p{P}\p{S}]/u,Q_e=Li(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,WS).getRegex(),zz=/(?!~)[\p{P}\p{S}]/u,X_e=/(?!~)[\s\p{P}\p{S}]/u,K_e=/(?:[^\s\p{P}\p{S}]|~)/u,Y_e=Li(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",A_e?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jz=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Z_e=Li(jz,"u").replace(/punct/g,Qf).getRegex(),J_e=Li(jz,"u").replace(/punct/g,zz).getRegex(),$z="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",e0e=Li($z,"gu").replace(/notPunctSpace/g,FA).replace(/punctSpace/g,WS).replace(/punct/g,Qf).getRegex(),t0e=Li($z,"gu").replace(/notPunctSpace/g,K_e).replace(/punctSpace/g,X_e).replace(/punct/g,zz).getRegex(),n0e=Li("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,FA).replace(/punctSpace/g,WS).replace(/punct/g,Qf).getRegex(),i0e=Li(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Qf).getRegex(),o0e="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",r0e=Li(o0e,"gu").replace(/notPunctSpace/g,FA).replace(/punctSpace/g,WS).replace(/punct/g,Qf).getRegex(),a0e=Li(/\\(punct)/,"gu").replace(/punct/g,Qf).getRegex(),s0e=Li(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),l0e=Li(OA).replace("(?:-->|$)","-->").getRegex(),c0e=Li("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",l0e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),HS=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,d0e=Li(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",HS).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Hz=Li(/^!?\[(label)\]\[(ref)\]/).replace("label",HS).replace("ref",AA).getRegex(),Uz=Li(/^!?\[(ref)\](?:\[\])?/).replace("ref",AA).getRegex(),m0e=Li("reflink|nolink(?!\\()","g").replace("reflink",Hz).replace("nolink",Uz).getRegex(),Pz=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,RA={_backpedal:Iu,anyPunctuation:a0e,autolink:s0e,blockSkip:Y_e,br:Bz,code:W_e,del:Iu,delLDelim:Iu,delRDelim:Iu,emStrongLDelim:Z_e,emStrongRDelimAst:e0e,emStrongRDelimUnd:n0e,escape:G_e,link:d0e,nolink:Uz,punctuation:Q_e,reflink:Hz,reflinkSearch:m0e,tag:c0e,text:q_e,url:Iu},p0e=it(K({},RA),{link:Li(/^!?\[(label)\]\((.*?)\)/).replace("label",HS).getRegex(),reflink:Li(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",HS).getRegex()}),kA=it(K({},RA),{emStrongRDelimAst:t0e,emStrongLDelim:J_e,delLDelim:i0e,delRDelim:r0e,url:Li(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Pz).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Li(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Pz).getRegex()}),u0e=it(K({},kA),{br:Li(Bz).replace("{2,}","*").getRegex(),text:Li(kA.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),$S={normal:NA,gfm:H_e,pedantic:U_e},Av={normal:RA,gfm:kA,breaks:u0e,pedantic:p0e},h0e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Iz=n=>h0e[n];function td(n,i){if(i){if(qa.escapeTest.test(n))return n.replace(qa.escapeReplace,Iz)}else if(qa.escapeTestNoEncode.test(n))return n.replace(qa.escapeReplaceNoEncode,Iz);return n}function Az(n){try{n=encodeURI(n).replace(qa.percentDecode,"%")}catch{return null}return n}function Oz(n,i){let e=n.replace(qa.findPipe,(r,a,c)=>{let p=!1,u=a;for(;--u>=0&&c[u]==="\\";)p=!p;return p?"|":" |"}),t=e.split(qa.splitPipe),o=0;if(t[0].trim()||t.shift(),t.length>0&&!t.at(-1)?.trim()&&t.pop(),i)if(t.length>i)t.splice(i);else for(;t.length<i;)t.push("");for(;o<t.length;o++)t[o]=t[o].trim().replace(qa.slashPipe,"|");return t}function Ov(n,i,e){let t=n.length;if(t===0)return"";let o=0;for(;o<t;){let r=n.charAt(t-o-1);if(r===i&&!e)o++;else if(r!==i&&e)o++;else break}return n.slice(0,t-o)}function f0e(n,i){if(n.indexOf(i[1])===-1)return-1;let e=0;for(let t=0;t<n.length;t++)if(n[t]==="\\")t++;else if(n[t]===i[0])e++;else if(n[t]===i[1]&&(e--,e<0))return t;return e>0?-2:-1}function g0e(n,i=0){let e=i,t="";for(let o of n)if(o===" "){let r=4-e%4;t+=" ".repeat(r),e+=r}else t+=o,e++;return t}function Nz(n,i,e,t,o){let r=i.href,a=i.title||null,c=n[1].replace(o.other.outputLinkReplace,"$1");t.state.inLink=!0;let p={type:n[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:a,text:c,tokens:t.inlineTokens(c)};return t.state.inLink=!1,p}function _0e(n,i,e){let t=n.match(e.other.indentCodeCompensation);if(t===null)return i;let o=t[1];return i.split(`
`).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[c]=a;return c.length>=o.length?r.slice(o.length):r}).join(`
`)}var US=class{options;rules;lexer;constructor(n){this.options=n||Ou}space(n){let i=this.rules.block.newline.exec(n);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(n){let i=this.rules.block.code.exec(n);if(i){let e=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ov(e,`
`)}}}fences(n){let i=this.rules.block.fences.exec(n);if(i){let e=i[0],t=_0e(e,i[3]||"",this.rules);return{type:"code",raw:e,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:t}}}heading(n){let i=this.rules.block.heading.exec(n);if(i){let e=i[2].trim();if(this.rules.other.endingHash.test(e)){let t=Ov(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let i=this.rules.block.hr.exec(n);if(i)return{type:"hr",raw:Ov(i[0],`
`)}}blockquote(n){let i=this.rules.block.blockquote.exec(n);if(i){let e=Ov(i[0],`
`).split(`
`),t="",o="",r=[];for(;e.length>0;){let a=!1,c=[],p;for(p=0;p<e.length;p++)if(this.rules.other.blockquoteStart.test(e[p]))c.push(e[p]),a=!0;else if(!a)c.push(e[p]);else break;e=e.slice(p);let u=c.join(`
`),h=u.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}
${u}`:u,o=o?`${o}
${h}`:h;let _=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=_,e.length===0)break;let S=r.at(-1);if(S?.type==="code")break;if(S?.type==="blockquote"){let x=S,b=x.raw+`
`+e.join(`
`),M=this.blockquote(b);r[r.length-1]=M,t=t.substring(0,t.length-x.raw.length)+M.raw,o=o.substring(0,o.length-x.text.length)+M.text;break}else if(S?.type==="list"){let x=S,b=x.raw+`
`+e.join(`
`),M=this.list(b);r[r.length-1]=M,t=t.substring(0,t.length-S.raw.length)+M.raw,o=o.substring(0,o.length-x.raw.length)+M.raw,e=b.substring(r.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:t,tokens:r,text:o}}}list(n){let i=this.rules.block.list.exec(n);if(i){let e=i[1].trim(),t=e.length>1,o={type:"list",raw:"",ordered:t,start:t?+e.slice(0,-1):"",loose:!1,items:[]};e=t?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=t?e:"[*+-]");let r=this.rules.other.listItemRegex(e),a=!1;for(;n;){let p=!1,u="",h="";if(!(i=r.exec(n))||this.rules.block.hr.test(n))break;u=i[0],n=n.substring(u.length);let _=g0e(i[2].split(`
`,1)[0],i[1].length),S=n.split(`
`,1)[0],x=!_.trim(),b=0;if(this.options.pedantic?(b=2,h=_.trimStart()):x?b=i[1].length+1:(b=_.search(this.rules.other.nonSpaceChar),b=b>4?1:b,h=_.slice(b),b+=i[1].length),x&&this.rules.other.blankLine.test(S)&&(u+=S+`
`,n=n.substring(S.length+1),p=!0),!p){let M=this.rules.other.nextBulletRegex(b),w=this.rules.other.hrRegex(b),y=this.rules.other.fencesBeginRegex(b),E=this.rules.other.headingBeginRegex(b),I=this.rules.other.htmlBeginRegex(b),D=this.rules.other.blockquoteBeginRegex(b);for(;n;){let N=n.split(`
`,1)[0],P;if(S=N,this.options.pedantic?(S=S.replace(this.rules.other.listReplaceNesting," "),P=S):P=S.replace(this.rules.other.tabCharGlobal," "),y.test(S)||E.test(S)||I.test(S)||D.test(S)||M.test(S)||w.test(S))break;if(P.search(this.rules.other.nonSpaceChar)>=b||!S.trim())h+=`
`+P.slice(b);else{if(x||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(_)||E.test(_)||w.test(_))break;h+=`
`+S}x=!S.trim(),u+=N+`
`,n=n.substring(N.length+1),_=P.slice(b)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0)),o.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),o.raw+=u}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),p.tokens[0]?.type==="text"||p.tokens[0]?.type==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(p.raw);if(u){let h={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};p.checked=h.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=h.raw+p.tokens[0].raw,p.tokens[0].text=h.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(h)):p.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):p.tokens.unshift(h)}}if(!o.loose){let u=p.tokens.filter(_=>_.type==="space"),h=u.length>0&&u.some(_=>this.rules.other.anyLine.test(_.raw));o.loose=h}}if(o.loose)for(let p of o.items){p.loose=!0;for(let u of p.tokens)u.type==="text"&&(u.type="paragraph")}return o}}html(n){let i=this.rules.block.html.exec(n);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(n){let i=this.rules.block.def.exec(n);if(i){let e=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:e,raw:i[0],href:t,title:o}}}table(n){let i=this.rules.block.table.exec(n);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;let e=Oz(i[1]),t=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],r={type:"table",raw:i[0],header:[],align:[],rows:[]};if(e.length===t.length){for(let a of t)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<e.length;a++)r.header.push({text:e[a],tokens:this.lexer.inline(e[a]),header:!0,align:r.align[a]});for(let a of o)r.rows.push(Oz(a,r.header.length).map((c,p)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:r.align[p]})));return r}}lheading(n){let i=this.rules.block.lheading.exec(n);if(i){let e=i[1].trim();return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(n){let i=this.rules.block.paragraph.exec(n);if(i){let e=i[1].charAt(i[1].length-1)===`
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let i=this.rules.block.text.exec(n);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(n){let i=this.rules.inline.escape.exec(n);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(n){let i=this.rules.inline.tag.exec(n);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(n){let i=this.rules.inline.link.exec(n);if(i){let e=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=Ov(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=f0e(i[2],"()");if(r===-2)return;if(r>-1){let a=(i[0].indexOf("!")===0?5:4)+i[1].length+r;i[2]=i[2].substring(0,r),i[0]=i[0].substring(0,a).trim(),i[3]=""}}let t=i[2],o="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(t);r&&(t=r[1],o=r[3])}else o=i[3]?i[3].slice(1,-1):"";return t=t.trim(),this.rules.other.startAngleBracket.test(t)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?t=t.slice(1):t=t.slice(1,-1)),Nz(i,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(n,i){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let t=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=i[t.toLowerCase()];if(!o){let r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return Nz(e,o,e[0],this.lexer,this.rules)}}emStrong(n,i,e=""){let t=this.rules.inline.emStrongLDelim.exec(n);if(!(!t||!t[1]&&!t[2]&&!t[3]&&!t[4]||t[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(t[1]||t[3])||!e||this.rules.inline.punctuation.exec(e))){let o=[...t[0]].length-1,r,a,c=o,p=0,u=t[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,i=i.slice(-1*n.length+o);(t=u.exec(i))!=null;){if(r=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!r)continue;if(a=[...r].length,t[3]||t[4]){c+=a;continue}else if((t[5]||t[6])&&o%3&&!((o+a)%3)){p+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+p);let h=[...t[0]][0].length,_=n.slice(0,o+t.index+h+a);if(Math.min(o,a)%2){let x=_.slice(1,-1);return{type:"em",raw:_,text:x,tokens:this.lexer.inlineTokens(x)}}let S=_.slice(2,-2);return{type:"strong",raw:_,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(n){let i=this.rules.inline.code.exec(n);if(i){let e=i[2].replace(this.rules.other.newLineCharGlobal," "),t=this.rules.other.nonSpaceChar.test(e),o=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return t&&o&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:i[0],text:e}}}br(n){let i=this.rules.inline.br.exec(n);if(i)return{type:"br",raw:i[0]}}del(n,i,e=""){let t=this.rules.inline.delLDelim.exec(n);if(t&&(!t[1]||!e||this.rules.inline.punctuation.exec(e))){let o=[...t[0]].length-1,r,a,c=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,i=i.slice(-1*n.length+o);(t=p.exec(i))!=null;){if(r=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!r||(a=[...r].length,a!==o))continue;if(t[3]||t[4]){c+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c);let u=[...t[0]][0].length,h=n.slice(0,o+t.index+u+a),_=h.slice(o,-o);return{type:"del",raw:h,text:_,tokens:this.lexer.inlineTokens(_)}}}}autolink(n){let i=this.rules.inline.autolink.exec(n);if(i){let e,t;return i[2]==="@"?(e=i[1],t="mailto:"+e):(e=i[1],t=e),{type:"link",raw:i[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(n){let i;if(i=this.rules.inline.url.exec(n)){let e,t;if(i[2]==="@")e=i[0],t="mailto:"+e;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(o!==i[0]);e=i[0],i[1]==="www."?t="http://"+i[0]:t=i[0]}return{type:"link",raw:i[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(n){let i=this.rules.inline.text.exec(n);if(i){let e=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:e}}}},Zl=class TA{tokens;options;state;inlineQueue;tokenizer;constructor(i){this.tokens=[],this.tokens.links=Object.create(null),this.options=i||Ou,this.options.tokenizer=this.options.tokenizer||new US,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:qa,block:$S.normal,inline:Av.normal};this.options.pedantic?(e.block=$S.pedantic,e.inline=Av.pedantic):this.options.gfm&&(e.block=$S.gfm,this.options.breaks?e.inline=Av.breaks:e.inline=Av.gfm),this.tokenizer.rules=e}static get rules(){return{block:$S,inline:Av}}static lex(i,e){return new TA(e).lex(i)}static lexInline(i,e){return new TA(e).inlineTokens(i)}lex(i){i=i.replace(qa.carriageReturn,`
`),this.blockTokens(i,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,e=[],t=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(i=i.replace(qa.tabCharGlobal," ").replace(qa.spaceLine,""));i;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},i,e))?(i=i.substring(o.raw.length),e.push(o),!0):!1))continue;if(o=this.tokenizer.space(i)){i=i.substring(o.raw.length);let a=e.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
`:e.push(o);continue}if(o=this.tokenizer.code(i)){i=i.substring(o.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+o.raw,a.text+=`
`+o.text,this.inlineQueue.at(-1).src=a.text):e.push(o);continue}if(o=this.tokenizer.fences(i)){i=i.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.heading(i)){i=i.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.hr(i)){i=i.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.blockquote(i)){i=i.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.list(i)){i=i.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.html(i)){i=i.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.def(i)){i=i.substring(o.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+o.raw,a.text+=`
`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},e.push(o));continue}if(o=this.tokenizer.table(i)){i=i.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.lheading(i)){i=i.substring(o.raw.length),e.push(o);continue}let r=i;if(this.options.extensions?.startBlock){let a=1/0,c=i.slice(1),p;this.options.extensions.startBlock.forEach(u=>{p=u.call({lexer:this},c),typeof p=="number"&&p>=0&&(a=Math.min(a,p))}),a<1/0&&a>=0&&(r=i.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(r))){let a=e.at(-1);t&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+o.raw,a.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(o),t=r.length!==i.length,i=i.substring(o.raw.length);continue}if(o=this.tokenizer.text(i)){i=i.substring(o.raw.length);let a=e.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
`)?"":`
`)+o.raw,a.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(o);continue}if(i){let a="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,e}inline(i,e=[]){return this.inlineQueue.push({src:i,tokens:e}),e}inlineTokens(i,e=[]){this.tokenizer.lexer=this;let t=i,o=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(t))!=null;)p.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(t=t.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(t))!=null;)t=t.slice(0,o.index)+"++"+t.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(t))!=null;)r=o[2]?o[2].length:0,t=t.slice(0,o.index+r)+"["+"a".repeat(o[0].length-r-2)+"]"+t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t;let a=!1,c="";for(;i;){a||(c=""),a=!1;let p;if(this.options.extensions?.inline?.some(h=>(p=h.call({lexer:this},i,e))?(i=i.substring(p.raw.length),e.push(p),!0):!1))continue;if(p=this.tokenizer.escape(i)){i=i.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.tag(i)){i=i.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.link(i)){i=i.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(p.raw.length);let h=e.at(-1);p.type==="text"&&h?.type==="text"?(h.raw+=p.raw,h.text+=p.text):e.push(p);continue}if(p=this.tokenizer.emStrong(i,t,c)){i=i.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.codespan(i)){i=i.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.br(i)){i=i.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.del(i,t,c)){i=i.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.autolink(i)){i=i.substring(p.raw.length),e.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(i))){i=i.substring(p.raw.length),e.push(p);continue}let u=i;if(this.options.extensions?.startInline){let h=1/0,_=i.slice(1),S;this.options.extensions.startInline.forEach(x=>{S=x.call({lexer:this},_),typeof S=="number"&&S>=0&&(h=Math.min(h,S))}),h<1/0&&h>=0&&(u=i.substring(0,h+1))}if(p=this.tokenizer.inlineText(u)){i=i.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(c=p.raw.slice(-1)),a=!0;let h=e.at(-1);h?.type==="text"?(h.raw+=p.raw,h.text+=p.text):e.push(p);continue}if(i){let h="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return e}},cp=class{options;parser;constructor(n){this.options=n||Ou}space(n){return""}code({text:n,lang:i,escaped:e}){let t=(i||"").match(qa.notSpaceStart)?.[0],o=n.replace(qa.endingNewline,"")+`
`;return t?'<pre><code class="language-'+td(t)+'">'+(e?o:td(o,!0))+`</code></pre>
`:"<pre><code>"+(e?o:td(o,!0))+`</code></pre>
`}blockquote({tokens:n}){return`<blockquote>
${this.parser.parse(n)}</blockquote>
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:i}){return`<h${i}>${this.parser.parseInline(n)}</h${i}>
`}hr(n){return`<hr>
`}list(n){let i=n.ordered,e=n.start,t="";for(let a=0;a<n.items.length;a++){let c=n.items[a];t+=this.listitem(c)}let o=i?"ol":"ul",r=i&&e!==1?' start="'+e+'"':"";return"<"+o+r+`>
`+t+"</"+o+`>
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
`}table(n){let i="",e="";for(let o=0;o<n.header.length;o++)e+=this.tablecell(n.header[o]);i+=this.tablerow({text:e});let t="";for(let o=0;o<n.rows.length;o++){let r=n.rows[o];e="";for(let a=0;a<r.length;a++)e+=this.tablecell(r[a]);t+=this.tablerow({text:e})}return t&&(t=`<tbody>${t}</tbody>`),`<table>
<thead>
`+i+`</thead>
`+t+`</table>
`}tablerow({text:n}){return`<tr>
${n}</tr>
`}tablecell(n){let i=this.parser.parseInline(n.tokens),e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+i+`</${e}>
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${td(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:i,tokens:e}){let t=this.parser.parseInline(e),o=Az(n);if(o===null)return t;n=o;let r='<a href="'+n+'"';return i&&(r+=' title="'+td(i)+'"'),r+=">"+t+"</a>",r}image({href:n,title:i,text:e,tokens:t}){t&&(e=this.parser.parseInline(t,this.parser.textRenderer));let o=Az(n);if(o===null)return td(e);n=o;let r=`<img src="${n}" alt="${td(e)}"`;return i&&(r+=` title="${td(i)}"`),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:td(n.text)}},LA=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Jl=class EA{options;renderer;textRenderer;constructor(i){this.options=i||Ou,this.options.renderer=this.options.renderer||new cp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new LA}static parse(i,e){return new EA(e).parse(i)}static parseInline(i,e){return new EA(e).parseInline(i)}parse(i){this.renderer.parser=this;let e="";for(let t=0;t<i.length;t++){let o=i[t];if(this.options.extensions?.renderers?.[o.type]){let a=o,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){e+=c||"";continue}}let r=o;switch(r.type){case"space":{e+=this.renderer.space(r);break}case"hr":{e+=this.renderer.hr(r);break}case"heading":{e+=this.renderer.heading(r);break}case"code":{e+=this.renderer.code(r);break}case"table":{e+=this.renderer.table(r);break}case"blockquote":{e+=this.renderer.blockquote(r);break}case"list":{e+=this.renderer.list(r);break}case"checkbox":{e+=this.renderer.checkbox(r);break}case"html":{e+=this.renderer.html(r);break}case"def":{e+=this.renderer.def(r);break}case"paragraph":{e+=this.renderer.paragraph(r);break}case"text":{e+=this.renderer.text(r);break}default:{let a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return e}parseInline(i,e=this.renderer){this.renderer.parser=this;let t="";for(let o=0;o<i.length;o++){let r=i[o];if(this.options.extensions?.renderers?.[r.type]){let c=this.options.extensions.renderers[r.type].call({parser:this},r);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){t+=c||"";continue}}let a=r;switch(a.type){case"escape":{t+=e.text(a);break}case"html":{t+=e.html(a);break}case"link":{t+=e.link(a);break}case"image":{t+=e.image(a);break}case"checkbox":{t+=e.checkbox(a);break}case"strong":{t+=e.strong(a);break}case"em":{t+=e.em(a);break}case"codespan":{t+=e.codespan(a);break}case"br":{t+=e.br(a);break}case"del":{t+=e.del(a);break}case"text":{t+=e.text(a);break}default:{let c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return t}},Nv=class{options;block;constructor(n){this.options=n||Ou}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Zl.lex:Zl.lexInline}provideParser(){return this.block?Jl.parse:Jl.parseInline}},v0e=class{defaults=DA();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Jl;Renderer=cp;TextRenderer=LA;Lexer=Zl;Tokenizer=US;Hooks=Nv;constructor(...n){this.use(...n)}walkTokens(n,i){let e=[];for(let t of n)switch(e=e.concat(i.call(this,t)),t.type){case"table":{let o=t;for(let r of o.header)e=e.concat(this.walkTokens(r.tokens,i));for(let r of o.rows)for(let a of r)e=e.concat(this.walkTokens(a.tokens,i));break}case"list":{let o=t;e=e.concat(this.walkTokens(o.items,i));break}default:{let o=t;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(r=>{let a=o[r].flat(1/0);e=e.concat(this.walkTokens(a,i))}):o.tokens&&(e=e.concat(this.walkTokens(o.tokens,i)))}}return e}use(...n){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let t=K({},e);if(t.async=this.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let r=i.renderers[o.name];r?i.renderers[o.name]=function(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:i.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=i[o.level];r?r.unshift(o.tokenizer):i[o.level]=[o.tokenizer],o.start&&(o.level==="block"?i.startBlock?i.startBlock.push(o.start):i.startBlock=[o.start]:o.level==="inline"&&(i.startInline?i.startInline.push(o.start):i.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(i.childTokens[o.name]=o.childTokens)}),t.extensions=i),e.renderer){let o=this.defaults.renderer||new cp(this.defaults);for(let r in e.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,c=e.renderer[a],p=o[a];o[a]=(...u)=>{let h=c.apply(o,u);return h===!1&&(h=p.apply(o,u)),h||""}}t.renderer=o}if(e.tokenizer){let o=this.defaults.tokenizer||new US(this.defaults);for(let r in e.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,c=e.tokenizer[a],p=o[a];o[a]=(...u)=>{let h=c.apply(o,u);return h===!1&&(h=p.apply(o,u)),h}}t.tokenizer=o}if(e.hooks){let o=this.defaults.hooks||new Nv;for(let r in e.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,c=e.hooks[a],p=o[a];Nv.passThroughHooks.has(r)?o[a]=u=>{if(this.defaults.async&&Nv.passThroughHooksRespectAsync.has(r))return(async()=>{let _=await c.call(o,u);return p.call(o,_)})();let h=c.call(o,u);return p.call(o,h)}:o[a]=(...u)=>{if(this.defaults.async)return(async()=>{let _=await c.apply(o,u);return _===!1&&(_=await p.apply(o,u)),_})();let h=c.apply(o,u);return h===!1&&(h=p.apply(o,u)),h}}t.hooks=o}if(e.walkTokens){let o=this.defaults.walkTokens,r=e.walkTokens;t.walkTokens=function(a){let c=[];return c.push(r.call(this,a)),o&&(c=c.concat(o.call(this,a))),c}}this.defaults=K(K({},this.defaults),t)}),this}setOptions(n){return this.defaults=K(K({},this.defaults),n),this}lexer(n,i){return Zl.lex(n,i??this.defaults)}parser(n,i){return Jl.parse(n,i??this.defaults)}parseMarkdown(n){return(i,e)=>{let t=K({},e),o=K(K({},this.defaults),t),r=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&t.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof i>"u"||i===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(i):i,c=await(o.hooks?await o.hooks.provideLexer():n?Zl.lex:Zl.lexInline)(a,o),p=o.hooks?await o.hooks.processAllTokens(c):c;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let u=await(o.hooks?await o.hooks.provideParser():n?Jl.parse:Jl.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(u):u})().catch(r);try{o.hooks&&(i=o.hooks.preprocess(i));let a=(o.hooks?o.hooks.provideLexer():n?Zl.lex:Zl.lexInline)(i,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():n?Jl.parse:Jl.parseInline)(a,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(a){return r(a)}}}onError(n,i){return e=>{if(e.message+=`
Please report this to https://github.com/markedjs/marked.`,n){let t="<p>An error occurred:</p><pre>"+td(e.message+"",!0)+"</pre>";return i?Promise.resolve(t):t}if(i)return Promise.reject(e);throw e}}},Au=new v0e;function Di(n,i){return Au.parse(n,i)}Di.options=Di.setOptions=function(n){return Au.setOptions(n),Di.defaults=Au.defaults,Fz(Di.defaults),Di};Di.getDefaults=DA;Di.defaults=Ou;Di.use=function(...n){return Au.use(...n),Di.defaults=Au.defaults,Fz(Di.defaults),Di};Di.walkTokens=function(n,i){return Au.walkTokens(n,i)};Di.parseInline=Au.parseInline;Di.Parser=Jl;Di.parser=Jl.parse;Di.Renderer=cp;Di.TextRenderer=LA;Di.Lexer=Zl;Di.lexer=Zl.lex;Di.Tokenizer=US;Di.Hooks=Nv;Di.parse=Di;var k_t=Di.options,T_t=Di.setOptions,E_t=Di.use,D_t=Di.walkTokens,P_t=Di.parseInline;var I_t=Jl.parse,A_t=Zl.lex;var C0e=["*"],b0e="Copy",x0e="Copied",y0e=(()=>{class n{constructor(){this._buttonClick$=new He,this.copied=Ez(this._buttonClick$.pipe(Un(()=>Hn(Nn(!0),Qa(3e3).pipe(CO(!1)))),gp(),_p(1))),this.copiedText=Jt(()=>this.copied()?x0e:b0e)}onCopyToClipboardClick(){this._buttonClick$.next()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=F({type:n,selectors:[["markdown-clipboard"]],decls:2,vars:3,consts:[[1,"markdown-clipboard-button",3,"click"]],template:function(t,o){t&1&&(vo(0,"button",0),Jv("click",function(){return o.onCopyToClipboardClick()}),d(1),wo()),t&2&&(Be("copied",o.copied()),m(),j(o.copiedText()))},encapsulation:2,changeDetection:0})}}return n})(),S0e=new cn("CLIPBOARD_OPTIONS");var w0e=new cn("MARKED_EXTENSIONS"),M0e=new cn("MARKED_OPTIONS"),k0e=new cn("MERMAID_OPTIONS"),T0e=new cn("SANITIZE");function E0e(n){return typeof n=="function"}var D0e="[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information",P0e="[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information",I0e="[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information",A0e="[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information",O0e="[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function",N0e="[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information";var Gz=(()=>{class n{get options(){return this._options}set options(e){this._options=K(K({},this.DEFAULT_MARKED_OPTIONS),e)}get renderer(){return this.options.renderer}set renderer(e){this.options.renderer=e}constructor(){this.clipboardOptions=f(S0e,{optional:!0}),this.extensions=f(w0e,{optional:!0}),this.http=f(js,{optional:!0}),this.mermaidOptions=f(k0e,{optional:!0}),this.platform=f(Bu),this.sanitize=f(T0e,{optional:!0}),this.sanitizer=f(fr),this.DEFAULT_MARKED_OPTIONS={renderer:new cp},this.DEFAULT_KATEX_OPTIONS={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}]},this.DEFAULT_MERMAID_OPTIONS={startOnLoad:!1},this.DEFAULT_CLIPBOARD_OPTIONS={buttonComponent:void 0},this.DEFAULT_PARSE_OPTIONS={decodeHtml:!1,inline:!1,emoji:!1,mermaid:!1,markedOptions:void 0,disableSanitizer:!1},this.DEFAULT_RENDER_OPTIONS={clipboard:!1,clipboardOptions:void 0,katex:!1,katexOptions:void 0,mermaid:!1,mermaidOptions:void 0},this.DEFAULT_SECURITY_CONTEXT=sk.HTML,this._options=null,this._reload$=new He,this.reload$=this._reload$.asObservable(),this.options=f(M0e,{optional:!0})}parse(e,t=this.DEFAULT_PARSE_OPTIONS){let{decodeHtml:o,inline:r,emoji:a,mermaid:c,disableSanitizer:p}=t,u=K(K({},this.options),t.markedOptions),h=u.renderer||this.renderer||new cp;this.extensions&&(this.renderer=this.extendsRendererForExtensions(h)),c&&(this.renderer=this.extendsRendererForMermaid(h));let _=this.trimIndentation(e),S=o?this.decodeHtml(_):_,x=a?this.parseEmoji(S):S,b=this.parseMarked(x,u,r);return p?b:this.sanitizeHtml(b)}render(e,t=this.DEFAULT_RENDER_OPTIONS,o){let{clipboard:r,clipboardOptions:a,katex:c,katexOptions:p,mermaid:u,mermaidOptions:h}=t;c&&this.renderKatex(e,K(K({},this.DEFAULT_KATEX_OPTIONS),p)),u&&this.renderMermaid(e,K(K(K({},this.DEFAULT_MERMAID_OPTIONS),this.mermaidOptions),h)),r&&this.renderClipboard(e,o,K(K(K({},this.DEFAULT_CLIPBOARD_OPTIONS),this.clipboardOptions),a)),this.highlight(e)}reload(){this._reload$.next()}getSource(e){if(!this.http)throw new Error(N0e);return this.http.get(e,{responseType:"text"}).pipe(Lt(t=>this.handleExtension(e,t)))}highlight(e){if(!xs(this.platform)||typeof Prism>"u"||typeof Prism.highlightAllUnder>"u")return;e||(e=document);let t=e.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(t,o=>o.classList.add("language-none")),Prism.highlightAllUnder(e)}decodeHtml(e){if(!xs(this.platform))return e;let t=document.createElement("textarea");return t.innerHTML=e,t.value}extendsRendererForExtensions(e){let t=e;return t.\u0275NgxMarkdownRendererExtendedForExtensions===!0||(this.extensions&&this.extensions.length>0&&Di.use(...this.extensions),t.\u0275NgxMarkdownRendererExtendedForExtensions=!0),e}extendsRendererForMermaid(e){let t=e;if(t.\u0275NgxMarkdownRendererExtendedForMermaid===!0)return e;let o=e.code;return e.code=r=>r.lang==="mermaid"?`<div class="mermaid">${r.text}</div>`:o(r),t.\u0275NgxMarkdownRendererExtendedForMermaid=!0,e}handleExtension(e,t){let o=e.lastIndexOf("://"),r=o>-1?e.substring(o+4):e,a=r.lastIndexOf("/"),c=a>-1?r.substring(a+1).split("?")[0]:"",p=c.lastIndexOf("."),u=p>-1?c.substring(p+1):"";return u&&u!=="md"?"```"+u+`
`+t+"\n```":t}parseMarked(e,t,o=!1){if(t.renderer){let r=K({},t.renderer);delete r.\u0275NgxMarkdownRendererExtendedForExtensions,delete r.\u0275NgxMarkdownRendererExtendedForMermaid,delete t.renderer,Di.use({renderer:r})}return o?Di.parseInline(e,t):Di.parse(e,t)}parseEmoji(e){if(!xs(this.platform))return e;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error(D0e);return joypixels.shortnameToUnicode(e)}renderKatex(e,t){if(xs(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error(P0e);renderMathInElement(e,t)}}renderClipboard(e,t,o){if(!xs(this.platform))return;if(typeof ClipboardJS>"u")throw new Error(A0e);if(!t)throw new Error(O0e);let{buttonComponent:r,buttonTemplate:a}=o,c=e.querySelectorAll("pre");for(let p=0;p<c.length;p++){let u=c.item(p),h=document.createElement("div");h.style.position="relative",u.parentNode.insertBefore(h,u),h.appendChild(u);let _=document.createElement("div");_.classList.add("markdown-clipboard-toolbar"),_.style.position="absolute",_.style.top=".5em",_.style.right=".5em",_.style.zIndex="1",h.insertAdjacentElement("beforeend",_),h.onmouseenter=()=>_.classList.add("hover"),h.onmouseleave=()=>_.classList.remove("hover");let S;if(r){let b=t.createComponent(r);S=b.hostView,b.changeDetectorRef.markForCheck()}else if(a)S=t.createEmbeddedView(a);else{let b=t.createComponent(y0e);S=b.hostView,b.changeDetectorRef.markForCheck()}let x;S.rootNodes.forEach(b=>{_.appendChild(b),x=new ClipboardJS(b,{text:()=>u.innerText})}),S.onDestroy(()=>x.destroy())}}renderMermaid(e,t=this.DEFAULT_MERMAID_OPTIONS){if(!xs(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.initialize>"u")throw new Error(I0e);let o=e.querySelectorAll(".mermaid");o.length!==0&&(mermaid.initialize(t),mermaid.run({nodes:o}))}trimIndentation(e){if(!e)return"";let t;return e.split(`
`).map(o=>{let r=t;return o.length>0&&(r=isNaN(r)?o.search(/\S|$/):Math.min(o.search(/\S|$/),r)),isNaN(t)&&(t=r),r?o.substring(r):o}).join(`
`)}async sanitizeHtml(e){return E0e(this.sanitize)?this.sanitize(await e):this.sanitize!==sk.NONE?this.sanitizer.sanitize(this.sanitize??this.DEFAULT_SECURITY_CONTEXT,e)??"":e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=J({token:n,factory:n.\u0275fac})}}return n})(),VA=(function(n){return n.CommandLine="command-line",n.LineHighlight="line-highlight",n.LineNumbers="line-numbers",n})(VA||{}),qS=(()=>{class n{constructor(){this.element=f(Zt),this.markdownService=f(Gz),this.viewContainerRef=f(oo),this.error=new ve,this.load=new ve,this.ready=new ve,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new He}get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(e){this._disableSanitizer=this.coerceBooleanProperty(e)}get inline(){return this._inline}set inline(e){this._inline=this.coerceBooleanProperty(e)}get clipboard(){return this._clipboard}set clipboard(e){this._clipboard=this.coerceBooleanProperty(e)}get emoji(){return this._emoji}set emoji(e){this._emoji=this.coerceBooleanProperty(e)}get katex(){return this._katex}set katex(e){this._katex=this.coerceBooleanProperty(e)}get mermaid(){return this._mermaid}set mermaid(e){this._mermaid=this.coerceBooleanProperty(e)}get lineHighlight(){return this._lineHighlight}set lineHighlight(e){this._lineHighlight=this.coerceBooleanProperty(e)}get lineNumbers(){return this._lineNumbers}set lineNumbers(e){this._lineNumbers=this.coerceBooleanProperty(e)}get commandLine(){return this._commandLine}set commandLine(e){this._commandLine=this.coerceBooleanProperty(e)}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(tt(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}async render(e,t=!1){let o={decodeHtml:t,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},r={clipboard:this.clipboard,clipboardOptions:this.getClipboardOptions(),katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},a=await this.markdownService.parse(e,o);this.element.nativeElement.innerHTML=a,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,r,this.viewContainerRef),this.ready.emit()}coerceBooleanProperty(e){return e!=null&&`${String(e)}`!="false"}getClipboardOptions(){if(this.clipboardButtonComponent||this.clipboardButtonTemplate)return{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate}}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:e=>{this.render(e).then(()=>{this.load.emit(e)})},error:e=>this.error.emit(e)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,VA.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,VA.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(e,t){let o=e.querySelectorAll("pre");for(let r=0;r<o.length;r++){let a=t instanceof Array?t:[t];o.item(r).classList.add(...a)}}setPluginOptions(e,t){let o=e.querySelectorAll("pre");for(let r=0;r<o.length;r++)Object.keys(t).forEach(a=>{let c=t[a];if(c){let p=this.toLispCase(a);o.item(r).setAttribute(p,c.toString())}})}toLispCase(e){let t=e.match(/([A-Z])/g);if(!t)return e;let o=e.toString();for(let r=0,a=t.length;r<a;r++)o=o.replace(new RegExp(t[r]),"-"+t[r].toLowerCase());return o.slice(0,1)==="-"&&(o=o.slice(1)),o}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=F({type:n,selectors:[["markdown"],["","markdown",""]],inputs:{data:"data",src:"src",disableSanitizer:"disableSanitizer",inline:"inline",clipboard:"clipboard",clipboardButtonComponent:"clipboardButtonComponent",clipboardButtonTemplate:"clipboardButtonTemplate",emoji:"emoji",katex:"katex",katexOptions:"katexOptions",mermaid:"mermaid",mermaidOptions:"mermaidOptions",lineHighlight:"lineHighlight",line:"line",lineOffset:"lineOffset",lineNumbers:"lineNumbers",start:"start",commandLine:"commandLine",filterOutput:"filterOutput",host:"host",prompt:"prompt",output:"output",user:"user"},outputs:{error:"error",load:"load",ready:"ready"},features:[bn],ngContentSelectors:C0e,decls:1,vars:0,template:function(t,o){t&1&&(ii(),on(0))},encapsulation:2})}}return n})();function F0e(n){return[Gz,n?.loader??[],n?.clipboardOptions??[],n?.markedOptions??[],n?.mermaidOptions??[],n?.markedExtensions??[],n?.sanitize??[]]}var Xf=(()=>{class n{static forRoot(e){return{ngModule:n,providers:[F0e(e)]}}static forChild(){return{ngModule:n}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=Ht({type:n})}static{this.\u0275inj=$t({})}}return n})();function R0e(n,i){if(n&1&&(s(0,"div",2),R(1,"markdown",4),l()),n&2){let e=v(2);m(),C("data",e.markdown())}}function L0e(n,i){n&1&&(s(0,"div",3)(1,"mat-icon",5),d(2,"description"),l(),s(3,"p",6),d(4,"No README content yet. Click Edit to add one."),l()())}function V0e(n,i){if(n&1&&(s(0,"div",0),A(1,R0e,2,1,"div",2)(2,L0e,5,0,"div",3),l()),n&2){let e=v();m(),O(e.markdown()?1:2)}}function B0e(n,i){n&1&&(s(0,"mat-icon",13),d(1,"sync"),l(),s(2,"span"),d(3,"Saving..."),l())}function z0e(n,i){n&1&&(s(0,"mat-icon",13),d(1,"check_circle"),l(),s(2,"span"),d(3,"Saved"),l())}function j0e(n,i){n&1&&(s(0,"mat-icon",13),d(1,"error"),l(),s(2,"span"),d(3,"Save failed"),l())}function $0e(n,i){if(n&1&&(s(0,"div",12),A(1,B0e,4,0),A(2,z0e,4,0),A(3,j0e,4,0),l()),n&2){let e=v(2);Be("save-status--saving",e.saveStatus()==="saving")("save-status--saved",e.saveStatus()==="saved")("save-status--error",e.saveStatus()==="error"),m(),O(e.saveStatus()==="saving"?1:-1),m(),O(e.saveStatus()==="saved"?2:-1),m(),O(e.saveStatus()==="error"?3:-1)}}function H0e(n,i){if(n&1){let e=z();s(0,"div",1)(1,"div",7)(2,"mat-label",8),d(3,"Edit README (Markdown)"),l(),A(4,$0e,4,9,"div",9),l(),s(5,"textarea",10),g("input",function(o){k(e);let r=v();return T(r.onMarkdownInput(o))}),l(),s(6,"p",11),d(7,"Changes are auto-saved 2 seconds after you stop typing"),l()()}if(n&2){let e=v();m(4),O(e.saveStatus()!=="idle"?4:-1),m(),C("value",e.markdown())}}var QS=(()=>{class n{controller=le(void 0);project=le(void 0);projectService=f(ki);cd=f(Q);markdown=ae("");isEditing=ae(!1);saveStatus=ae("idle");originalMarkdown="";destroy$=new He;markdownChangeSubscription=null;isEditingChange=OO();markdownChange$=new He;ngOnInit(){this.projectService.getReadmeFile(this.controller(),this.project().project_id).subscribe({next:e=>{e&&this.markdown.set(e),this.cd.markForCheck()},error:e=>{e.status===404&&this.markdown.set(""),this.cd.markForCheck()}}),this.markdownChangeSubscription=this.markdownChange$.pipe(vO(2e3),gp(),Qi(e=>this.autoSave(e)),tt(this.destroy$)).subscribe()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.markdownChangeSubscription&&this.markdownChangeSubscription.unsubscribe()}onMarkdownInput(e){let t=e.target.value;this.markdown.set(t),this.markdownChange$.next(t)}autoSave(e){this.saveStatus.set("saving"),this.projectService.postReadmeFile(this.controller(),this.project().project_id,e).subscribe({next:()=>{this.saveStatus.set("saved"),this.cd.markForCheck(),setTimeout(()=>{this.saveStatus.set("idle"),this.cd.markForCheck()},2e3)},error:t=>{this.saveStatus.set("error"),this.cd.markForCheck(),setTimeout(()=>{this.saveStatus.set("idle"),this.cd.markForCheck()},3e3)}})}enterEditMode(){this.originalMarkdown=this.markdown(),this.isEditing.set(!0),this.isEditingChange.emit(!0)}cancelEdit(){this.isEditing.set(!1),this.isEditingChange.emit(!1)}saveEdit(){this.isEditing.set(!1),this.isEditingChange.emit(!1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-readme-editor"]],inputs:{controller:[1,"controller"],project:[1,"project"]},outputs:{isEditingChange:"isEditingChange"},decls:2,vars:2,consts:[[1,"readme-preview-container"],[1,"readme-edit-container"],[1,"textWrapper","markdown-body"],[1,"readme-empty-state"],[3,"data"],[1,"readme-empty-icon"],[1,"readme-empty-text"],[1,"editor-header"],[1,"editor-label"],[1,"save-status",3,"save-status--saving","save-status--saved","save-status--error"],["placeholder","Write your project README in Markdown format...",1,"editorWrapper",3,"input","value"],[1,"editor-hint"],[1,"save-status"],[1,"save-status-icon"]],template:function(t,o){t&1&&(A(0,V0e,3,1,"div",0),A(1,H0e,8,2,"div",1)),t&2&&(O(o.isEditing()?-1:0),m(),O(o.isEditing()?1:-1))},dependencies:[ne,Xe,W,ie,de,we,et,Se,Xf,qS],styles:[".readme-preview-container[_ngcontent-%COMP%]{margin-bottom:16px}.textWrapper[_ngcontent-%COMP%]{min-height:400px;max-height:500px;overflow-y:auto;padding:16px;background:var(--mat-sys-surface-container-low);border-radius:8px}.readme-empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:300px;padding:48px 24px;background:var(--mat-sys-surface-container-low);border-radius:8px;border:1px dashed var(--mat-sys-outline-variant)}.readme-empty-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;color:var(--mat-sys-on-surface-variant);margin-bottom:16px;opacity:.5}.readme-empty-text[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);margin:0;text-align:center}.readme-edit-container[_ngcontent-%COMP%]{margin-bottom:16px}.editor-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.editor-label[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface-variant);margin-bottom:0}.editorWrapper[_ngcontent-%COMP%]{width:100%;min-height:400px;max-height:500px;padding:12px;font-family:Roboto Mono,monospace;font-size:14px;line-height:1.6;border:1px solid var(--mat-sys-outline);border-radius:8px;background:var(--mat-sys-surface);color:var(--mat-sys-on-surface);resize:vertical}.editorWrapper[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--mat-sys-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--mat-sys-primary) 20%,transparent)}.editorWrapper[_ngcontent-%COMP%]::placeholder{color:var(--mat-sys-on-surface-variant);opacity:.6}.editor-hint[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);margin:8px 0 0;opacity:.7}.save-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:13px;padding:4px 12px;border-radius:16px;transition:all .3s ease}.save-status[_ngcontent-%COMP%] .save-status-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.save-status--saving[_ngcontent-%COMP%]{background:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}.save-status--saving[_ngcontent-%COMP%] .save-status-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 1s linear infinite}.save-status--saved[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}.save-status--error[_ngcontent-%COMP%]{background:var(--mat-sys-error-container);color:var(--mat-sys-on-error-container)}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"],changeDetection:0})}return n})();var U0e=["editor"];function G0e(n,i){if(n&1){let e=z();s(0,"mat-tab",15)(1,"app-readme-editor",30,0),g("isEditingChange",function(o){k(e);let r=v();return T(r.onReadmeEditingChange(o))}),l()()}if(n&2){let e=v();m(),C("controller",e.controller)("project",e.project)}}function W0e(n,i){n&1&&(s(0,"th",31),d(1,"Name"),l())}function q0e(n,i){if(n&1&&(s(0,"td",32),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function Q0e(n,i){n&1&&(s(0,"th",31),d(1,"Value"),l())}function X0e(n,i){if(n&1&&(s(0,"td",32),d(1),l()),n&2){let e=i.$implicit;m(),j(e.value)}}function K0e(n,i){n&1&&(s(0,"th",31),d(1,"Actions"),l())}function Y0e(n,i){if(n&1){let e=z();s(0,"td",32)(1,"button",33),g("click",function(){let o=k(e).$implicit,r=v();return T(r.deleteVariable(o))}),s(2,"mat-icon",34),d(3,"delete"),l()()()}}function Z0e(n,i){n&1&&R(0,"tr",35)}function J0e(n,i){n&1&&R(0,"tr",36)}function eve(n,i){n&1&&R(0,"mat-spinner",39)}function tve(n,i){n&1&&d(0," Apply ")}function nve(n,i){if(n&1){let e=z();s(0,"button",37),g("click",function(){k(e);let o=v();return T(o.onNoClick())}),d(1,"Cancel"),l(),s(2,"button",38),g("click",function(){k(e);let o=v();return T(o.onYesClick())}),A(3,eve,1,0,"mat-spinner",39),A(4,tve,1,0),l()}if(n&2){let e=v();m(2),C("disabled",e.isApplying()),m(),O(e.isApplying()?3:-1),m(),O(e.isApplying()?-1:4)}}function ive(n,i){if(n&1){let e=z();s(0,"button",41),g("click",function(){let o;k(e);let r=v(2);return T((o=r.editor())==null?null:o.cancelEdit())}),d(1,"Cancel"),l()}}function ove(n,i){n&1&&R(0,"mat-spinner",39)}function rve(n,i){n&1&&d(0," Apply ")}function ave(n,i){if(n&1){let e=z();s(0,"button",37),g("click",function(){k(e);let o=v(2);return T(o.onNoClick())}),d(1,"Cancel"),l(),s(2,"button",41),g("click",function(){let o;k(e);let r=v(2);return T((o=r.editor())==null?null:o.enterEditMode())}),d(3,"Edit"),l(),s(4,"button",38),g("click",function(){k(e);let o=v(2);return T(o.onYesClick())}),A(5,ove,1,0,"mat-spinner",39),A(6,rve,1,0),l()}if(n&2){let e=v(2);m(4),C("disabled",e.isApplying()),m(),O(e.isApplying()?5:-1),m(),O(e.isApplying()?-1:6)}}function sve(n,i){if(n&1&&A(0,ive,2,0,"button",40)(1,ave,7,3),n&2){let e=v();O(e.isReadmeEditing()?0:1)}}var Kf=(()=>{class n{editor=Nt("editor");dialogRef=f(Ie);dialog=f(nt);projectService=f(ki);toasterService=f(te);controller;project;displayedColumns=["name","value","actions"];variables=ae([]);projectName=U("");width=U(0);height=U(0);nodeGridSize=U(25);drawingGridSize=U(25);auto_open=U(!1);auto_start=U(!1);auto_close=U(!1);show_interface_labels=U(!1);variableName=U("");variableValue=U("");isReadmeEditing=ae(!1);selectedTab=ae(0);isApplying=ae(!1);originalVariables=[];isFormValid=Jt(()=>this.projectName().trim().length>0&&+this.width()>=0&&+this.height()>=0&&+this.nodeGridSize()>=0&&+this.drawingGridSize()>=0);isVariableFormValid=Jt(()=>this.variableName().trim().length>0&&this.variableValue().trim().length>0);ngOnInit(){this.projectName.set(this.project.name),this.width.set(this.project.scene_width),this.height.set(this.project.scene_height),this.nodeGridSize.set(this.project.grid_size),this.drawingGridSize.set(this.project.drawing_grid_size),this.project.variables&&(this.variables.set([...this.project.variables]),this.originalVariables=[...this.project.variables]),this.auto_open.set(this.project.auto_open),this.auto_start.set(this.project.auto_start),this.auto_close.set(!this.project.auto_close),this.show_interface_labels.set(this.project.show_interface_labels)}onReadmeEditingChange(e){this.isReadmeEditing.set(e)}onTabChange(e){this.selectedTab.set(e.index)}addVariable(){if(this.isVariableFormValid()){let e={name:this.variableName().trim(),value:this.variableValue().trim()};this.variables.update(t=>t.concat([e]))}else this.toasterService.error("Fill all required fields with correct values.")}deleteVariable(e){this.dialog.open(Sm,{data:{templateName:e.name},panelClass:"base-dialog-panel"}).afterClosed().subscribe(o=>{o&&this.variables.update(r=>r.filter(a=>a!==e))})}hasVariablesChanged(){let e=this.variables();if(e.length!==this.originalVariables.length)return!0;let t=[...e].sort((r,a)=>r.name.localeCompare(a.name)),o=[...this.originalVariables].sort((r,a)=>r.name.localeCompare(a.name));for(let r=0;r<t.length;r++)if(t[r].name!==o[r].name||t[r].value!==o[r].value)return!0;return!1}onNoClick(){this.dialogRef.close()}onYesClick(){if(!this.isFormValid()){this.toasterService.error("Fill all required fields with correct values.");return}if(this.hasVariablesChanged()){let e={title:"Global Variables Changed",message:"Adding or deleting project global variables will cause the GNS3 server to rebuild docker containers in the project to apply the new variables. If containers are running, this operation may take approximately 5-10 seconds. Do you want to continue?",confirmButtonText:"Yes, apply",cancelButtonText:"No, cancel"};this.dialog.open(Ns,{data:e,panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"]}).afterClosed().subscribe(o=>{o&&(this.isApplying.set(!0),this.applyChanges())})}else this.isApplying.set(!0),this.applyChanges()}applyChanges(){this.project.name=this.projectName().trim(),this.project.scene_width=+this.width(),this.project.scene_height=+this.height(),this.project.drawing_grid_size=+this.drawingGridSize(),this.project.grid_size=+this.nodeGridSize(),this.project.variables=this.variables(),this.project.auto_open=this.auto_open(),this.project.auto_start=this.auto_start(),this.project.auto_close=!this.auto_close(),this.project.show_interface_labels=this.show_interface_labels(),this.projectService.update(this.controller,this.project).subscribe({next:e=>{this.projectService.postReadmeFile(this.controller,this.project.project_id,this.editor()?.markdown()??"").subscribe({next:()=>{this.toasterService.success(`Project ${e.name} updated.`),this.isApplying.set(!1),this.dialogRef.close(e)},error:t=>{let o=t.error?.message||t.message||"Failed to update project readme";this.toasterService.error(o),this.isApplying.set(!1)}})},error:e=>{let t=e.error?.message||e.message||"Failed to update project";this.toasterService.error(t),this.isApplying.set(!1)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-edit-project-dialog"]],viewQuery:function(t,o){t&1&&Xt(o.editor,U0e,5),t&2&&Kt()},inputs:{projectName:[1,"projectName"],width:[1,"width"],height:[1,"height"],nodeGridSize:[1,"nodeGridSize"],drawingGridSize:[1,"drawingGridSize"],auto_open:[1,"auto_open"],auto_start:[1,"auto_start"],auto_close:[1,"auto_close"],show_interface_labels:[1,"show_interface_labels"],variableName:[1,"variableName"],variableValue:[1,"variableValue"]},outputs:{projectName:"projectNameChange",width:"widthChange",height:"heightChange",nodeGridSize:"nodeGridSizeChange",drawingGridSize:"drawingGridSizeChange",auto_open:"auto_openChange",auto_start:"auto_startChange",auto_close:"auto_closeChange",show_interface_labels:"show_interface_labelsChange",variableName:"variableNameChange",variableValue:"variableValueChange"},decls:67,vars:17,consts:[["editor",""],["mat-dialog-title",""],[1,"modal-form-container"],[3,"selectedTabChange"],["label","General"],[1,"edit-project-form"],[1,"form-grid"],["appearance","fill",1,"form-grid__full"],["matInput","","placeholder","My Project","type","text",3,"input","value"],["appearance","fill"],["matInput","","placeholder","1000","type","number",3,"input","value"],["matTextSuffix",""],["matInput","","placeholder","800","type","number",3,"input","value"],["matInput","","placeholder","25","type","number",3,"input","value"],[3,"change","checked"],["label","Readme"],["label","Global variables"],["appearance","fill",1,"form-field"],["matInput","","placeholder","VARIABLE_NAME","type","text",3,"input","value"],["matInput","","placeholder","variable_value","type","text",3,"input","value"],["mat-button","","mat-raised-button","","color","primary",1,"form-field",3,"click"],["mat-table","",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","value"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-dialog-actions",""],[3,"isEditingChange","controller","project"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","matTooltip","Delete variable","matTooltipClass","custom-tooltip",3,"click"],["aria-label","Delete adapter"],["mat-header-row",""],["mat-row",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click","disabled"],["diameter","20"],["mat-button",""],["mat-button","",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",1),d(1,"Edit project"),l(),s(2,"div",2)(3,"mat-tab-group",3),g("selectedTabChange",function(a){return o.onTabChange(a)}),s(4,"mat-tab",4)(5,"form",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),d(9,"Project name"),l(),s(10,"input",8),g("input",function(a){return o.projectName.set(a.target.value)}),l()(),s(11,"mat-form-field",9)(12,"mat-label"),d(13,"Scene width"),l(),s(14,"input",10),g("input",function(a){return o.width.set(+a.target.value)}),l(),s(15,"span",11),d(16,"px"),l()(),s(17,"mat-form-field",9)(18,"mat-label"),d(19,"Scene height"),l(),s(20,"input",12),g("input",function(a){return o.height.set(+a.target.value)}),l(),s(21,"span",11),d(22,"px"),l()(),s(23,"mat-form-field",9)(24,"mat-label"),d(25,"Node grid size"),l(),s(26,"input",13),g("input",function(a){return o.nodeGridSize.set(+a.target.value)}),l()(),s(27,"mat-form-field",9)(28,"mat-label"),d(29,"Drawing grid size"),l(),s(30,"input",13),g("input",function(a){return o.drawingGridSize.set(+a.target.value)}),l()()()(),s(31,"mat-checkbox",14),g("change",function(a){return o.auto_open.set(a.checked)}),d(32," Open this project in the background when GNS3 controller starts "),l(),s(33,"mat-checkbox",14),g("change",function(a){return o.auto_start.set(a.checked)}),d(34," Start all nodes when this project is opened "),l(),s(35,"mat-checkbox",14),g("change",function(a){return o.auto_close.set(a.checked)}),d(36," Leave this project running in the background after closing "),l(),s(37,"mat-checkbox",14),g("change",function(a){return o.show_interface_labels.set(a.checked)}),d(38," Show interface labels at start "),l()(),A(39,G0e,3,2,"mat-tab",15),s(40,"mat-tab",16)(41,"form",5)(42,"mat-form-field",17)(43,"mat-label"),d(44,"Name"),l(),s(45,"input",18),g("input",function(a){return o.variableName.set(a.target.value)}),l()(),s(46,"mat-form-field",17)(47,"mat-label"),d(48,"Value"),l(),s(49,"input",19),g("input",function(a){return o.variableValue.set(a.target.value)}),l()()(),s(50,"button",20),g("click",function(){return o.addVariable()}),d(51," Add variable "),l(),s(52,"table",21),Le(53,22),xe(54,W0e,2,0,"th",23)(55,q0e,2,1,"td",24),Ve(),Le(56,25),xe(57,Q0e,2,0,"th",23)(58,X0e,2,1,"td",24),Ve(),Le(59,26),xe(60,K0e,2,0,"th",23)(61,Y0e,4,0,"td",24),Ve(),xe(62,Z0e,1,0,"tr",27)(63,J0e,1,0,"tr",28),l()()()(),s(64,"div",29),A(65,nve,5,3),A(66,sve,2,1),l()),t&2&&(m(10),C("value",o.projectName()),m(4),C("value",o.width()),m(6),C("value",o.height()),m(6),C("value",o.nodeGridSize()),m(4),C("value",o.drawingGridSize()),m(),C("checked",o.auto_open()),m(2),C("checked",o.auto_start()),m(2),C("checked",o.auto_close()),m(2),C("checked",o.show_interface_labels()),m(2),O(o.controller&&o.project?39:-1),m(6),C("value",o.variableName()),m(4),C("value",o.variableValue()),m(3),C("dataSource",o.variables()),m(10),C("matHeaderRowDef",o.displayedColumns),m(),C("matRowDefColumns",o.displayedColumns),m(2),O(o.selectedTab()!==1?65:-1),m(),O(o.selectedTab()===1?66:-1))},dependencies:[ne,Xe,at,rt,Gn,_e,Ne,Fe,W,pe,je,we,Me,et,Mi,Se,Ee,Ot,Gt,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,ie,de,wt,It,To,tr,nr,pn,li,QS],styles:[".form-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px 24px;margin-bottom:16px}.form-grid__full[_ngcontent-%COMP%]{grid-column:1/-1}.form-grid[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}button[disabled][_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block;margin:0;vertical-align:middle;--mat-mdc-progress-spinner-circle-color: var(--mat-sys-on-primary)}"],changeDetection:0})}return n})();function lve(n,i){if(n&1){let e=z();s(0,"div",1)(1,"button",2),g("click",function(){k(e);let o=v();return T(o.onNoClick())}),d(2,"No"),l(),s(3,"button",3),g("click",function(){k(e);let o=v();return T(o.onYesClick())}),d(4," Yes "),l()()}}function cve(n,i){if(n&1){let e=z();s(0,"div",1)(1,"button",4),g("click",function(){k(e);let o=v();return T(o.onNoClick())}),d(2,"OK"),l()()}}var XS=(()=>{class n{data;dialogRef=f(Ie);existingProject;confirmationMessage=ae("");isOpen=ae(!1);constructor(e){this.data=e,this.existingProject=e.existingProject}ngOnInit(){this.existingProject.status==="opened"?(this.confirmationMessage.set(`Project ${this.existingProject.name} is open. You can not overwrite it.`),this.isOpen.set(!0)):this.confirmationMessage.set(`Project ${this.existingProject.name} already exists, overwrite it?`)}onNoClick(){this.dialogRef.close(!1)}onYesClick(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-import-project-dialog"]],decls:5,vars:3,consts:[["mat-dialog-content",""],["mat-dialog-actions",""],["mat-button","","color","accent",1,"cancelButton",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"confirmButton",3,"click"],["mat-button","","color","accent",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"span"),d(2),l()(),A(3,lve,5,0,"div",1),A(4,cve,3,0,"div",1)),t&2&&(m(2),j(o.confirmationMessage()),m(),O(o.isOpen()?-1:3),m(),O(o.isOpen()?4:-1))},dependencies:[_e,Fe,bt,W,pe],encapsulation:2,changeDetection:0})}return n})();var dve=n=>({empty:n}),mve=n=>({"is-invalid":n});function pve(n,i){n&1&&(s(0,"mat-error"),d(1,"Project name is required"),l())}function uve(n,i){n&1&&(s(0,"mat-error"),d(1,"Project name is incorrect"),l())}function hve(n,i){if(n&1){let e=z();s(0,"button",8)(1,"mat-icon",12),g("click",function(){k(e);let o=v(2);return T(o.onDeleteClick())}),d(2,"clear"),l()()}}function fve(n,i){if(n&1){let e=z();s(0,"div")(1,"form",2)(2,"input",3,0),g("change",function(o){k(e);let r=v();return T(r.uploadProjectFile(o))}),l(),s(4,"button",4),g("click",function(){k(e);let o=Pe(3);return T(o.click())}),s(5,"mat-icon"),d(6,"attach_file"),l(),d(7," Choose file "),l(),s(8,"div",5)(9,"mat-form-field",6)(10,"input",7),g("input",function(o){k(e);let r=v();return T(r.projectName.set(o.target.value))}),l(),A(11,pve,2,0,"mat-error"),A(12,uve,2,0,"mat-error"),l(),A(13,hve,3,0,"button",8),l(),s(14,"div",9)(15,"button",10),g("click",function(){k(e);let o=v();return T(o.onNoClick())}),d(16,"Cancel"),l(),s(17,"button",11),g("click",function(){k(e);let o=v();return T(o.onImportClick())}),d(18," Import "),l()()()()}if(n&2){let e=v();m(2),C("uploader",e.uploader),m(7),C("ngClass",dn(8,dve,!e.isDeleteVisible())),m(),C("value",e.projectName())("ngClass",dn(10,mve,e.hasInvalidCharacters()||e.isNameEmpty()&&e.submitted())),m(),O(e.isNameEmpty()&&e.submitted()?11:-1),m(),O(e.hasInvalidCharacters()?12:-1),m(),O(e.isDeleteVisible()?13:-1),m(4),C("disabled",!e.isImportEnabled())}}function gve(n,i){if(n&1){let e=z();s(0,"div")(1,"div",13)(2,"span"),d(3),l()(),s(4,"div",9)(5,"button",11),g("click",function(){k(e);let o=v();return T(o.onNoClick())}),d(6," Finish "),l()()()}if(n&2){let e=v();m(3),j(e.resultMessage()),m(2),C("disabled",!e.isFinishEnabled())}}var Yf=(()=>{class n{dialog=f(nt);dialogRef=f(Ie);projectService=f(ki);projectNameValidator=f(Rs);toasterService=f(te);uploadServiceService=f(hl);snackBar=f(vr);data=f(gt);uploader;controller;uploadProgress=ae(0);isImportEnabled=ae(!1);isFinishEnabled=ae(!1);isDeleteVisible=ae(!1);resultMessage=ae("The project is being imported... Please wait");projectName=U("");submitted=ae(!1);isFirstStepCompleted=ae(!1);uuid=ae("");onImportProject=new ve;isNameEmpty=Jt(()=>{let e=this.projectName();return!e||e.trim().length===0});isNameValid=Jt(()=>{let e=this.projectName();return this.isNameEmpty()?!1:!this.projectNameValidator.get({value:e})});hasInvalidCharacters=Jt(()=>{let e=this.projectName();return this.isNameEmpty()?!1:this.projectNameValidator.get({value:e})?.invalidName===!0});ngOnInit(){this.uploader=new $a({url:""}),this.uploader.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploader.onErrorItem=(e,t,o,r)=>{let a=JSON.parse(t);this.resultMessage.set("An error has occurred: "+a.message),this.isFinishEnabled.set(!0)},this.uploader.onCompleteItem=(e,t,o,r)=>{this.onImportProject.emit(this.uuid()),this.resultMessage.set("Project was imported succesfully!"),this.isFinishEnabled.set(!0)},this.uploader.onProgressItem=e=>{this.uploadProgress.set(e.progress),this.uploadServiceService.processBarCount(this.uploadProgress())},this.uploadServiceService.currentCancelItemDetails.subscribe(e=>{e&&this.cancelUploading()})}uploadProjectFile(e){this.projectName.set(e.target.files[0].name.split(".")[0]),this.isImportEnabled.set(!0),this.isDeleteVisible.set(!0)}onImportClick(){this.isNameValid()?this.projectService.list(this.controller).subscribe({next:e=>{let t=this.projectName().trim(),o=e.find(r=>r.name===t);o?this.openConfirmationDialog(o):this.importProject()},error:e=>{let t=e.error?.message||e.message||"Failed to list projects";this.toasterService.error(t)}}):this.submitted.set(!0)}importProject(){let e=this.prepareUploadPath();this.uploader.queue.forEach(o=>o.url=e),this.uploader.authToken=`Bearer ${this.controller.authToken}`,this.isFirstStepCompleted.set(!0);let t=this.uploader.queue[0];this.uploader.uploadItem(t),this.snackBar.openFromComponent(fl,{panelClass:"uplaoding-file-snackabar",data:{upload_file_type:"Project"}})}openConfirmationDialog(e){this.dialog.open(XS,{width:"300px",height:"150px",panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],data:{existingProject:e},autoFocus:!1,disableClose:!0}).afterClosed().subscribe(o=>{o&&this.projectService.close(this.controller,e.project_id).subscribe({next:()=>{this.projectService.delete(this.controller,e.project_id).subscribe({next:()=>{this.importProject()},error:r=>{let a=r.error?.message||r.message||"Failed to delete project";this.toasterService.error(a)}})},error:r=>{let a=r.error?.message||r.message||"Failed to close project";this.toasterService.error(a)}})})}onNoClick(){this.uploader.cancelAll(),this.dialogRef.close(!1)}onFinishClick(){this.dialogRef.close(!1)}onDeleteClick(){this.uploader.queue.pop(),this.isImportEnabled.set(!1),this.isDeleteVisible.set(!1),this.projectName.set("")}prepareUploadPath(){this.uuid.set(Ai());let e=this.projectName().trim();return this.projectService.getUploadPath(this.controller,this.uuid(),e)}cancelUploading(){this.uploader.clearQueue(),this.uploadServiceService.processBarCount(null),this.toasterService.warning("File upload cancelled"),this.uploadServiceService.cancelFileUploading(!1),this.isFirstStepCompleted.set(!1),this.uploader.cancelAll(),this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-import-project-dialog"]],inputs:{projectName:[1,"projectName"]},outputs:{projectName:"projectNameChange"},decls:4,vars:2,consts:[["file",""],["mat-dialog-title",""],[1,"file-name-form"],["type","file","accept",".gns3project, .gns3p","ng2FileSelect","",1,"non-visible",3,"change","uploader"],["mat-raised-button","","color","primary","matTooltip","Import your .gns3p or .gns3project file","matTooltipClass","custom-tooltip",1,"file-button",3,"click"],[1,"input-row"],[1,"file-name-form-field",3,"ngClass"],["matInput","","type","text","placeholder","Please enter name",3,"input","value","ngClass"],["matTooltip","Remove selected file","matTooltipPosition","above",1,"delete-button"],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click","disabled"],["color","primary",1,"delete-icon",3,"click"],[1,"result-message-box"]],template:function(t,o){t&1&&(s(0,"h1",1),d(1,"Import project"),l(),A(2,fve,19,12,"div"),A(3,gve,7,2,"div")),t&2&&(m(2),O(o.isFirstStepCompleted()?-1:2),m(),O(o.isFirstStepCompleted()?3:-1))},dependencies:[ne,Yi,Xe,at,rt,Gn,_e,Ne,Fe,W,pe,we,Me,fi,Se,Ee,ie,de,wt,It,Ya,sl,Ac],styles:[".non-visible[_ngcontent-%COMP%]{display:none}.file-button[_ngcontent-%COMP%]{width:calc(100% - 48px);height:48px;margin:16px 24px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:center;gap:8px}.file-button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.file-button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.file-name-form[_ngcontent-%COMP%]{width:100%;padding:0 24px;box-sizing:border-box}.input-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.file-name-form-field[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{width:100%}.delete-button[_ngcontent-%COMP%]{background:transparent;border:none;outline:0;width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;transition:all .2s cubic-bezier(.4,0,.2,1)}.delete-button[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.delete-icon[_ngcontent-%COMP%]{vertical-align:middle;font-size:20px;width:20px;height:20px;color:var(--mat-sys-on-surface-variant)}.delete-icon[_ngcontent-%COMP%]:hover{color:var(--mat-sys-on-surface)}.result-message-box[_ngcontent-%COMP%]{margin-top:16px;text-align:center;color:var(--mat-sys-on-surface)}.progress-bar[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary)}"],changeDetection:0})}return n})();var _ve=n=>({lightTheme:n}),Zf=(()=>{class n{bottomSheetRef=f(Vm);themeService=f(ci);cd=f(Q);projectMessage="";isLightThemeEnabled=!1;ngOnInit(){this.themeService.getActualTheme()==="light"?this.isLightThemeEnabled=!0:this.isLightThemeEnabled=!1,this.cd.markForCheck()}onNoClick(){this.bottomSheetRef.dismiss(!1)}onYesClick(){this.bottomSheetRef.dismiss(!0)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-navigation-dialog"]],decls:8,vars:4,consts:[[1,"dialogWrapper",3,"ngClass"],[1,"title"],["mat-button","",3,"click"],["mat-button","",1,"confirmButton",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1),d(2),l(),s(3,"div")(4,"button",2),g("click",function(){return o.onNoClick()}),d(5,"No"),l(),s(6,"button",3),g("click",function(){return o.onYesClick()}),d(7,"Yes"),l()()()),t&2&&(C("ngClass",dn(2,_ve,o.isLightThemeEnabled)),m(2),ee("Do you want to navigate to ",o.projectMessage,"?"))},dependencies:[ne,Yi,Bc,W,pe],styles:[".dialogWrapper[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface);padding:8px 16px;margin-bottom:-8px;display:flex;justify-content:space-between;align-items:center}.dialogWrapper.lightTheme[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface)}.title[_ngcontent-%COMP%]{margin-right:10px;margin-left:10px}"],changeDetection:0})}return n})();var vve=n=>({"is-invalid":n});function Cve(n,i){n&1&&R(0,"mat-spinner",4)}function bve(n,i){n&1&&(s(0,"mat-error"),d(1,"Project name is incorrect"),l())}function xve(n,i){n&1&&(s(0,"mat-error"),d(1,"Project with this name already exists"),l())}function yve(n,i){n&1&&(s(0,"span"),d(1,"Checking..."),l())}function Sve(n,i){n&1&&(s(0,"span"),d(1,"Save project"),l())}var KS=(()=>{class n{dialogRef=f(Ie);projectService=f(ki);toasterService=f(te);projectNameValidator=f(Rs);controller;project;projectName=U("");isCheckingName=ae(!1);nameExistsError=ae(!1);onAddProject=new ve;isNameValid=Jt(()=>{let e=this.projectName();return!e||e.trim().length===0?!1:!this.projectNameValidator.get({value:e})});hasInvalidCharacters=Jt(()=>{let e=this.projectName();return!e||e.trim().length===0?!1:this.projectNameValidator.get({value:e})?.invalidName===!0});onAddClick(){this.isNameValid()&&this.checkProjectNameExists()}onNoClick(){this.dialogRef.close()}onKeyDown(e){e.key==="Enter"&&this.onAddClick()}checkProjectNameExists(){this.isCheckingName.set(!0),this.nameExistsError.set(!1),this.projectService.list(this.controller).subscribe({next:e=>{let t=this.projectName().trim(),o=e.find(r=>r.name===t);this.isCheckingName.set(!1),o?(this.nameExistsError.set(!0),this.toasterService.error("Project with this name already exists.")):this.addProject()},error:e=>{this.isCheckingName.set(!1);let t=e.error?.message||e.message||"Failed to check project name";this.toasterService.error(t)}})}addProject(){this.projectService.duplicate(this.controller,this.project.project_id,this.projectName().trim()).subscribe({next:e=>{this.dialogRef.close(),this.toasterService.success(`Project ${e.name} added`),this.onAddProject.emit(e.project_id)},error:e=>{let t=e.error?.message||e.message||"Failed to save project";this.toasterService.error(t)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-save-project-dialog"]],inputs:{projectName:[1,"projectName"]},outputs:{projectName:"projectNameChange"},decls:16,vars:11,consts:[["mat-dialog-title",""],[1,"file-name-form"],[1,"file-name-form-field"],["matInput","","type","text","placeholder","Please enter name",3,"input","keydown","value","ngClass","disabled"],["matSuffix","","diameter","20"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click","disabled"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click","disabled"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Save project as"),l(),s(2,"form",1)(3,"mat-form-field",2)(4,"mat-label"),d(5,"Project name"),l(),s(6,"input",3),g("input",function(a){return o.projectName.set(a.target.value)})("keydown",function(a){return o.onKeyDown(a)}),l(),A(7,Cve,1,0,"mat-spinner",4),A(8,bve,2,0,"mat-error"),A(9,xve,2,0,"mat-error"),l(),s(10,"div",5)(11,"button",6),g("click",function(){return o.onNoClick()}),d(12,"Cancel"),l(),s(13,"button",7),g("click",function(){return o.onAddClick()}),A(14,yve,2,0,"span")(15,Sve,2,0,"span"),l()()()),t&2&&(m(6),C("value",o.projectName())("ngClass",dn(9,vve,o.hasInvalidCharacters()||o.nameExistsError()))("disabled",o.isCheckingName()),m(),O(o.isCheckingName()?7:-1),m(),O(o.hasInvalidCharacters()?8:-1),m(),O(o.nameExistsError()?9:-1),m(2),C("disabled",o.isCheckingName()),m(2),C("disabled",!o.isNameValid()||o.isCheckingName()),m(),O(o.isCheckingName()?14:15))},dependencies:[ne,Yi,Xe,at,rt,Gn,_e,Ne,Fe,W,pe,we,Me,et,fi,Mi,Se,Ee,pn,li],styles:[".file-name-form-field[_ngcontent-%COMP%]{width:100%}.project-snackbar[_ngcontent-%COMP%]{background:var(--mat-app-primary-color)}"],changeDetection:0})}return n})();var YS=(()=>{class n{getInfoAboutNode(e,t){let o=[];return e.node_type==="cloud"?o.push(`Cloud ${e.name} is always on.`):e.node_type==="nat"?o.push(`NAT ${e.name} is always on.`):e.node_type==="ethernet-hub"?o.push(`Ethernet hub ${e.name} is always on.`):e.node_type==="ethernet_switch"?o.push(`Ethernet switch ${e.name} is always on.`):e.node_type==="frame_relay_switch"?o.push(`Frame relay switch ${e.name} is always on.`):e.node_type==="atm_switch"?o.push(`ATM switch ${e.name} is always on.`):e.node_type==="docker"?o.push(`Docker ${e.name} is ${e.status}.`):e.node_type==="dynamips"?o.push(`Dynamips ${e.name} is always on.`):e.node_type==="virtualbox"?o.push(`VirtualBox VM ${e.name} is ${e.status}.`):e.node_type==="vmware"?o.push(`VMware VM ${e.name} is ${e.status}.`):e.node_type==="qemu"?o.push(`QEMU VM ${e.name} is ${e.status}.`):e.node_type==="iou"?o.push(`IOU ${e.name} is always on.`):e.node_type==="vpcs"&&o.push(`Node ${e.name} is ${e.status}.`),o.push(`Running on controller ${t.name} with port ${t.port}.`),o.push(`Controller ID is ${t.id}.`),e.console_type!=="none"&&e.console_type!=="null"&&o.push(`Console is on port ${e.console} and type is ${e.console_type}.`),e.ports.forEach(r=>{o.push(`Port ${r.name} is ${r.link_type}.`)}),o}getInfoAboutPorts(e){let t="Ports: ";return e.forEach(o=>{t+=`link_type: ${o.link_type},
name: ${o.name}; `}),t=t.substring(0,t.length-2),t}getCommandLine(e){return e.node_type==="cloud"||e.node_type==="nat"||e.node_type==="ethernet_hub"||e.node_type==="ethernet_switch"||e.node_type==="frame_relay_switch"||e.node_type==="atm_switch"||e.node_type==="dynamips"||e.node_type==="iou"?"Command line information is not supported for this type of node.":e.command_line?e.command_line:"Please start the node in order to get the command line information."}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function wve(n,i){if(n&1&&(s(0,"div"),d(1),l()),n&2){let e=i.$implicit;m(),j(e)}}var ZS=(()=>{class n{dialogRef=f(Ie);infoService=f(YS);cd=f(Q);controller;node;infoList=[];usage="";commandLine="";ngOnInit(){this.infoList=this.infoService.getInfoAboutNode(this.node,this.controller),this.commandLine=this.infoService.getCommandLine(this.node),this.usage=this.node.usage?this.node.usage:"No usage information has been provided for this node.",this.cd.markForCheck()}onCloseClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-info-dialog"]],inputs:{controller:"controller",node:"node"},decls:17,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","",1,"close-btn",3,"click"],[1,"modal-form-container"],["animationDuration","0ms"],["label","General information"],[1,"textBox"],["label","Usage instructions"],["label","Command line"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),s(2,"button",1),g("click",function(){return o.onCloseClick()}),s(3,"mat-icon"),d(4,"close"),l()()(),s(5,"div",2)(6,"mat-tab-group",3)(7,"mat-tab",4)(8,"div",5),Y(9,wve,2,1,"div",null,Ae),l()(),s(11,"mat-tab",6)(12,"div",5),d(13),l()(),s(14,"mat-tab",7)(15,"div",5),d(16),l()()()()),t&2&&(m(),ee(" ",o.node.name," "),m(8),Z(o.infoList),m(4),ee(" ",o.usage," "),m(3),ee(" ",o.commandLine," "))},dependencies:[_e,Ne,W,je,ie,de,pn,To,tr,nr],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;color:var(--mat-sys-on-surface)}.close-btn[_ngcontent-%COMP%]{margin-left:auto}.modal-form-container[_ngcontent-%COMP%]{padding:16px;height:300px;display:flex;flex-direction:column;color:var(--mat-sys-on-surface-variant)}.modal-form-container[_ngcontent-%COMP%] mat-tab-group[_ngcontent-%COMP%]{flex:1;overflow:auto}.textBox[_ngcontent-%COMP%]{margin-top:8px;color:var(--mat-sys-on-surface-variant)}"],changeDetection:0})}return n})();var JS=(()=>{class n{dialog=f(nt);node=le(void 0);controller=le(void 0);showNode(){let t=this.dialog.open(ZS,{panelClass:["base-dialog-panel","show-node-action-dialog-panel"],autoFocus:!1,disableClose:!1}).componentInstance;t.node=this.node(),t.controller=this.controller()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-show-node-action"]],inputs:{node:[1,"node"],controller:[1,"controller"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.showNode()}),s(1,"mat-icon"),d(2,"info"),l(),s(3,"span"),d(4,"Show node information"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function Mve(n,i){n&1&&(s(0,"th",21),d(1,"Source Port : VPI : VCI"),l())}function kve(n,i){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=i.$implicit;m(),j(e.portIn)}}function Tve(n,i){n&1&&(s(0,"th",21),d(1,"Destination Port : VPI : VCI"),l())}function Eve(n,i){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=i.$implicit;m(),j(e.portOut)}}function Dve(n,i){n&1&&(s(0,"th",21),d(1,"Actions"),l())}function Pve(n,i){if(n&1){let e=z();s(0,"td",22)(1,"button",23),g("click",function(){let o=k(e).$implicit,r=v();return T(r.delete(o))}),s(2,"mat-icon",24),d(3,"delete"),l()()()}}function Ive(n,i){n&1&&R(0,"tr",25)}function Ave(n,i){n&1&&R(0,"tr",26)}var ew=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);validationService=f(nP);controller;node;name;nameSignal=U("");useVpiOnly=U(!1);sourcePort=U("");sourceVci=U("");destinationPort=U("");destinationVci=U("");sourceVpi=U("");destinationVpi=U("");nodeMappings=ae(new Map);nodeMappingsDataSource=ae([]);displayedColumns=["portIn","portOut","actions"];constructor(){}ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nameSignal.set(e.name),this.useVpiOnly.set(!1);let t=e.properties.mappings,o=new Map;Object.keys(t).forEach(r=>{o.set(r,t[r])}),this.nodeMappings.set(o),this.nodeMappingsDataSource.set(Array.from(o.entries()).map(([r,a])=>({portIn:r,portOut:a})))},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t)}})}delete(e){this.nodeMappingsDataSource.set(this.nodeMappingsDataSource().filter(t=>t!==e))}add(){let e=this.validationService.validateMappingEntry(this.sourcePort(),this.sourceVci(),this.destinationPort(),this.destinationVci(),this.sourceVpi(),this.destinationVpi(),this.useVpiOnly());if(!e.isValid){this.toasterService.error(e.errorMessage||"Invalid input");return}let t;this.useVpiOnly()?t={portIn:`${this.sourcePort()}:${this.sourceVci()}`,portOut:`${this.destinationPort()}:${this.destinationVci()}`}:t={portIn:`${this.sourcePort()}:${this.sourceVpi()}:${this.sourceVci()}`,portOut:`${this.destinationPort()}:${this.destinationVpi()}:${this.destinationVci()}`};let o=this.validationService.validateUniqueMapping(t.portIn,this.nodeMappingsDataSource());if(!o.isValid){this.toasterService.error(o.errorMessage||"Mapping already defined");return}this.nodeMappingsDataSource.set([...this.nodeMappingsDataSource(),t]),this.clearUserInput()}clearUserInput(){this.sourcePort.set(""),this.sourceVci.set(""),this.destinationPort.set(""),this.destinationVci.set(""),this.sourceVpi.set(""),this.destinationVpi.set("")}strMapToObj(e){let t=Object.create(null);for(let[o,r]of e)t[o]=r;return t}onSaveClick(){if(!this.nameSignal()){this.toasterService.error("Fill all required fields.");return}this.node.name=this.nameSignal();let e=new Map;this.nodeMappingsDataSource().forEach(t=>{e.set(t.portIn,t.portOut)}),this.node.properties.mappings=Array.from(e.entries()).reduce((t,[o,r])=>Object.assign(t,{[o]:r}),{}),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(o)}})}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-atm-switch"]],inputs:{nameSignal:[1,"nameSignal"],useVpiOnly:[1,"useVpiOnly"],sourcePort:[1,"sourcePort"],sourceVci:[1,"sourceVci"],destinationPort:[1,"destinationPort"],destinationVci:[1,"destinationVci"],sourceVpi:[1,"sourceVpi"],destinationVpi:[1,"destinationVpi"]},outputs:{nameSignal:"nameSignalChange",useVpiOnly:"useVpiOnlyChange",sourcePort:"sourcePortChange",sourceVci:"sourceVciChange",destinationPort:"destinationPortChange",destinationVci:"destinationVciChange",sourceVpi:"sourceVpiChange",destinationVpi:"destinationVpiChange"},decls:59,vars:12,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[3,"change","checked"],[1,"atm-switch__input-grid"],[1,"atm-switch__add-btn"],["mat-button","",3,"click"],["mat-table","",3,"dataSource"],["matColumnDef","portIn"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","portOut"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","matTooltip","Delete mapping","matTooltipClass","custom-tooltip",3,"click"],["aria-label","Delete mapping"],["mat-header-row",""],["mat-row",""]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1)(3,"div",2)(4,"div",3)(5,"mat-card")(6,"mat-form-field",4)(7,"mat-label"),d(8,"Name"),l(),s(9,"input",5),g("input",function(a){return o.nameSignal.set(a.target.value)}),l()(),s(10,"mat-checkbox",6),g("change",function(a){return o.useVpiOnly.set(a.checked)}),d(11," Use VPI only (VP tunnel) "),l(),s(12,"div",7)(13,"mat-form-field",4)(14,"mat-label"),d(15,"Source Port"),l(),s(16,"input",5),g("input",function(a){return o.sourcePort.set(a.target.value)}),l()(),s(17,"mat-form-field",4)(18,"mat-label"),d(19,"Destination Port"),l(),s(20,"input",5),g("input",function(a){return o.destinationPort.set(a.target.value)}),l()()(),s(21,"div",7)(22,"mat-form-field",4)(23,"mat-label"),d(24,"Source VCI"),l(),s(25,"input",5),g("input",function(a){return o.sourceVci.set(a.target.value)}),l()(),s(26,"mat-form-field",4)(27,"mat-label"),d(28,"Destination VCI"),l(),s(29,"input",5),g("input",function(a){return o.destinationVci.set(a.target.value)}),l()()(),s(30,"div",7)(31,"mat-form-field",4)(32,"mat-label"),d(33,"Source VPI"),l(),s(34,"input",5),g("input",function(a){return o.sourceVpi.set(a.target.value)}),l()(),s(35,"mat-form-field",4)(36,"mat-label"),d(37,"Destination VPI"),l(),s(38,"input",5),g("input",function(a){return o.destinationVpi.set(a.target.value)}),l()()(),s(39,"div",8)(40,"button",9),g("click",function(){return o.add()}),d(41,"Add"),l()(),s(42,"table",10),Le(43,11),xe(44,Mve,2,0,"th",12)(45,kve,2,1,"td",13),Ve(),Le(46,14),xe(47,Tve,2,0,"th",12)(48,Eve,2,1,"td",13),Ve(),Le(49,15),xe(50,Dve,2,0,"th",12)(51,Pve,4,0,"td",13),Ve(),xe(52,Ive,1,0,"tr",16)(53,Ave,1,0,"tr",17),l()()()()(),s(54,"div",18)(55,"button",19),g("click",function(){return o.onCancelClick()}),d(56,"Cancel"),l(),s(57,"button",20),g("click",function(){return o.onSaveClick()}),d(58,"Apply"),l()()),t&2&&(m(),ee("Configurator for ATM switch ",o.name),m(8),C("value",o.nameSignal()),m(),C("checked",o.useVpiOnly()),m(6),C("value",o.sourcePort()),m(4),C("value",o.destinationPort()),m(5),C("value",o.sourceVci()),m(4),C("value",o.destinationVci()),m(5),C("value",o.sourceVpi()),m(4),C("value",o.destinationVpi()),m(4),C("dataSource",o.nodeMappingsDataSource()),m(10),C("matHeaderRowDef",o.displayedColumns),m(),C("matRowDefColumns",o.displayedColumns))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,we,Me,et,Se,Ee,W,pe,je,Ot,Gt,ie,de,wt,It],styles:[".atm-switch__input-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.atm-switch__add-btn[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:16px}.atm-switch__add-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:80%}"],changeDetection:0})}return n})();function Ove(n,i){n&1&&(s(0,"th",15),d(1,"Name"),l())}function Nve(n,i){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function Fve(n,i){n&1&&(s(0,"th",15),d(1,"Local port"),l())}function Rve(n,i){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=i.$implicit;m(),j(e.lport)}}function Lve(n,i){n&1&&(s(0,"th",15),d(1,"Remote host"),l())}function Vve(n,i){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=i.$implicit;m(),j(e.rhost)}}function Bve(n,i){n&1&&(s(0,"th",15),d(1,"Remote port"),l())}function zve(n,i){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=i.$implicit;m(),j(e.rport)}}function jve(n,i){n&1&&(s(0,"th",15),d(1,"Actions"),l())}function $ve(n,i){if(n&1){let e=z();s(0,"td",16)(1,"button",17),g("click",function(){let o=k(e).$implicit,r=v();return T(r.delete(o))}),s(2,"mat-icon",18),d(3,"delete"),l()()()}}function Hve(n,i){n&1&&R(0,"tr",19)}function Uve(n,i){n&1&&R(0,"tr",20)}var tw=(()=>{class n{dataSourceUdp=[];displayedColumns=["name","lport","rhost","rport","action"];newPortName=U("");newPortLport=U(0);newPortRhost=U("");newPortRport=U(0);portTypes=ae([]);etherTypes=ae([]);builtInTemplatesConfigurationService=f(ya);toasterService=f(te);validationService=f(zi);ngOnInit(){this.getConfiguration()}getConfiguration(){this.etherTypes.set(this.builtInTemplatesConfigurationService.getEtherTypesForEthernetSwitches()),this.portTypes.set(this.builtInTemplatesConfigurationService.getPortTypesForEthernetSwitches())}onAddUdpInterface(){let e=this.validationService.required(this.newPortRhost(),"Remote host");if(!e.isValid){this.toasterService.error(e.errorMessage||"Remote host is required");return}if(this.newPortLport()<1||this.newPortLport()>65535){this.toasterService.error("Local port must be between 1 and 65535");return}if(this.newPortRport()<1||this.newPortRport()>65535){this.toasterService.error("Remote port must be between 1 and 65535");return}let t={name:this.newPortName(),lport:this.newPortLport(),rhost:this.newPortRhost(),rport:this.newPortRport(),port_number:0,type:"udp"};this.dataSourceUdp=this.dataSourceUdp.concat([t]),this.newPortName.set(""),this.newPortLport.set(0),this.newPortRhost.set(""),this.newPortRport.set(0)}delete(e){this.dataSourceUdp=this.dataSourceUdp.filter(t=>t!==e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-udp-tunnels"]],inputs:{dataSourceUdp:"dataSourceUdp",newPortName:[1,"newPortName"],newPortLport:[1,"newPortLport"],newPortRhost:[1,"newPortRhost"],newPortRport:[1,"newPortRport"]},outputs:{newPortName:"newPortNameChange",newPortLport:"newPortLportChange",newPortRhost:"newPortRhostChange",newPortRport:"newPortRportChange"},decls:38,vars:7,consts:[[1,"udp-tunnels__input-grid"],["matInput","","type","text",3,"input","value"],["matInput","","type","number","min","1","max","65535",3,"input","value"],[1,"udp-tunnels__add-btn"],["mat-button","",3,"click"],["mat-table","",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","lport"],["matColumnDef","rhost"],["matColumnDef","rport"],["matColumnDef","action"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","matTooltip","Delete port","matTooltipClass","custom-tooltip",3,"click"],["aria-label","Delete port"],["mat-header-row",""],["mat-row",""]],template:function(t,o){t&1&&(s(0,"div",0)(1,"mat-form-field")(2,"mat-label"),d(3,"Name"),l(),s(4,"input",1),g("input",function(a){return o.newPortName.set(a.target.value)}),l()(),s(5,"mat-form-field")(6,"mat-label"),d(7,"Remote host"),l(),s(8,"input",1),g("input",function(a){return o.newPortRhost.set(a.target.value)}),l()(),s(9,"mat-form-field")(10,"mat-label"),d(11,"Local port"),l(),s(12,"input",2),g("input",function(a){return o.newPortLport.set(+a.target.value)}),l()(),s(13,"mat-form-field")(14,"mat-label"),d(15,"Remote port"),l(),s(16,"input",2),g("input",function(a){return o.newPortRport.set(+a.target.value)}),l()()(),s(17,"div",3)(18,"button",4),g("click",function(){return o.onAddUdpInterface()}),d(19,"Add"),l()(),s(20,"table",5),Le(21,6),xe(22,Ove,2,0,"th",7)(23,Nve,2,1,"td",8),Ve(),Le(24,9),xe(25,Fve,2,0,"th",7)(26,Rve,2,1,"td",8),Ve(),Le(27,10),xe(28,Lve,2,0,"th",7)(29,Vve,2,1,"td",8),Ve(),Le(30,11),xe(31,Bve,2,0,"th",7)(32,zve,2,1,"td",8),Ve(),Le(33,12),xe(34,jve,2,0,"th",7)(35,$ve,4,0,"td",8),Ve(),xe(36,Hve,1,0,"tr",13)(37,Uve,1,0,"tr",14),l()),t&2&&(m(4),C("value",o.newPortName()),m(4),C("value",o.newPortRhost()),m(4),C("value",o.newPortLport()),m(4),C("value",o.newPortRport()),m(4),C("dataSource",o.dataSourceUdp),m(16),C("matHeaderRowDef",o.displayedColumns),m(),C("matRowDefColumns",o.displayedColumns))},dependencies:[ne,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,we,Me,et,Se,Ee,W,pe,je,ie,de,wt,It],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}",".udp-tunnels__input-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.udp-tunnels__add-btn[_ngcontent-%COMP%]{display:flex;justify-content:center}.udp-tunnels__add-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:80%}"],changeDetection:0})}return n})();var Gve=["udpTunnels"];function Wve(n,i){if(n&1&&(s(0,"mat-option",14),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function qve(n,i){n&1&&(s(0,"th",36),d(1,"Interface"),l())}function Qve(n,i){if(n&1&&(s(0,"td",37),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function Xve(n,i){n&1&&(s(0,"th",36),d(1,"Actions"),l())}function Kve(n,i){if(n&1){let e=z();s(0,"td",37)(1,"button",38),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.onDeleteEthernetInterface(o))}),s(2,"mat-icon",39),d(3,"delete"),l()()()}}function Yve(n,i){n&1&&R(0,"tr",40)}function Zve(n,i){n&1&&R(0,"tr",41)}function Jve(n,i){n&1&&(s(0,"th",36),d(1,"Interface"),l())}function eCe(n,i){if(n&1&&(s(0,"td",37),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function tCe(n,i){n&1&&(s(0,"th",36),d(1,"Actions"),l())}function nCe(n,i){if(n&1){let e=z();s(0,"td",37)(1,"button",38),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.onDeleteTapInterface(o))}),s(2,"mat-icon",39),d(3,"delete"),l()()()}}function iCe(n,i){n&1&&R(0,"tr",40)}function oCe(n,i){n&1&&R(0,"tr",41)}function rCe(n,i){if(n&1){let e=z();s(0,"mat-chip",42),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",43),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function aCe(n,i){if(n&1&&(s(0,"mat-option",14),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function sCe(n,i){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",10)(2,"div",11)(3,"div",12)(4,"mat-form-field")(5,"mat-label"),d(6,"Ethernet interface"),l(),s(7,"mat-select",13),g("selectionChange",function(o){k(e);let r=v();return T(r.ethernetInterface.set(o.value))}),Y(8,Wve,2,2,"mat-option",14,Ae),l()(),s(10,"button",15),g("click",function(){k(e);let o=v();return T(o.onAddEthernetInterface())}),d(11,"Add"),l()(),s(12,"table",16),Le(13,17),xe(14,qve,2,0,"th",18)(15,Qve,2,1,"td",19),Ve(),Le(16,20),xe(17,Xve,2,0,"th",18)(18,Kve,4,0,"td",19),Ve(),xe(19,Yve,1,0,"tr",21)(20,Zve,1,0,"tr",22),l()()(),s(21,"mat-tab",23)(22,"div",11)(23,"div",12)(24,"mat-form-field")(25,"input",24),g("input",function(o){k(e);let r=v();return T(r.tapInterface.set(o.target.value))}),l()(),s(26,"button",15),g("click",function(){k(e);let o=v();return T(o.onAddTapInterface())}),d(27,"Add"),l()(),s(28,"table",16),Le(29,17),xe(30,Jve,2,0,"th",18)(31,eCe,2,1,"td",19),Ve(),Le(32,20),xe(33,tCe,2,0,"th",18)(34,nCe,4,0,"td",19),Ve(),xe(35,iCe,1,0,"tr",21)(36,oCe,1,0,"tr",22),l()()(),s(37,"mat-tab",25),R(38,"app-udp-tunnels",26,0),l(),s(40,"mat-tab",27)(41,"div",28)(42,"mat-form-field",29)(43,"mat-label"),d(44,"Name"),l(),s(45,"input",30),g("input",function(o){k(e);let r=v();return T(r.nodeName.set(o.target.value))}),l()(),s(46,"mat-form-field",31)(47,"mat-label"),d(48,"Tags"),l(),s(49,"mat-chip-grid",null,1),Y(51,rCe,4,1,"mat-chip",null,Ae),l(),s(53,"input",32),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(54,"mat-form-field",29)(55,"mat-label"),d(56,"Console type"),l(),s(57,"mat-select",33),g("valueChange",function(o){k(e);let r=v();return T(r.consoleType.set(o))}),Y(58,aCe,2,2,"mat-option",14,Ae),l()(),s(60,"mat-form-field",29)(61,"mat-label"),d(62,"Console host"),l(),s(63,"input",30),g("input",function(o){k(e);let r=v();return T(r.remoteConsoleHost.set(o.target.value))}),l()(),s(64,"mat-form-field",29)(65,"mat-label"),d(66,"Console port"),l(),s(67,"input",30),g("input",function(o){k(e);let r=v();return T(r.remoteConsolePort.set(o.target.value))}),l()(),s(68,"mat-form-field",29)(69,"mat-label"),d(70,"Console HTTP path"),l(),s(71,"input",30),g("input",function(o){k(e);let r=v();return T(r.remoteConsoleHttpPath.set(o.target.value))}),l()()()(),s(72,"mat-tab",34)(73,"div",28)(74,"mat-form-field",29)(75,"mat-label"),d(76,"Usage"),l(),s(77,"textarea",35),g("input",function(o){k(e);let r=v();return T(r.usage.set(o.target.value))}),l()()()()()}if(n&2){let e=Pe(50),t=v();m(7),C("value",t.ethernetInterface()),m(),Z(t.availableEthernetInterfaces),m(4),C("dataSource",t.portsMappingEthernet),m(7),C("matHeaderRowDef",t.ethernetDisplayColumns),m(),C("matRowDefColumns",t.ethernetDisplayColumns),m(5),C("value",t.tapInterface()),m(3),C("dataSource",t.portsMappingTap),m(7),C("matHeaderRowDef",t.tapDisplayColumns),m(),C("matRowDefColumns",t.tapDisplayColumns),m(2),C("dataSourceUdp",t.portsMappingUdp),m(7),C("value",t.nodeName()),m(6),Z(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(5),C("value",t.remoteConsoleHost()),m(4),C("value",t.remoteConsolePort()),m(4),C("value",t.remoteConsoleHttpPath()),m(6),C("value",t.usage())}}var nw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);builtInTemplatesConfigurationService=f(ya);cd=f(Q);validationService=f(E0);controller;node;name;separatorKeysCodes=[13,188];consoleTypes=[];onCloseOptions=[];bootPriorities=[];diskInterfaces=[];portsMappingEthernet=[];portsMappingTap=[];portsMappingUdp=[];ethernetDisplayColumns=["name","actions"];tapDisplayColumns=["name","actions"];displayedColumns=["adapter_number","port_name","adapter_type","actions"];networkTypes=[];tapInterface=U("");ethernetInterface=U("");availableEthernetInterfaces=[];nodeName=U("");consoleType=U("none");remoteConsoleHost=U("");remoteConsolePort=U("");remoteConsoleHttpPath=U("");usage=U("");udpTunnels=Nt("udpTunnels");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||""),this.consoleType.set(e.console_type||"none"),this.remoteConsoleHost.set(e.properties.remote_console_host||""),this.remoteConsolePort.set(e.properties.remote_console_port?.toString()||""),this.remoteConsoleHttpPath.set(e.properties.remote_console_http_path||""),this.usage.set(e.properties.usage||""),this.getConfiguration(),this.node.tags||(this.node.tags=[]),this.node.properties.interfaces&&(this.availableEthernetInterfaces=this.node.properties.interfaces.filter(t=>t.type==="ethernet").map(t=>t.name)),this.portsMappingEthernet=this.node.properties.ports_mapping.filter(t=>t.type==="ethernet"),this.portsMappingTap=this.node.properties.ports_mapping.filter(t=>t.type==="tap"),this.portsMappingUdp=this.node.properties.ports_mapping.filter(t=>t.type==="udp"),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.builtInTemplatesConfigurationService.getConsoleTypesForCloudNodes()}onAddEthernetInterface(){if(this.ethernetInterface()){let e=this.validationService.validateInterfaceName(this.ethernetInterface());if(!e.isValid){this.toasterService.error(e.errorMessage||"Invalid interface name");return}let t=this.portsMappingEthernet.map(r=>r.name),o=this.validationService.validateUniqueInterface(this.ethernetInterface(),t);if(!o.isValid){this.toasterService.error(o.errorMessage||`Interface ${this.ethernetInterface()} already configured.`);return}this.portsMappingEthernet.push({interface:this.ethernetInterface(),name:this.ethernetInterface(),port_number:0,type:"ethernet"}),this.portsMappingEthernet=[...this.portsMappingEthernet],this.ethernetInterface.set(""),this.cd.markForCheck()}}onDeleteEthernetInterface(e){this.portsMappingEthernet=this.portsMappingEthernet.filter(t=>t!==e),this.cd.markForCheck()}onAddTapInterface(){if(this.tapInterface()){let e=this.validationService.validateInterfaceName(this.tapInterface());if(!e.isValid){this.toasterService.error(e.errorMessage||"Invalid interface name");return}let t=this.portsMappingTap.map(r=>r.name),o=this.validationService.validateUniqueInterface(this.tapInterface(),t);if(!o.isValid){this.toasterService.error(o.errorMessage||`Interface ${this.tapInterface()} already configured.`);return}this.portsMappingTap.push({interface:this.tapInterface(),name:this.tapInterface(),port_number:0,type:"tap"}),this.portsMappingTap=[...this.portsMappingTap],this.tapInterface.set(""),this.cd.markForCheck()}}onDeleteTapInterface(e){this.portsMappingTap=this.portsMappingTap.filter(t=>t!==e),this.cd.markForCheck()}onSaveClick(){let e=this.validationService.validateName(this.nodeName());if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}if(this.remoteConsolePort()){let o=this.validationService.validateRemoteConsolePort(this.remoteConsolePort());if(!o.isValid){this.toasterService.error(o.errorMessage||"Remote console port must be between 1 and 65535");return}}let t=this.validationService.validateConsoleType(this.consoleType(),this.consoleTypes);if(!t.isValid){this.toasterService.error(t.errorMessage||"Invalid console type");return}if(this.remoteConsoleHost()){let o=this.validationService.validateRemoteConsoleHost(this.remoteConsoleHost());if(!o.isValid){this.toasterService.error(o.errorMessage||"Invalid remote console host");return}}if(this.remoteConsoleHttpPath()){let o=this.validationService.validateRemoteConsoleHttpPath(this.remoteConsoleHttpPath());if(!o.isValid){this.toasterService.error(o.errorMessage||"Invalid HTTP path");return}}this.node.name=this.nodeName(),this.node.console_type=this.consoleType()||"none",this.node.properties.remote_console_host=this.remoteConsoleHost(),this.node.properties.remote_console_port=this.remoteConsolePort()?parseInt(this.remoteConsolePort(),10):void 0,this.node.properties.remote_console_http_path=this.remoteConsoleHttpPath(),this.node.properties.usage=this.usage(),this.portsMappingUdp=this.udpTunnels().dataSourceUdp,this.node.properties.ports_mapping=this.portsMappingUdp.concat(this.portsMappingEthernet).concat(this.portsMappingTap),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:o=>{let r=o?.error?.message||o?.message||"Failed to update node";this.toasterService.error(r),this.cd.markForCheck()}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-cloud"]],viewQuery:function(t,o){t&1&&Xt(o.udpTunnels,Gve,5),t&2&&Kt()},inputs:{tapInterface:[1,"tapInterface"],ethernetInterface:[1,"ethernetInterface"],nodeName:[1,"nodeName"],consoleType:[1,"consoleType"],remoteConsoleHost:[1,"remoteConsoleHost"],remoteConsolePort:[1,"remoteConsolePort"],remoteConsoleHttpPath:[1,"remoteConsoleHttpPath"],usage:[1,"usage"]},outputs:{tapInterface:"tapInterfaceChange",ethernetInterface:"ethernetInterfaceChange",nodeName:"nodeNameChange",consoleType:"consoleTypeChange",remoteConsoleHost:"remoteConsoleHostChange",remoteConsolePort:"remoteConsolePortChange",remoteConsoleHttpPath:"remoteConsoleHttpPathChange",usage:"usageChange"},decls:13,vars:2,consts:[["udpTunnels",""],["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["label","Ethernet interfaces"],[1,"interfaces-list"],[1,"add-interface-row"],[3,"selectionChange","value"],[3,"value"],["mat-button","",3,"click"],["mat-table","",1,"interfaces-table",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["label","TAP interfaces"],["matInput","","type","text","placeholder","TAP interface",3,"input","value"],["label","UDP tunnels"],[3,"dataSourceUdp"],["label","Miscellaneous"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"valueChange","value"],["label","Usage"],["matInput","",3,"input","value"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","matTooltip","Delete interface",3,"click"],["aria-label","Delete interface"],["mat-header-row",""],["mat-row",""],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"h1",2),d(1),l(),s(2,"div",3)(3,"div",4)(4,"div",5)(5,"mat-card",6),A(6,sCe,78,17,"mat-tab-group"),l(),R(7,"div"),l()(),s(8,"div",7)(9,"button",8),g("click",function(){return o.onCancelClick()}),d(10,"Cancel"),l(),s(11,"button",9),g("click",function(){return o.onSaveClick()}),d(12,"Apply"),l()()()),t&2&&(m(),ee("Configurator for cloud node ",o.name),m(5),O(o.name?6:-1))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,To,tr,nr,we,Me,et,Se,Ee,vt,At,_t,W,pe,je,ti,Jn,vi,Ci,mi,ie,de,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,wt,It,tw],encapsulation:2,changeDetection:0})}return n})();function lCe(n,i){if(n&1){let e=z();s(0,"div",1)(1,"textarea",5),g("input",function(o){k(e);let r=v();return T(r.configuration.set(o.target.value))}),l()()}if(n&2){let e=v();m(),C("value",e.configuration())}}var iw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller;node;configuration=U("");constructor(){}ngOnInit(){this.nodeService.getNetworkConfiguration(this.controller,this.node).subscribe({next:e=>{this.configuration.set(e),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load network configuration";this.toasterService.error(t),this.cdr.markForCheck()}})}onSaveClick(){this.nodeService.saveNetworkConfiguration(this.controller,this.node,this.configuration()).subscribe({next:e=>{this.onCancelClick(),this.toasterService.success(`Configuration for node ${this.node.name} saved.`),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to save network configuration";this.toasterService.error(t),this.cdr.markForCheck()}})}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-edit-network-configuration"]],inputs:{configuration:[1,"configuration"]},outputs:{configuration:"configurationChange"},decls:8,vars:2,consts:[["mat-dialog-title",""],[1,"modal-form-container"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["matInput","","type","text",1,"textArea",3,"input","value"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),A(2,lCe,2,1,"div",1),s(3,"div",2)(4,"button",3),g("click",function(){return o.onCancelClick()}),d(5,"Cancel"),l(),s(6,"button",4),g("click",function(){return o.onSaveClick()}),d(7,"Apply"),l()()),t&2&&(m(),ee("Edit network configuration for node ",o.node.name),m(),O(o.node?2:-1))},dependencies:[ne,_e,Ne,Fe,Se,Ee,W,pe],styles:[".textArea[_ngcontent-%COMP%]{width:100%;height:350px}"],changeDetection:0})}return n})();function cCe(n,i){if(n&1){let e=z();s(0,"mat-chip",30),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",31),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function dCe(n,i){if(n&1&&(s(0,"mat-option",19),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function mCe(n,i){if(n&1&&(s(0,"mat-option",19),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function pCe(n,i){if(n&1&&(s(0,"mat-option",19),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function uCe(n,i){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",9)(2,"div",10)(3,"mat-form-field",11)(4,"mat-label"),d(5,"Name"),l(),s(6,"input",12),g("input",function(o){k(e);let r=v();return T(r.nodeName.set(o.target.value))}),l()(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),Y(12,cCe,4,1,"mat-chip",null,Ae),l(),s(14,"input",14),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Image"),l(),s(18,"input",12),g("input",function(o){k(e);let r=v();return T(r.dockerImage.set(o.target.value))}),l()(),s(19,"div",15)(20,"mat-form-field",11)(21,"mat-label"),d(22,"Adapters"),l(),s(23,"input",12),g("input",function(o){k(e);let r=v();return T(r.adapter.set(o.target.value))}),l()(),s(24,"mat-form-field",11)(25,"mat-label"),d(26,"Base MAC"),l(),s(27,"input",12),g("input",function(o){k(e);let r=v();return T(r.macAddress.set(o.target.value))}),l()(),s(28,"mat-form-field",11)(29,"mat-label"),d(30,"Maximum memory"),l(),s(31,"input",16),g("input",function(o){k(e);let r=v();return T(r.memory.set(o.target.value))}),l(),s(32,"span",17),d(33,"MB"),l()(),s(34,"mat-form-field",11)(35,"mat-label"),d(36,"Maximum CPUs"),l(),s(37,"input",16),g("input",function(o){k(e);let r=v();return T(r.cpus.set(o.target.value))}),l()(),s(38,"mat-form-field",11)(39,"mat-label"),d(40,"Console type"),l(),s(41,"mat-select",18),g("valueChange",function(o){k(e);let r=v();return T(r.consoleType.set(o))}),Y(42,dCe,2,2,"mat-option",19,Ae),l()(),s(44,"mat-form-field",11)(45,"mat-label"),d(46,"Auxiliary console type"),l(),s(47,"mat-select",18),g("valueChange",function(o){k(e);let r=v();return T(r.auxType.set(o))}),Y(48,mCe,2,2,"mat-option",19,Ae),l()(),s(50,"mat-form-field",11)(51,"mat-label"),d(52,"VNC console resolution"),l(),s(53,"mat-select",18),g("valueChange",function(o){k(e);let r=v();return T(r.consoleResolution.set(o))}),Y(54,pCe,2,2,"mat-option",19,Ae),l()(),s(56,"mat-form-field",11)(57,"mat-label"),d(58,"HTTP port in the container"),l(),s(59,"input",12),g("input",function(o){k(e);let r=v();return T(r.consoleHttpPort.set(o.target.value))}),l()(),s(60,"mat-form-field",20)(61,"mat-label"),d(62,"HTTP path"),l(),s(63,"input",12),g("input",function(o){k(e);let r=v();return T(r.consoleHttpPath.set(o.target.value))}),l()(),s(64,"mat-checkbox",21),g("change",function(o){k(e);let r=v();return T(r.consoleAutoStart.set(o.checked))}),d(65," Auto start console "),l()(),s(66,"div",15)(67,"button",22),g("click",function(){k(e);let o=v();return T(o.configureCustomAdapters())}),d(68," Configure custom adapters "),l(),s(69,"button",22),g("click",function(){k(e);let o=v();return T(o.editNetworkConfiguration())}),d(70," Edit network configuration "),l()()()(),s(71,"mat-tab",23)(72,"div",10)(73,"h6"),d(74,"Start command"),l(),s(75,"mat-form-field",11)(76,"mat-label"),d(77,"Start command"),l(),s(78,"textarea",24),g("input",function(o){k(e);let r=v();return T(r.startCommand.set(o.target.value))}),l()(),s(79,"h6"),d(80,"Environment"),l(),s(81,"mat-form-field",11)(82,"mat-label"),d(83,"Environment variables"),l(),s(84,"textarea",25),g("input",function(o){k(e);let r=v();return T(r.environment.set(o.target.value))}),l()(),s(85,"h6"),d(86,"Extra hosts"),l(),s(87,"mat-form-field",11)(88,"mat-label"),d(89,"Extra hosts"),l(),s(90,"textarea",26),g("input",function(o){k(e);let r=v();return T(r.extraHosts.set(o.target.value))}),l()(),s(91,"h6"),d(92,"Additional volumes"),l(),s(93,"mat-form-field",11)(94,"mat-label"),d(95,"Additional volumes"),l(),s(96,"textarea",27),g("input",function(o){k(e);let r=v();return T(r.extraVolumes.set(o.target.value))}),l()()()(),s(97,"mat-tab",28)(98,"div",10)(99,"mat-form-field",11)(100,"mat-label"),d(101,"Usage"),l(),s(102,"textarea",29),g("input",function(o){k(e);let r=v();return T(r.usage.set(o.target.value))}),l()()()()()}if(n&2){let e=Pe(11),t=v();m(6),C("value",t.nodeName()),m(6),Z(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.dockerImage()),m(5),C("value",t.adapter()),m(4),C("value",t.macAddress()),m(4),C("value",t.memory()),m(6),C("value",t.cpus()),m(4),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(5),C("value",t.auxType()),m(),Z(t.auxConsoleTypes),m(5),C("value",t.consoleResolution()),m(),Z(t.consoleResolutions),m(5),C("value",t.consoleHttpPort()),m(4),C("value",t.consoleHttpPath()),m(),C("checked",t.consoleAutoStart()),m(14),C("value",t.startCommand()),m(6),C("value",t.environment()),m(6),C("value",t.extraHosts()),m(6),C("value",t.extraVolumes()),m(6),C("value",t.usage())}}var ow=(()=>{class n{dialogReference=f(Ie);nodeService=f(ut);toasterService=f(te);dockerConfigurationService=f(Fc);dialog=f(nt);cd=f(Q);validationService=f(D0);controller;node;name;separatorKeysCodes=[13,188];consoleTypes=[];auxConsoleTypes=[];consoleResolutions=["2560x1440","1920x1080","1680x1050","1440x900","1366x768","1280x1024","1280x800","1024x768","800x600","640x480"];conf={autoFocus:!1,panelClass:["base-dialog-panel","docker-configurator-dialog-panel"],disableClose:!0};dialogRef;nodeName=U("");dockerImage=U("");startCommand=U("");adapter=U("");macAddress=U("");memory=U("");cpus=U("");consoleType=U("");auxType=U("");consoleAutoStart=U(!1);consoleResolution=U("");consoleHttpPort=U("");consoleHttpPath=U("");environment=U("");extraHosts=U("");extraVolumes=U("");usage=U("");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||""),this.dockerImage.set(e.properties.image||""),this.startCommand.set(e.properties.start_command||""),this.adapter.set(e.properties.adapters?.toString()||""),this.macAddress.set(e.properties.mac_address||""),this.memory.set(e.properties.memory?.toString()||""),this.cpus.set(e.properties.cpus?.toString()||""),this.consoleType.set(e.console_type||""),this.auxType.set(e.aux_type||""),this.consoleAutoStart.set(e.console_auto_start||!1),this.consoleResolution.set(e.properties.console_resolution||""),this.consoleHttpPort.set(e.properties.console_http_port?.toString()||""),this.consoleHttpPath.set(e.properties.console_http_path||""),this.environment.set(e.properties.environment||""),this.extraHosts.set(e.properties.extra_hosts||"");let t=e.properties.extra_volumes;this.extraVolumes.set(Array.isArray(t)?t.join(`
`):t||""),this.usage.set(e.properties.usage||""),this.getConfiguration(),this.node.properties.cpus||(this.node.properties.cpus=0),this.node.tags||(this.node.tags=[]),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.dockerConfigurationService.getConsoleTypes(),this.auxConsoleTypes=this.dockerConfigurationService.getAuxConsoleTypes()}configureCustomAdapters(){let e=this.node.custom_adapters||[];if(e.length===0){let o=parseInt(this.adapter(),10)||1;e=Array.from({length:o},(r,a)=>({adapter_number:a,mac_address:""}))}this.dialogRef=this.dialog.open(Jh,this.conf);let t=this.dialogRef.componentInstance;t.controller=this.controller,t.adapters.set(e),t.saveHandler=o=>{this.node.custom_adapters=o.map(r=>it(K({},r),{mac_address:r.mac_address||null})),this.adapter.set(o.length.toString())}}editNetworkConfiguration(){this.dialogRef=this.dialog.open(iw,this.conf);let e=this.dialogRef.componentInstance;e.controller=this.controller,e.node=this.node}onSaveClick(){let e=this.validationService.validateName(this.nodeName());if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}let t=this.validationService.validateAdapters(this.adapter(),99);if(!t.isValid){this.toasterService.error(t.errorMessage);return}let o=this.validationService.validateMacAddress(this.macAddress());if(!o.isValid){this.toasterService.error(o.errorMessage);return}let r=this.validationService.validateMemory(this.memory());if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.validateCpus(this.cpus());if(!a.isValid){this.toasterService.error(a.errorMessage);return}if(!this.consoleHttpPort()||this.consoleHttpPort().trim()===""){this.toasterService.error("Console HTTP port is required");return}let c=this.validationService.validateConsoleHttpPath(this.consoleHttpPath());if(!c.isValid){this.toasterService.error(c.errorMessage);return}let p=this.validationService.validateEnvironment(this.environment(),"Advanced > Environment");if(!p.isValid){this.toasterService.error(p.errorMessage);return}this.node.name=this.nodeName(),this.node.properties.image=this.dockerImage(),this.node.properties.start_command=this.startCommand(),this.node.properties.adapters=parseInt(this.adapter(),10)||0,this.node.properties.mac_address=this.macAddress(),this.node.properties.memory=parseInt(this.memory(),10)||0,this.node.properties.cpus=parseFloat(this.cpus())||0,this.node.console_type=this.consoleType(),this.node.aux_type=this.auxType(),this.node.console_auto_start=this.consoleAutoStart(),this.node.properties.console_resolution=this.consoleResolution(),this.node.properties.console_http_port=parseInt(this.consoleHttpPort(),10)||void 0,this.node.properties.console_http_path=this.consoleHttpPath(),this.node.properties.environment=this.environment(),this.node.properties.extra_hosts=this.extraHosts(),this.node.properties.extra_volumes=this.extraVolumes()?this.extraVolumes().split(`
`).filter(u=>u.trim()):[],this.node.properties.usage=this.usage(),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:u=>{let h=u?.error?.message||u?.message||"Failed to update node";this.toasterService.error(h),this.cd.markForCheck()}})}onCancelClick(){this.dialogReference.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-docker"]],inputs:{nodeName:[1,"nodeName"],dockerImage:[1,"dockerImage"],startCommand:[1,"startCommand"],adapter:[1,"adapter"],macAddress:[1,"macAddress"],memory:[1,"memory"],cpus:[1,"cpus"],consoleType:[1,"consoleType"],auxType:[1,"auxType"],consoleAutoStart:[1,"consoleAutoStart"],consoleResolution:[1,"consoleResolution"],consoleHttpPort:[1,"consoleHttpPort"],consoleHttpPath:[1,"consoleHttpPath"],environment:[1,"environment"],extraHosts:[1,"extraHosts"],extraVolumes:[1,"extraVolumes"],usage:[1,"usage"]},outputs:{nodeName:"nodeNameChange",dockerImage:"dockerImageChange",startCommand:"startCommandChange",adapter:"adapterChange",macAddress:"macAddressChange",memory:"memoryChange",cpus:"cpusChange",consoleType:"consoleTypeChange",auxType:"auxTypeChange",consoleAutoStart:"consoleAutoStartChange",consoleResolution:"consoleResolutionChange",consoleHttpPort:"consoleHttpPortChange",consoleHttpPath:"consoleHttpPathChange",environment:"environmentChange",extraHosts:"extraHostsChange",extraVolumes:"extraVolumesChange",usage:"usageChange"},decls:12,vars:2,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["label","General settings"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"two-column-grid"],["matInput","","type","text","min","0",3,"input","value"],["matSuffix",""],[3,"valueChange","value"],[3,"value"],[1,"form-field","grid-span-2"],[1,"grid-span-2",3,"change","checked"],["mat-button","",1,"form-field",3,"click"],["label","Advanced"],["matInput","","placeholder",'Command to run when the container starts (overrides image default CMD). E.g., python app.py, nginx -g "daemon off;"',3,"input","value"],["matInput","","placeholder","Environment variables (one per line, KEY=VALUE format). Supports: %vm-name%, %vm-id%, %project-id%, %project-path%",3,"input","value"],["matInput","","placeholder","Hostname to IP mappings, one per line (e.g., gns3.com:192.168.100.10)",3,"input","value"],["matInput","","placeholder",`Container directories to persist, one per line (e.g., /data
/config)`,3,"input","value"],["label","Usage"],["matInput","",3,"input","value"],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),A(6,uCe,103,19,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),g("click",function(){return o.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),g("click",function(){return o.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for node ",o.name),m(5),O(o.name?6:-1))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,To,tr,nr,we,Me,et,Mi,Se,Ee,vt,At,_t,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ot,Gt],encapsulation:2,changeDetection:0})}return n})();function hCe(n,i){if(n&1){let e=z();s(0,"mat-chip",18),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",19),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function fCe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function gCe(n,i){if(n&1&&R(0,"app-ports",17,1),n&2){let e=v(2);C("ethernetPorts",e.node.properties.ports_mapping)}}function _Ce(n,i){if(n&1){let e=z();s(0,"div",5)(1,"mat-card",9)(2,"div",10)(3,"mat-form-field",11)(4,"mat-label"),d(5,"Name"),l(),s(6,"input",12),g("input",function(o){k(e);let r=v();return T(r.nodeName.set(o.target.value))}),l()(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),Y(12,hCe,4,1,"mat-chip",null,Ae),l(),s(14,"input",14),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),g("valueChange",function(o){k(e);let r=v();return T(r.consoleType.set(o))}),Y(19,fCe,2,2,"mat-option",16,Ae),l()()(),A(21,gCe,2,1,"app-ports",17),l()()}if(n&2){let e=Pe(11),t=v();m(6),C("value",t.nodeName()),m(6),Z(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(2),O(t.node.properties?21:-1)}}var rw=(()=>{class n{portsComponent=Nt(Ed);dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);ethernetSwitchesConfigurationService=f(ya);cd=f(Q);validationService=f(zi);controller;node;name;consoleTypes=[];separatorKeysCodes=[13,188];nodeName=U("");consoleType=U("");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=this.node.name,this.nodeName.set(e.name||""),this.consoleType.set(e.console_type||""),this.getConfiguration(),this.node.tags||(this.node.tags=[]),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.ethernetSwitchesConfigurationService.getConsoleTypesForEthernetSwitches()}onSaveClick(){let e=this.validationService.required(this.nodeName(),"Name");if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}this.node.name=this.nodeName(),this.node.console_type=this.consoleType(),this.node.properties.ports_mapping=this.portsComponent().ethernetPorts,this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(o),this.cd.markForCheck()}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-ethernet-switch"]],viewQuery:function(t,o){t&1&&Xt(o.portsComponent,Ed,5),t&2&&Kt()},inputs:{nodeName:[1,"nodeName"],consoleType:[1,"consoleType"]},outputs:{nodeName:"nodeNameChange",consoleType:"consoleTypeChange"},decls:10,vars:2,consts:[["chipList",""],["ports",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],[1,"matCard"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"valueChange","value"],[3,"value"],[3,"ethernetPorts"],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"h1",2),d(1),l(),s(2,"div",3)(3,"div",4),A(4,_Ce,22,5,"div",5),l()(),s(5,"div",6)(6,"button",7),g("click",function(){return o.onCancelClick()}),d(7,"Cancel"),l(),s(8,"button",8),g("click",function(){return o.onSaveClick()}),d(9,"Apply"),l()()),t&2&&(m(),ee("Configurator for Ethernet switch ",o.name),m(3),O(o.node?4:-1))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,we,Me,et,Se,Ee,vt,At,_t,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ed],encapsulation:2,changeDetection:0})}return n})();function vCe(n,i){if(n&1){let e=z();s(0,"mat-chip",14),g("removed",function(){let o=k(e).$implicit,r=v();return T(r.removeTag(o))}),d(1),s(2,"mat-icon",15),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}var aw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);vpcsConfigurationService=f(Lm);cd=f(Q);validationService=f(zi);controller;node;numberOfPorts;consoleTypes=[];categories=[];name;separatorKeysCodes=[13,188];nodeName=U("");nodeNumberOfPorts=U("");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=this.node.name,this.numberOfPorts=this.node.ports.length,this.nodeName.set(e.name||""),this.nodeNumberOfPorts.set(this.node.ports.length.toString()),this.getConfiguration(),this.node.tags||(this.node.tags=[]),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.vpcsConfigurationService.getConsoleTypes(),this.categories=this.vpcsConfigurationService.getCategories()}onSaveClick(){let e=this.validationService.required(this.nodeName(),"Name");if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}let t=this.nodeNumberOfPorts();if(t&&t.trim()!==""){let o=parseInt(t,10);if(isNaN(o)||o<0||o!==parseFloat(t)){this.toasterService.error("Number of ports must be a non-negative integer");return}this.numberOfPorts=o}else this.numberOfPorts=0;this.node.name=this.nodeName(),this.node.properties.ports_mapping=[];for(let o=0;o<this.numberOfPorts;o++)this.node.properties.ports_mapping.push({name:`Ethernet${o}`,port_number:o});this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:o=>{let r=o?.error?.message||o?.message||"Failed to update node";this.toasterService.error(r),this.cd.markForCheck()}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-ethernet-hub"]],inputs:{nodeName:[1,"nodeName"],nodeNumberOfPorts:[1,"nodeNumberOfPorts"]},outputs:{nodeName:"nodeNameChange",nodeNumberOfPorts:"nodeNumberOfPortsChange"},decls:28,vars:5,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],[3,"removed"],["matChipRemove",""]],template:function(t,o){if(t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),d(9,"Name"),l(),s(10,"input",8),g("input",function(a){return o.nodeName.set(a.target.value)}),l()(),s(11,"mat-form-field",9)(12,"mat-label"),d(13,"Tags"),l(),s(14,"mat-chip-grid",null,0),Y(16,vCe,4,1,"mat-chip",null,Ae),l(),s(18,"input",10),g("matChipInputTokenEnd",function(a){return o.addTag(a)}),l()(),s(19,"mat-form-field",7)(20,"mat-label"),d(21,"Number of ports"),l(),s(22,"input",8),g("input",function(a){return o.nodeNumberOfPorts.set(a.target.value)}),l()()()()()()(),s(23,"div",11)(24,"button",12),g("click",function(){return o.onCancelClick()}),d(25,"Cancel"),l(),s(26,"button",13),g("click",function(){return o.onSaveClick()}),d(27,"Apply"),l()()),t&2){let r=Pe(15);m(),ee("Configurator for Ethernet hub ",o.name),m(9),C("value",o.nodeName()),m(6),Z(o.node==null?null:o.node.tags),m(2),C("matChipInputFor",r)("matChipInputSeparatorKeyCodes",o.separatorKeysCodes),m(4),C("value",o.nodeNumberOfPorts())}},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,we,Me,et,Se,Ee,W,pe,ti,Jn,vi,Ci,mi,ie,de],encapsulation:2,changeDetection:0})}return n})();var CCe=()=>["c1700","c2600","c2691","c3600","c3725","c3745"],bCe=()=>[0,1,2,3,4,5,6],xCe=()=>[0,1,2];function yCe(n,i){if(n&1&&(s(0,"mat-label"),d(1),l()),n&2){let e=v(2);m(),ee(" (chassis: ",e.node.properties.chassis,")")}}function SCe(n,i){if(n&1){let e=z();s(0,"mat-chip",35),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",36),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function wCe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function MCe(n,i){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"Midplane"),l(),s(3,"mat-select",16),g("valueChange",function(o){k(e);let r=v(2);return T(r.midplane.set(o))}),Y(4,wCe,2,2,"mat-option",17,Ae),l()()}if(n&2){let e=v(2);m(3),C("value",e.midplane()),m(),Z(e.MidplaneTypes)}}function kCe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function TCe(n,i){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"NPE"),l(),s(3,"mat-select",16),g("valueChange",function(o){k(e);let r=v(2);return T(r.npe.set(o))}),Y(4,kCe,2,2,"mat-option",17,Ae),l()()}if(n&2){let e=v(2);m(3),C("value",e.npe()),m(),Z(e.NPETypes)}}function ECe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function DCe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function PCe(n,i){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"I/O memory"),l(),s(3,"input",12),g("input",function(o){k(e);let r=v(2);return T(r.iomem.set(o.target.value))}),l(),s(4,"span",25),d(5,"%"),l()()}if(n&2){let e=v(2);m(3),C("value",e.iomem())}}function ICe(n,i){n&1&&(s(0,"mat-option",17),d(1),l()),n&2&&(m(),ee(" ",""," "))}function ACe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function OCe(n,i){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2),l(),s(3,"mat-select",16),g("valueChange",function(o){k(e);let r=v().$implicit,a=v(2);return T(a.setSlotValue(r,o))}),A(4,ICe,2,1,"mat-option",17),Y(5,ACe,2,2,"mat-option",17,Ae),l()()}if(n&2){let e=v().$implicit,t=v(2);m(2),ee("Slot ",e),m(),C("value",t.getSlotValue(e)),m(),O(t.adapterMatrix[t.node.properties.platform][t.node.properties.chassis||""][e].length>1&&!t.adapterMatrix[t.node.properties.platform][t.node.properties.chassis||""][e][0].startsWith("C7200")?4:-1),m(),Z(t.adapterMatrix[t.node.properties.platform][t.node.properties.chassis||""][e])}}function NCe(n,i){if(n&1&&A(0,OCe,7,3,"mat-form-field",11),n&2){let e=i.$implicit,t=v(2);O(t.adapterMatrix[t.node.properties.platform][t.node.properties.chassis||""][e]?0:-1)}}function FCe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function RCe(n,i){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2),l(),s(3,"mat-select",16),g("valueChange",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.setWicValue(r,o))}),s(4,"mat-option",17),d(5),l(),Y(6,FCe,2,2,"mat-option",17,Ae),l()()}if(n&2){let e=v().$implicit,t=v(3);m(2),ee("WIC ",e),m(),C("value",t.getWicValue(e)),m(2),ee(" ",""," "),m(),Z(t.wicMatrix[t.node.properties.platform][e])}}function LCe(n,i){if(n&1&&A(0,RCe,8,3,"mat-form-field",11),n&2){let e=i.$implicit,t=v(3);O(t.wicMatrix[t.node.properties.platform][e]?0:-1)}}function VCe(n,i){n&1&&(s(0,"div",29)(1,"h6",30),d(2,"WICs"),l(),s(3,"div",31),Y(4,LCe,1,1,null,null,Ae),l()()),n&2&&(m(4),Z(Bt(0,xCe)))}function BCe(n,i){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",9),R(2,"br"),s(3,"mat-label"),d(4),l(),A(5,yCe,2,1,"mat-label"),R(6,"br")(7,"br"),s(8,"div",10)(9,"mat-form-field",11)(10,"mat-label"),d(11,"Name"),l(),s(12,"input",12),g("input",function(o){k(e);let r=v();return T(r.nodeName.set(o.target.value))}),l()(),s(13,"mat-form-field",13)(14,"mat-label"),d(15,"Tags"),l(),s(16,"mat-chip-grid",null,0),Y(18,SCe,4,1,"mat-chip",null,Ae),l(),s(20,"input",14),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(21,"mat-form-field",11)(22,"mat-label"),d(23,"IOS image path"),l(),s(24,"input",12),g("input",function(o){k(e);let r=v();return T(r.imagePath.set(o.target.value))}),l()(),s(25,"div",15),A(26,MCe,6,1,"mat-form-field",11),A(27,TCe,6,1,"mat-form-field",11),s(28,"mat-form-field",11)(29,"mat-label"),d(30,"Console type"),l(),s(31,"mat-select",16),g("valueChange",function(o){k(e);let r=v();return T(r.consoleType.set(o))}),Y(32,ECe,2,2,"mat-option",17,Ae),l()(),s(34,"mat-form-field",11)(35,"mat-label"),d(36,"Auxiliary console type"),l(),s(37,"mat-select",16),g("valueChange",function(o){k(e);let r=v();return T(r.auxType.set(o))}),Y(38,DCe,2,2,"mat-option",17,Ae),l()(),s(40,"mat-checkbox",18),g("change",function(o){k(e);let r=v();return T(r.consoleAutoStart.set(o.checked))}),d(41," Auto start console "),l()()()(),s(42,"mat-tab",19)(43,"div",20)(44,"div",21)(45,"div",22)(46,"h3",23),d(47,"Memory"),l()(),s(48,"div",24)(49,"div",10)(50,"mat-form-field",11)(51,"mat-label"),d(52,"RAM"),l(),s(53,"input",12),g("input",function(o){k(e);let r=v();return T(r.ram.set(o.target.value))}),l(),s(54,"span",25),d(55,"MiB"),l()(),s(56,"mat-form-field",11)(57,"mat-label"),d(58,"NVRAM"),l(),s(59,"input",12),g("input",function(o){k(e);let r=v();return T(r.nvram.set(o.target.value))}),l(),s(60,"span",25),d(61,"MiB"),l()(),A(62,PCe,6,1,"mat-form-field",11),l()()(),s(63,"div",21)(64,"div",22)(65,"h3",23),d(66,"Disks"),l()(),s(67,"div",24)(68,"div",10)(69,"mat-form-field",11)(70,"mat-label"),d(71,"PCMCIA disk0"),l(),s(72,"input",12),g("input",function(o){k(e);let r=v();return T(r.disk0.set(o.target.value))}),l(),s(73,"span",25),d(74,"MiB"),l()(),s(75,"mat-form-field",11)(76,"mat-label"),d(77,"PCMCIA disk1"),l(),s(78,"input",12),g("input",function(o){k(e);let r=v();return T(r.disk1.set(o.target.value))}),l(),s(79,"span",25),d(80,"MiB"),l()(),s(81,"mat-checkbox",26),g("change",function(o){k(e);let r=v();return T(r.autoDeleteDisks.set(o.checked))}),d(82," Automatically delete NVRAM and disk files "),l()()()()()(),s(83,"mat-tab",27)(84,"div",10)(85,"div",28)(86,"div",29)(87,"h6",30),d(88,"Network Adapters"),l(),s(89,"div",31),Y(90,NCe,1,1,null,null,Ae),l()(),A(92,VCe,6,1,"div",29),l()()(),s(93,"mat-tab",32)(94,"div",10)(95,"div",20)(96,"div",21)(97,"div",22)(98,"h3",23),d(99,"System"),l()(),s(100,"div",24)(101,"mat-form-field",11)(102,"mat-label"),d(103,"System ID"),l(),s(104,"input",12),g("input",function(o){k(e);let r=v();return T(r.systemId.set(o.target.value))}),l()(),s(105,"mat-form-field",11)(106,"mat-label"),d(107,"Base MAC"),l(),s(108,"input",12),g("input",function(o){k(e);let r=v();return T(r.baseMac.set(o.target.value))}),l()()()(),s(109,"div",21)(110,"div",22)(111,"h3",23),d(112,"Optimizations"),l()(),s(113,"div",24)(114,"mat-form-field",11)(115,"mat-label"),d(116,"Idle-PC"),l(),s(117,"input",33),g("input",function(o){k(e);let r=v();return T(r.idlepc.set(o.target.value))}),l()(),s(118,"mat-form-field",11)(119,"mat-label"),d(120,"Idlemax"),l(),s(121,"input",12),g("input",function(o){k(e);let r=v();return T(r.idlemax.set(o.target.value))}),l()(),s(122,"mat-form-field",11)(123,"mat-label"),d(124,"Idlesleep"),l(),s(125,"input",12),g("input",function(o){k(e);let r=v();return T(r.idlesleep.set(o.target.value))}),l(),s(126,"span",25),d(127,"ms"),l()(),s(128,"mat-form-field",11)(129,"mat-label"),d(130,"Exec area"),l(),s(131,"input",12),g("input",function(o){k(e);let r=v();return T(r.execArea.set(o.target.value))}),l(),s(132,"span",25),d(133,"MiB"),l()(),s(134,"mat-checkbox",26),g("change",function(o){k(e);let r=v();return T(r.mmap.set(o.checked))}),d(135," Enable mmap support "),l(),s(136,"mat-checkbox",26),g("change",function(o){k(e);let r=v();return T(r.sparsemem.set(o.checked))}),d(137," Enable sparse memory support "),l()()()()()(),s(138,"mat-tab",34)(139,"div",10)(140,"mat-form-field",11)(141,"mat-label"),d(142,"Usage"),l(),s(143,"textarea",33),g("input",function(o){k(e);let r=v();return T(r.usage.set(o.target.value))}),l()()()()()}if(n&2){let e=Pe(17),t=v();m(4),ee("Platform: ",t.node.properties.platform),m(),O(t.node.properties.chassis?5:-1),m(7),C("value",t.nodeName()),m(6),Z(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.imagePath()),m(2),O(t.node.properties.midplane?26:-1),m(),O(t.node.properties.npe?27:-1),m(4),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(5),C("value",t.auxType()),m(),Z(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(13),C("value",t.ram()),m(6),C("value",t.nvram()),m(3),O(Bt(27,CCe).includes(t.node.properties.platform)?62:-1),m(10),C("value",t.disk0()),m(6),C("value",t.disk1()),m(3),C("checked",t.autoDeleteDisks()),m(9),Z(Bt(28,bCe)),m(2),O(t.wicMatrix[t.node.properties.platform]?92:-1),m(12),C("value",t.systemId()),m(4),C("value",t.baseMac()),m(9),C("value",t.idlepc()),m(4),C("value",t.idlemax()),m(4),C("value",t.idlesleep()),m(6),C("value",t.execArea()),m(3),C("checked",t.mmap()),m(2),C("checked",t.sparsemem()),m(7),C("value",t.usage())}}var sw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);configurationService=f(Pm);cd=f(Q);validationService=f(P0);controller;node;name;consoleTypes=[];NPETypes=[];MidplaneTypes=[];adapterMatrix={};wicMatrix={};separatorKeysCodes=[13,188];nodeName=U("");imagePath=U("");midplane=U("");npe=U("");consoleType=U("");auxType=U("");consoleAutoStart=U(!1);slot0=U("");slot1=U("");slot2=U("");slot3=U("");slot4=U("");slot5=U("");slot6=U("");wic0=U("");wic1=U("");wic2=U("");ram=U("");nvram=U("");iomem=U("");disk0=U("");disk1=U("");autoDeleteDisks=U(!1);systemId=U("");baseMac=U("");idlepc=U("");idlemax=U("");idlesleep=U("");execArea=U("");mmap=U(!1);sparsemem=U(!1);usage=U("");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||""),this.imagePath.set(e.properties.image||""),this.midplane.set(e.properties.midplane||""),this.npe.set(e.properties.npe||""),this.consoleType.set(e.console_type||""),this.auxType.set(e.aux_type||""),this.consoleAutoStart.set(e.console_auto_start||!1),this.slot0.set(e.properties.slot0||""),this.slot1.set(e.properties.slot1||""),this.slot2.set(e.properties.slot2||""),this.slot3.set(e.properties.slot3||""),this.slot4.set(e.properties.slot4||""),this.slot5.set(e.properties.slot5||""),this.slot6.set(e.properties.slot6||""),this.wic0.set(e.properties.wic0||""),this.wic1.set(e.properties.wic1||""),this.wic2.set(e.properties.wic2||""),this.ram.set(e.properties.ram?.toString()||""),this.nvram.set(e.properties.nvram?.toString()||""),this.iomem.set(e.properties.iomem?.toString()||""),this.disk0.set(e.properties.disk0?.toString()||""),this.disk1.set(e.properties.disk1?.toString()||""),this.autoDeleteDisks.set(e.properties.auto_delete_disks||!1),this.systemId.set(e.properties.system_id||""),this.baseMac.set(e.properties.mac_addr||""),this.idlepc.set(e.properties.idlepc||""),this.idlemax.set(e.properties.idlemax?.toString()||""),this.idlesleep.set(e.properties.idlesleep?.toString()||""),this.execArea.set(e.properties.exec_area?.toString()||""),this.mmap.set(e.properties.mmap||!1),this.sparsemem.set(e.properties.sparsemem||!1),this.usage.set(e.properties.usage||""),this.node.tags||(this.node.tags=[]),this.getConfiguration(),this.fillSlotsData(),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.configurationService.getConsoleTypes(),this.NPETypes=this.configurationService.getNPETypes(),this.MidplaneTypes=this.configurationService.getMidplaneTypes(),this.adapterMatrix=this.configurationService.getAdapterMatrix(),this.wicMatrix=this.configurationService.getWicMatrix()}fillSlotsData(){}getSlotValue(e){return[this.slot0(),this.slot1(),this.slot2(),this.slot3(),this.slot4(),this.slot5(),this.slot6()][e]||""}setSlotValue(e,t){[this.slot0,this.slot1,this.slot2,this.slot3,this.slot4,this.slot5,this.slot6][e]?.set(t)}getWicValue(e){return[this.wic0(),this.wic1(),this.wic2()][e]||""}setWicValue(e,t){[this.wic0,this.wic1,this.wic2][e]?.set(t)}saveSlotsData(){let e=[this.slot0(),this.slot1(),this.slot2(),this.slot3(),this.slot4(),this.slot5(),this.slot6()],t=[this.wic0(),this.wic1(),this.wic2()],o=this.node.properties.platform,r=this.node.properties.chassis||"";for(let a=0;a<=6;a++)this.adapterMatrix?.[o]?.[r]?.[a]?this.node.properties[`slot${a}`]=e[a]||"":delete this.node.properties[`slot${a}`];for(let a=0;a<=2;a++)this.wicMatrix?.[o]?.[a]?this.node.properties[`wic${a}`]=t[a]||"":delete this.node.properties[`wic${a}`]}onSaveClick(){let e=this.validationService.validateName(this.nodeName());if(!e.isValid){this.toasterService.error(e.errorMessage);return}let t=this.validationService.validateImagePath(this.imagePath());if(!t.isValid){this.toasterService.error(t.errorMessage);return}let o=this.node.properties.platform,r=this.validationService.validateRamForPlatform(this.ram(),o);if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.validateNvramForPlatform(this.nvram(),o);if(!a.isValid){this.toasterService.error(a.errorMessage);return}let c=this.validationService.validateMacAddress(this.baseMac());if(!c.isValid){this.toasterService.error(c.errorMessage);return}let p=this.validationService.validateIdlepc(this.idlepc());if(!p.isValid){this.toasterService.error(p.errorMessage);return}if(this.iomem()){let _=this.validationService.validateIomem(this.iomem());if(!_.isValid){this.toasterService.error(_.errorMessage);return}}this.node.name=this.nodeName(),this.node.properties.image=this.imagePath(),["c7200"].includes(this.node.properties.platform)?(this.node.properties.midplane=this.midplane()||null,this.node.properties.npe=this.npe()||null):(delete this.node.properties.midplane,delete this.node.properties.npe),this.node.console_type=this.consoleType(),this.node.aux_type=this.auxType(),this.node.console_auto_start=this.consoleAutoStart(),this.node.properties.ram=parseInt(this.ram(),10)||0,this.node.properties.nvram=parseInt(this.nvram(),10)||0,["c1700","c2600","c2691","c3600","c3725","c3745"].includes(this.node.properties.platform)?this.node.properties.iomem=this.iomem()?parseInt(this.iomem(),10):null:delete this.node.properties.iomem,this.node.properties.disk0=parseInt(this.disk0(),10)||0,this.node.properties.disk1=parseInt(this.disk1(),10)||0,this.node.properties.auto_delete_disks=this.autoDeleteDisks(),this.node.properties.system_id=this.systemId(),this.node.properties.mac_addr=this.baseMac(),this.node.properties.idlepc=this.idlepc(),this.node.properties.idlemax=parseInt(this.idlemax(),10)||0,this.node.properties.idlesleep=parseInt(this.idlesleep(),10)||0,this.node.properties.exec_area=parseInt(this.execArea(),10)||0,this.node.properties.mmap=this.mmap(),this.node.properties.sparsemem=this.sparsemem(),this.node.properties.usage=this.usage(),this.saveSlotsData(),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:_=>{let S=_?.error?.message||_?.message||"Failed to update node";this.toasterService.error(S),this.cd.markForCheck()}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-ios"]],inputs:{nodeName:[1,"nodeName"],imagePath:[1,"imagePath"],midplane:[1,"midplane"],npe:[1,"npe"],consoleType:[1,"consoleType"],auxType:[1,"auxType"],consoleAutoStart:[1,"consoleAutoStart"],slot0:[1,"slot0"],slot1:[1,"slot1"],slot2:[1,"slot2"],slot3:[1,"slot3"],slot4:[1,"slot4"],slot5:[1,"slot5"],slot6:[1,"slot6"],wic0:[1,"wic0"],wic1:[1,"wic1"],wic2:[1,"wic2"],ram:[1,"ram"],nvram:[1,"nvram"],iomem:[1,"iomem"],disk0:[1,"disk0"],disk1:[1,"disk1"],autoDeleteDisks:[1,"autoDeleteDisks"],systemId:[1,"systemId"],baseMac:[1,"baseMac"],idlepc:[1,"idlepc"],idlemax:[1,"idlemax"],idlesleep:[1,"idlesleep"],execArea:[1,"execArea"],mmap:[1,"mmap"],sparsemem:[1,"sparsemem"],usage:[1,"usage"]},outputs:{nodeName:"nodeNameChange",imagePath:"imagePathChange",midplane:"midplaneChange",npe:"npeChange",consoleType:"consoleTypeChange",auxType:"auxTypeChange",consoleAutoStart:"consoleAutoStartChange",slot0:"slot0Change",slot1:"slot1Change",slot2:"slot2Change",slot3:"slot3Change",slot4:"slot4Change",slot5:"slot5Change",slot6:"slot6Change",wic0:"wic0Change",wic1:"wic1Change",wic2:"wic2Change",ram:"ramChange",nvram:"nvramChange",iomem:"iomemChange",disk0:"disk0Change",disk1:"disk1Change",autoDeleteDisks:"autoDeleteDisksChange",systemId:"systemIdChange",baseMac:"baseMacChange",idlepc:"idlepcChange",idlemax:"idlemaxChange",idlesleep:"idlesleepChange",execArea:"execAreaChange",mmap:"mmapChange",sparsemem:"sparsememChange",usage:"usageChange"},decls:12,vars:2,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["label","General settings"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"form-grid"],[3,"valueChange","value"],[3,"value"],[1,"form-grid__full",3,"change","checked"],["label","Memories and disks"],[1,"disk-cards-grid"],[1,"disk-card"],[1,"disk-card__header"],[1,"disk-card__title"],[1,"disk-card__content"],["matSuffix",""],[3,"change","checked"],["label","Slots"],[1,"ios-configurator__slots-section"],[1,"ios-configurator__slots-group"],[1,"ios-configurator__slots-title"],[1,"ios-configurator__slots-grid"],["label","Advanced"],["matInput","",3,"input","value"],["label","Usage"],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),A(6,BCe,144,29,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),g("click",function(){return o.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),g("click",function(){return o.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for IOS router ",o.name),m(5),O(o.name?6:-1))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,To,tr,nr,we,Me,et,Mi,Se,Ee,vt,At,_t,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ot,Gt],styles:["table[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%], .configButton[_ngcontent-%COMP%]{width:100%}.modal-form-container[_ngcontent-%COMP%]{padding:16px}.file-button[_ngcontent-%COMP%]{width:18%}.create-button[_ngcontent-%COMP%]{width:100%}.file-name-form-field[_ngcontent-%COMP%]{padding-left:2%;width:80%}.nonvisible[_ngcontent-%COMP%]{display:none}mat-radio-button[_ngcontent-%COMP%]{margin-right:8px}.tags-field[_ngcontent-%COMP%]{width:100%}",".ios-configurator__slots-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:32px}.ios-configurator__slots-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ios-configurator__slots-title[_ngcontent-%COMP%]{font-size:16px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.ios-configurator__slots-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}"],changeDetection:0})}return n})();function zCe(n,i){if(n&1){let e=z();s(0,"mat-chip",22),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",23),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function jCe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function $Ce(n,i){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"RAM size"),l(),s(3,"input",12),g("input",function(o){k(e);let r=v(2);return T(r.ram.set(o.target.value))}),l(),s(4,"span",24),d(5,"MB"),l()()}if(n&2){let e=v(2);m(3),C("value",e.ram())}}function HCe(n,i){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"NVRAM size"),l(),s(3,"input",12),g("input",function(o){k(e);let r=v(2);return T(r.nvram.set(o.target.value))}),l(),s(4,"span",24),d(5,"KB"),l()()}if(n&2){let e=v(2);m(3),C("value",e.nvram())}}function UCe(n,i){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",9)(2,"div",10)(3,"mat-form-field",11)(4,"mat-label"),d(5,"Name"),l(),s(6,"input",12),g("input",function(o){k(e);let r=v();return T(r.nodeName.set(o.target.value))}),l()(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),Y(12,zCe,4,1,"mat-chip",null,Ae),l(),s(14,"input",14),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),g("valueChange",function(o){k(e);let r=v();return T(r.consoleType.set(o))}),Y(19,jCe,2,2,"mat-option",16,Ae),l()(),s(21,"mat-checkbox",17),g("change",function(o){k(e);let r=v();return T(r.consoleAutoStart.set(o.checked))}),d(22," Auto start console "),l(),s(23,"mat-checkbox",17),g("change",function(o){k(e);let r=v();return T(r.useDefaultIouValues.set(o.checked))}),d(24," Use default IOU values for memories "),l(),A(25,$Ce,6,1,"mat-form-field",11),A(26,HCe,6,1,"mat-form-field",11),l()(),s(27,"mat-tab",18)(28,"div",19)(29,"mat-form-field",11)(30,"mat-label"),d(31,"Ethernet adapters"),l(),s(32,"input",12),g("input",function(o){k(e);let r=v();return T(r.ethernetAdapters.set(o.target.value))}),l()(),s(33,"mat-form-field",11)(34,"mat-label"),d(35,"Serial adapters"),l(),s(36,"input",12),g("input",function(o){k(e);let r=v();return T(r.serialAdapters.set(o.target.value))}),l()()()(),s(37,"mat-tab",20)(38,"div",10)(39,"mat-form-field",11)(40,"mat-label"),d(41,"Usage"),l(),s(42,"textarea",21),g("input",function(o){k(e);let r=v();return T(r.usage.set(o.target.value))}),l()()()()()}if(n&2){let e=Pe(11),t=v();m(6),C("value",t.nodeName()),m(6),Z(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.consoleType()),m(),Z(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(2),C("checked",t.useDefaultIouValues()),m(2),O(t.useDefaultIouValues()?-1:25),m(),O(t.useDefaultIouValues()?-1:26),m(6),C("value",t.ethernetAdapters()),m(4),C("value",t.serialAdapters()),m(6),C("value",t.usage())}}var lw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);configurationService=f(ef);cd=f(Q);validationService=f(I0);controller;node;name;separatorKeysCodes=[13,188];consoleTypes=[];nodeName=U("");consoleType=U("");consoleAutoStart=U(!1);useDefaultIouValues=U(!0);ram=U("");nvram=U("");ethernetAdapters=U("");serialAdapters=U("");usage=U("");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||""),this.consoleType.set(e.console_type||""),this.consoleAutoStart.set(e.console_auto_start||!1),this.useDefaultIouValues.set(e.properties.use_default_iou_values!==void 0?e.properties.use_default_iou_values:!0),this.ram.set(e.properties.ram?.toString()||""),this.nvram.set(e.properties.nvram?.toString()||""),this.ethernetAdapters.set(e.properties.ethernet_adapters?.toString()||""),this.serialAdapters.set(e.properties.serial_adapters?.toString()||""),this.usage.set(e.properties.usage||""),this.getConfiguration(),this.node.tags||(this.node.tags=[]),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.configurationService.getConsoleTypes()}onSaveClick(){let e=this.validationService.validateName(this.nodeName());if(!e.isValid){this.toasterService.error(e.errorMessage);return}let t=this.validationService.validateEthernetAdapters(this.ethernetAdapters());if(!t.isValid){this.toasterService.error(t.errorMessage);return}let o=this.validationService.validateSerialAdapters(this.serialAdapters());if(!o.isValid){this.toasterService.error(o.errorMessage);return}this.node.name=this.nodeName(),this.node.console_type=this.consoleType(),this.node.console_auto_start=this.consoleAutoStart(),this.node.properties.use_default_iou_values=this.useDefaultIouValues(),this.node.properties.ram=parseInt(this.ram(),10)||0,this.node.properties.nvram=parseInt(this.nvram(),10)||0,this.node.properties.usage=this.usage(),this.node.properties.ethernet_adapters=parseInt(this.ethernetAdapters(),10)||0,this.node.properties.serial_adapters=parseInt(this.serialAdapters(),10)||0,this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:r=>{let a=r?.error?.message||r?.message||"Failed to update node";this.toasterService.error(a),this.cd.markForCheck()}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-iou"]],inputs:{nodeName:[1,"nodeName"],consoleType:[1,"consoleType"],consoleAutoStart:[1,"consoleAutoStart"],useDefaultIouValues:[1,"useDefaultIouValues"],ram:[1,"ram"],nvram:[1,"nvram"],ethernetAdapters:[1,"ethernetAdapters"],serialAdapters:[1,"serialAdapters"],usage:[1,"usage"]},outputs:{nodeName:"nodeNameChange",consoleType:"consoleTypeChange",consoleAutoStart:"consoleAutoStartChange",useDefaultIouValues:"useDefaultIouValuesChange",ram:"ramChange",nvram:"nvramChange",ethernetAdapters:"ethernetAdaptersChange",serialAdapters:"serialAdaptersChange",usage:"usageChange"},decls:12,vars:2,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["label","General settings"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"valueChange","value"],[3,"value"],[3,"change","checked"],["label","Network"],[1,"two-column-grid"],["label","Usage"],["matInput","",3,"input","value"],[3,"removed"],["matChipRemove",""],["matSuffix",""]],template:function(t,o){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),A(6,UCe,43,11,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),g("click",function(){return o.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),g("click",function(){return o.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for IOU device ",o.name),m(5),O(o.name?6:-1))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,To,tr,nr,we,Me,et,Mi,Se,Ee,vt,At,_t,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ot,Gt],encapsulation:2,changeDetection:0})}return n})();function GCe(n,i){if(n&1){let e=z();s(0,"mat-chip",14),g("removed",function(){let o=k(e).$implicit,r=v();return T(r.removeTag(o))}),d(1),s(2,"mat-icon",15),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}var cw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);cd=f(Q);validationService=f(zi);controller;node;name;separatorKeysCodes=[13,188];nodeName=U("");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||""),this.node.tags||(this.node.tags=[]),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}onSaveClick(){let e=this.validationService.required(this.nodeName(),"Name");if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}this.node.name=this.nodeName(),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(o)}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-nat"]],inputs:{nodeName:[1,"nodeName"]},outputs:{nodeName:"nodeNameChange"},decls:24,vars:4,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],[3,"removed"],["matChipRemove",""]],template:function(t,o){if(t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),d(9,"Name"),l(),s(10,"input",8),g("input",function(a){return o.nodeName.set(a.target.value)}),l()(),s(11,"mat-form-field",9)(12,"mat-label"),d(13,"Tags"),l(),s(14,"mat-chip-grid",null,0),Y(16,GCe,4,1,"mat-chip",null,Ae),l(),s(18,"input",10),g("matChipInputTokenEnd",function(a){return o.addTag(a)}),l()()()()()()(),s(19,"div",11)(20,"button",12),g("click",function(){return o.onCancelClick()}),d(21,"Cancel"),l(),s(22,"button",13),g("click",function(){return o.onSaveClick()}),d(23,"Apply"),l()()),t&2){let r=Pe(15);m(),ee("Configurator for NAT node ",o.name),m(9),C("value",o.nodeName()),m(6),Z(o.node==null?null:o.node.tags),m(2),C("matChipInputFor",r)("matChipInputSeparatorKeyCodes",o.separatorKeysCodes)}},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,we,Me,et,Se,Ee,W,pe,ti,Jn,vi,Ci,mi,ie,de],encapsulation:2,changeDetection:0})}return n})();function WCe(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e.toUpperCase())}}function qCe(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function QCe(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function XCe(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function KCe(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function YCe(n,i){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Cluster size (KB)"),l(),s(3,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.clusterSize.set(o))}),s(4,"mat-option",18),d(5,"Default (64)"),l(),Y(6,XCe,2,2,"mat-option",10,Ae),l()(),s(8,"mat-form-field",8)(9,"mat-label"),d(10,"Refcount bits"),l(),s(11,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.refcountBits.set(o))}),s(12,"mat-option",18),d(13,"Default (12)"),l(),Y(14,KCe,2,2,"mat-option",10,Ae),l()()}if(n&2){let e=v();m(3),C("value",e.clusterSize()),m(3),Z(e.clusterSizeOptions),m(5),C("value",e.refcountBits()),m(3),Z(e.refcountBitsOptions)}}function ZCe(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function JCe(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function e1e(n,i){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Subformat"),l(),s(3,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.subformat.set(o))}),s(4,"mat-option",18),d(5,"Default"),l(),Y(6,ZCe,2,2,"mat-option",10,Ae),l()(),s(8,"mat-form-field",8)(9,"mat-label"),d(10,"Adapter type"),l(),s(11,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.adapterType.set(o))}),s(12,"mat-option",18),d(13,"Default"),l(),Y(14,JCe,2,2,"mat-option",10,Ae),l()(),s(16,"mat-form-field",8)(17,"mat-label"),d(18,"Zeroed grain"),l(),s(19,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.zeroedGrain.set(o))}),s(20,"mat-option",18),d(21,"Default"),l(),s(22,"mat-option",13),d(23,"on"),l(),s(24,"mat-option",14),d(25,"off"),l()()()}if(n&2){let e=v();m(3),C("value",e.subformat()),m(3),Z(e.vmdkSubformatOptions),m(5),C("value",e.adapterType()),m(3),Z(e.adapterTypeOptions),m(5),C("value",e.zeroedGrain())}}function t1e(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function n1e(n,i){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Subformat"),l(),s(3,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.subformat.set(o))}),s(4,"mat-option",18),d(5,"Default"),l(),Y(6,t1e,2,2,"mat-option",10,Ae),l()(),s(8,"mat-form-field",8)(9,"mat-label"),d(10,"Static"),l(),s(11,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.static.set(o))}),s(12,"mat-option",18),d(13,"Default"),l(),s(14,"mat-option",13),d(15,"on"),l(),s(16,"mat-option",14),d(17,"off"),l()()()}if(n&2){let e=v();m(3),C("value",e.subformat()),m(3),Z(e.vhdSubformatOptions),m(5),C("value",e.static())}}function i1e(n,i){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Static"),l(),s(3,"mat-select",9),g("valueChange",function(o){k(e);let r=v();return T(r.static.set(o))}),s(4,"mat-option",18),d(5,"Default"),l(),s(6,"mat-option",13),d(7,"on"),l(),s(8,"mat-option",14),d(9,"off"),l()()()}if(n&2){let e=v();m(3),C("value",e.static())}}var dw=(()=>{class n{controller;nodeId;projectId;formatOptions=["qcow2","qcow","vhd","vdi","vmdk","raw"];preallocationsOptions=["off","metadata","falloc","full"];dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);qemuService=f(Kr);validationService=f(zi);diskName=U("");mountPoint=U("");format=U("");size=U("");preallocation=U("");lazyRefcounts=U("");clusterSize=U("");refcountBits=U("");subformat=U("");static=U("");adapterType=U("");zeroedGrain=U("");mountPointOptions=["hda","hdb","hdc","hdd"];clusterSizeOptions=[16,32,64,128,256];refcountBitsOptions=[1,2,4,8,12,16];vmdkSubformatOptions=["monolithicSparse","monolithicFlat","twoGbMaxExtentSparse","twoGbMaxExtentFlat","streamOptimized","vmfs","vmfsThin","vmfsDefault"];vhdSubformatOptions=["dynamic","fixed"];adapterTypeOptions=["ide","lsilogic","buslogic","legacyESX"];onSaveClick(){let e=this.validationService.required(this.mountPoint(),"Mount point");if(!e.isValid){this.toasterService.error(e.errorMessage);return}let t=this.validationService.required(this.diskName(),"Filename");if(!t.isValid){this.toasterService.error(t.errorMessage);return}let o="."+this.format();if(!this.diskName().toLowerCase().endsWith(o)){this.toasterService.error(`Filename must end with ${o} extension for ${this.format()} format`);return}let r=this.validationService.required(this.format(),"Format");if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.required(this.size(),"Size");if(!a.isValid){this.toasterService.error(a.errorMessage);return}let c=parseInt(this.size(),10);if(isNaN(c)||c<1){this.toasterService.error("Size must be a positive integer (at least 1 MB)");return}let p={format:this.format(),size:c};this.preallocation()&&(p.preallocation=this.preallocation()),this.lazyRefcounts()&&(p.lazy_refcounts=this.lazyRefcounts()),this.clusterSize()&&(p.cluster_size=parseInt(this.clusterSize(),10)),this.refcountBits()&&(p.refcount_bits=parseInt(this.refcountBits(),10)),this.subformat()&&(p.subformat=this.subformat()),this.static()&&(p.static=this.static()),this.adapterType()&&(p.adapter_type=this.adapterType()),this.zeroedGrain()&&(p.zeroed_grain=this.zeroedGrain()),this.qemuService.createDiskImage(this.controller,this.projectId,this.nodeId,this.diskName(),p).subscribe({next:()=>{this.dialogRef.close({mountPoint:this.mountPoint(),filename:this.diskName()})},error:u=>{let h=u.error?.detail||u.message||"Failed to create image";this.toasterService.error(h)}})}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-qemu-image-creator"]],inputs:{diskName:[1,"diskName"],mountPoint:[1,"mountPoint"],format:[1,"format"],size:[1,"size"],preallocation:[1,"preallocation"],lazyRefcounts:[1,"lazyRefcounts"],clusterSize:[1,"clusterSize"],refcountBits:[1,"refcountBits"],subformat:[1,"subformat"],static:[1,"static"],adapterType:[1,"adapterType"],zeroedGrain:[1,"zeroedGrain"]},outputs:{diskName:"diskNameChange",mountPoint:"mountPointChange",format:"formatChange",size:"sizeChange",preallocation:"preallocationChange",lazyRefcounts:"lazyRefcountsChange",clusterSize:"clusterSizeChange",refcountBits:"refcountBitsChange",subformat:"subformatChange",static:"staticChange",adapterType:"adapterTypeChange",zeroedGrain:"zeroedGrainChange"},decls:53,vars:10,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"info-note"],[1,"matCard"],[1,"form-container"],[2,"display","grid","grid-template-columns","1fr 1fr","gap","16px"],[1,"form-field"],[3,"valueChange","value"],[3,"value"],["matInput","","type","text","placeholder","e.g. data.qcow2",3,"input","value"],["matInput","","type","text",3,"input","value"],["value","on"],["value","off"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["value",""]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Create QEMU Disk Image"),l(),s(2,"div",1)(3,"div",2)(4,"div",3)(5,"p",4),d(6," The image will be created in the node's working directory. After creation, it will appear in the HDD field and can be selected from the dropdown in the HDD tab. "),l(),s(7,"mat-card",5)(8,"div",6)(9,"div",7)(10,"mat-form-field",8)(11,"mat-label"),d(12,"Mount point *"),l(),s(13,"mat-select",9),g("valueChange",function(a){return o.mountPoint.set(a)}),Y(14,WCe,2,2,"mat-option",10,Ae),l()(),s(16,"mat-form-field",8)(17,"mat-label"),d(18,"Filename *"),l(),s(19,"input",11),g("input",function(a){return o.diskName.set(a.target.value)}),l()()(),s(20,"mat-form-field",8)(21,"mat-label"),d(22,"Format *"),l(),s(23,"mat-select",9),g("valueChange",function(a){return o.format.set(a)}),Y(24,qCe,2,2,"mat-option",10,Ae),l()(),s(26,"mat-form-field",8)(27,"mat-label"),d(28,"Size (MB) *"),l(),s(29,"input",12),g("input",function(a){return o.size.set(a.target.value)}),l()(),s(30,"mat-form-field",8)(31,"mat-label"),d(32,"Preallocation"),l(),s(33,"mat-select",9),g("valueChange",function(a){return o.preallocation.set(a)}),Y(34,QCe,2,2,"mat-option",10,Ae),l()(),s(36,"mat-form-field",8)(37,"mat-label"),d(38,"Lazy refcounts"),l(),s(39,"mat-select",9),g("valueChange",function(a){return o.lazyRefcounts.set(a)}),s(40,"mat-option",13),d(41,"on"),l(),s(42,"mat-option",14),d(43,"off"),l()()(),A(44,YCe,16,2),A(45,e1e,26,3),A(46,n1e,18,2),A(47,i1e,10,1,"mat-form-field",8),l()()()()(),s(48,"div",15)(49,"button",16),g("click",function(){return o.onCancelClick()}),d(50,"Cancel"),l(),s(51,"button",17),g("click",function(){return o.onSaveClick()}),d(52,"Apply"),l()()),t&2&&(m(13),C("value",o.mountPoint()),m(),Z(o.mountPointOptions),m(5),C("value",o.diskName()),m(4),C("value",o.format()),m(),Z(o.formatOptions),m(5),C("value",o.size()),m(4),C("value",o.preallocation()),m(),Z(o.preallocationsOptions),m(5),C("value",o.lazyRefcounts()),m(5),O(o.format()==="qcow2"?44:-1),m(),O(o.format()==="vmdk"?45:-1),m(),O(o.format()==="vhd"||o.format()==="vpc"?46:-1),m(),O(o.format()==="vdi"?47:-1))},dependencies:[ne,Xe,_e,Ne,Fe,W,pe,we,Me,et,Se,Ee,vt,At,_t,Fo,Mt,On],styles:["table[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%], .configButton[_ngcontent-%COMP%]{width:100%}.modal-form-container[_ngcontent-%COMP%]{padding:16px}.file-button[_ngcontent-%COMP%]{width:18%}.create-button[_ngcontent-%COMP%]{width:100%}.file-name-form-field[_ngcontent-%COMP%]{padding-left:2%;width:80%}.nonvisible[_ngcontent-%COMP%]{display:none}mat-radio-button[_ngcontent-%COMP%]{margin-right:8px}.tags-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var qz=(n,i)=>i[1],mw=(n,i)=>i.filename,o1e=(n,i)=>i.value;function r1e(n,i){if(n&1){let e=z();s(0,"mat-chip",70),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",71),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function a1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function s1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function l1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function c1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function d1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function m1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function p1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,m1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.projectDiskFiles)}}function u1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function h1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function f1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function g1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,f1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.projectDiskFiles)}}function _1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function v1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function C1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function b1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,C1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.projectDiskFiles)}}function x1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function y1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function S1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function w1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,S1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.projectDiskFiles)}}function M1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e.filename),m(),j(e.filename)}}function k1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function T1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function E1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,T1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredIsoFiles)}}function D1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function P1e(n,i){if(n&1&&(s(0,"mat-optgroup",52),Y(1,D1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredGlobalIsoImages)}}function I1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ui(" ",e.name," (",e.value,") ")}}function A1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function O1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,A1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredNodeFiles)}}function N1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function F1e(n,i){if(n&1&&(s(0,"mat-optgroup",52),Y(1,N1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredGlobalFiles)}}function R1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function L1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,R1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredNodeFiles)}}function V1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function B1e(n,i){if(n&1&&(s(0,"mat-optgroup",52),Y(1,V1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredGlobalFiles)}}function z1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function j1e(n,i){if(n&1&&(s(0,"mat-optgroup",51),Y(1,z1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredNodeFiles)}}function $1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function H1e(n,i){if(n&1&&(s(0,"mat-optgroup",52),Y(1,$1e,2,2,"mat-option",36,Ae),l()),n&2){let e=v(2);m(),Z(e.filteredGlobalFiles)}}function U1e(n,i){if(n&1){let e=z();s(0,"mat-form-field",30)(1,"mat-label"),d(2,"Percentage of CPU allowed"),l(),s(3,"input",31),g("input",function(o){k(e);let r=v(2);return T(r.cpuThrottling.set(o.target.value))}),l()()}if(n&2){let e=v(2);m(3),C("value",e.cpuThrottling())}}function G1e(n,i){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function W1e(n,i){if(n&1){let e=z();s(0,"div")(1,"mat-tab-group")(2,"mat-tab",29)(3,"mat-form-field",30)(4,"mat-label"),d(5,"Name"),l(),s(6,"input",31),g("input",function(o){k(e);let r=v();return T(r.nodeName.set(o.target.value))}),l()(),s(7,"mat-form-field",32)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),Y(12,r1e,4,1,"mat-chip",null,Ae),l(),s(14,"input",33),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(15,"div",34)(16,"mat-form-field",30)(17,"mat-label"),d(18,"Platform"),l(),s(19,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.platform.set(o))}),Y(20,a1e,2,2,"mat-option",36,Ae),l()(),s(22,"mat-form-field",30)(23,"mat-label"),d(24,"RAM"),l(),s(25,"input",31),g("input",function(o){k(e);let r=v();return T(r.ram.set(o.target.value))}),l(),s(26,"span",37),d(27,"MB"),l()(),s(28,"mat-form-field",30)(29,"mat-label"),d(30,"vCPUs"),l(),s(31,"input",38),g("input",function(o){k(e);let r=v();return T(r.cpus.set(o.target.value))}),l()(),s(32,"mat-form-field",30)(33,"mat-label"),d(34,"Boot priority"),l(),s(35,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.bootPriority.set(o))}),Y(36,s1e,2,2,"mat-option",36,qz),l()()(),s(38,"mat-form-field",30)(39,"mat-label"),d(40,"On close"),l(),s(41,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.onClose.set(o))}),Y(42,l1e,2,2,"mat-option",36,qz),l()(),s(44,"div",39)(45,"mat-form-field",30)(46,"mat-label"),d(47,"Console type"),l(),s(48,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.consoleType.set(o))}),Y(49,c1e,2,2,"mat-option",36,Ae),l()(),s(51,"mat-form-field",30)(52,"mat-label"),d(53,"Auxiliary console type"),l(),s(54,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.auxType.set(o))}),Y(55,d1e,2,2,"mat-option",36,Ae),l()()(),s(57,"mat-checkbox",40),g("change",function(o){k(e);let r=v();return T(r.consoleAutoStart.set(o.checked))}),d(58," Auto start console "),l()(),s(59,"mat-tab",41)(60,"div",42)(61,"button",43),g("click",function(){k(e);let o=v();return T(o.openQemuImageCreator())}),d(62," Create Qemu image "),l()(),s(63,"div",44)(64,"div",45)(65,"div",46)(66,"h3",47),d(67,"HDA"),l(),s(68,"span",48),d(69,"Primary Master"),l()(),s(70,"div",49)(71,"mat-form-field",30)(72,"mat-label"),d(73,"Disk image"),l(),s(74,"input",50),g("input",function(o){k(e);let r=v();return T(r.hdaDiskImage.set(o.target.value))})("input",function(o){k(e);let r=v();return T(r.onHdaImageInput(o))})("focus",function(){k(e);let o=v();return o.filteredImages=o.qemuImages,T(o.refreshQemuImages())}),l(),s(75,"mat-autocomplete",null,1),A(77,p1e,3,0,"mat-optgroup",51),s(78,"mat-optgroup",52),Y(79,u1e,2,2,"mat-option",36,mw),l()()(),s(81,"mat-form-field",30)(82,"mat-label"),d(83,"Disk interface"),l(),s(84,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.hdaDiskInterface.set(o))}),Y(85,h1e,2,2,"mat-option",36,Ae),l()()()(),s(87,"div",45)(88,"div",46)(89,"h3",47),d(90,"HDB"),l(),s(91,"span",48),d(92,"Primary Slave"),l()(),s(93,"div",49)(94,"mat-form-field",30)(95,"mat-label"),d(96,"Disk image"),l(),s(97,"input",50),g("input",function(o){k(e);let r=v();return T(r.hdbDiskImage.set(o.target.value))})("input",function(o){k(e);let r=v();return T(r.onHdbImageInput(o))})("focus",function(){k(e);let o=v();return o.filteredImages=o.qemuImages,T(o.refreshQemuImages())}),l(),s(98,"mat-autocomplete",null,2),A(100,g1e,3,0,"mat-optgroup",51),s(101,"mat-optgroup",52),Y(102,_1e,2,2,"mat-option",36,mw),l()()(),s(104,"mat-form-field",30)(105,"mat-label"),d(106,"Disk interface"),l(),s(107,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.hdbDiskInterface.set(o))}),Y(108,v1e,2,2,"mat-option",36,Ae),l()()()(),s(110,"div",45)(111,"div",46)(112,"h3",47),d(113,"HDC"),l(),s(114,"span",48),d(115,"Secondary Master"),l()(),s(116,"div",49)(117,"mat-form-field",30)(118,"mat-label"),d(119,"Disk image"),l(),s(120,"input",50),g("input",function(o){k(e);let r=v();return T(r.hdcDiskImage.set(o.target.value))})("input",function(o){k(e);let r=v();return T(r.onHdcImageInput(o))})("focus",function(){k(e);let o=v();return o.filteredImages=o.qemuImages,T(o.refreshQemuImages())}),l(),s(121,"mat-autocomplete",null,3),A(123,b1e,3,0,"mat-optgroup",51),s(124,"mat-optgroup",52),Y(125,x1e,2,2,"mat-option",36,mw),l()()(),s(127,"mat-form-field",30)(128,"mat-label"),d(129,"Disk interface"),l(),s(130,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.hdcDiskInterface.set(o))}),Y(131,y1e,2,2,"mat-option",36,Ae),l()()()(),s(133,"div",45)(134,"div",46)(135,"h3",47),d(136,"HDD"),l(),s(137,"span",48),d(138,"Secondary Slave"),l()(),s(139,"div",49)(140,"mat-form-field",30)(141,"mat-label"),d(142,"Disk image"),l(),s(143,"input",50),g("input",function(o){k(e);let r=v();return T(r.hddDiskImage.set(o.target.value))})("input",function(o){k(e);let r=v();return T(r.onHddImageInput(o))})("focus",function(){k(e);let o=v();return o.filteredImages=o.qemuImages,T(o.refreshQemuImages())}),l(),s(144,"mat-autocomplete",null,4),A(146,w1e,3,0,"mat-optgroup",51),s(147,"mat-optgroup",52),Y(148,M1e,2,2,"mat-option",36,mw),l()()(),s(150,"mat-form-field",30)(151,"mat-label"),d(152,"Disk interface"),l(),s(153,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.hddDiskInterface.set(o))}),Y(154,k1e,2,2,"mat-option",36,Ae),l()()()()()(),s(156,"mat-tab",53)(157,"div",54)(158,"div",55)(159,"button",56),g("click",function(){k(e);let o=Pe(164);return T(o.click())}),d(160," Upload to device "),l(),s(161,"button",57),g("click",function(){k(e);let o=Pe(166);return T(o.click())}),d(162," Upload globally "),l(),s(163,"input",58,5),g("change",function(o){k(e);let r=v();return T(r.uploadCdromImageFile(o,"device"))}),l(),s(165,"input",58,6),g("change",function(o){k(e);let r=v();return T(r.uploadCdromImageFile(o,"global"))}),l()(),s(167,"mat-form-field",30)(168,"mat-label"),d(169,"Image"),l(),s(170,"input",50,7),g("input",function(o){k(e);let r=v();return r.cdromImage.set(o.target.value),T(r.onCdromInput(o))})("focus",function(){k(e);let o=Pe(171),r=v();return r.filteredIsoFiles=r.projectIsoFiles,r.filteredGlobalIsoImages=r.globalIsoImages,o.openPanel(),r.refreshNodeFiles(),T(r.refreshGlobalImages())}),l(),s(172,"mat-autocomplete",null,8),A(174,E1e,3,0,"mat-optgroup",51),A(175,P1e,3,0,"mat-optgroup",52),l()()()(),s(176,"mat-tab",59)(177,"div")(178,"mat-form-field",30)(179,"mat-label"),d(180,"Number of adapters"),l(),s(181,"input",60),g("input",function(o){k(e);let r=v();return T(r.adapters.set(o.target.value))}),l()(),s(182,"mat-form-field",30)(183,"mat-label"),d(184,"Base MAC"),l(),s(185,"input",31),g("input",function(o){k(e);let r=v();return T(r.macAddress.set(o.target.value))}),l()(),s(186,"mat-form-field",30)(187,"mat-label"),d(188,"Type"),l(),s(189,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.adapterType.set(o))}),Y(190,I1e,2,3,"mat-option",36,o1e),l()(),s(192,"div",61)(193,"button",56),g("click",function(){k(e);let o=v();return T(o.openCustomAdaptersDialog())}),d(194," Configurator Custom Adapters "),l()(),s(195,"mat-checkbox",40),g("change",function(o){k(e);let r=v();return T(r.replicateNetworkState.set(o.checked))}),d(196," Replicate network connection state "),l()()(),s(197,"mat-tab",62)(198,"div",63)(199,"div",45)(200,"div",46)(201,"h3",47),d(202,"Linux boot specific settings"),l()(),s(203,"div",49)(204,"div",64)(205,"div",65)(206,"button",56),g("click",function(){k(e);let o=Pe(220);return T(o.click())}),d(207,"Upload to device"),l(),s(208,"button",57),g("click",function(){k(e);let o=Pe(222);return T(o.click())}),d(209,"Upload globally"),l(),s(210,"mat-form-field",66)(211,"mat-label"),d(212,"Initial RAM disk (initrd)"),l(),s(213,"input",50,9),g("input",function(o){k(e);let r=v();return r.initrd.set(o.target.value),T(r.onAdvancedFileInput(o))})("focus",function(){k(e);let o=Pe(214),r=v();return r.filteredNodeFiles=r.allNodeFiles,r.filteredGlobalFiles=r.allGlobalFiles,o.openPanel(),r.refreshNodeFiles(),T(r.refreshQemuImages())}),l(),s(215,"mat-autocomplete",null,10),A(217,O1e,3,0,"mat-optgroup",51),A(218,F1e,3,0,"mat-optgroup",52),l()()(),s(219,"input",67,11),g("change",function(o){k(e);let r=v();return T(r.uploadInitrdFile(o,"device"))}),l(),s(221,"input",67,12),g("change",function(o){k(e);let r=v();return T(r.uploadInitrdFile(o,"global"))}),l()(),s(223,"div",64)(224,"div",65)(225,"button",56),g("click",function(){k(e);let o=Pe(239);return T(o.click())}),d(226,"Upload to device"),l(),s(227,"button",57),g("click",function(){k(e);let o=Pe(241);return T(o.click())}),d(228,"Upload globally"),l(),s(229,"mat-form-field",66)(230,"mat-label"),d(231,"Kernel image"),l(),s(232,"input",50,13),g("input",function(o){k(e);let r=v();return r.kernelImage.set(o.target.value),T(r.onAdvancedFileInput(o))})("focus",function(){k(e);let o=Pe(233),r=v();return r.filteredNodeFiles=r.allNodeFiles,r.filteredGlobalFiles=r.allGlobalFiles,o.openPanel(),r.refreshNodeFiles(),T(r.refreshQemuImages())}),l(),s(234,"mat-autocomplete",null,14),A(236,L1e,3,0,"mat-optgroup",51),A(237,B1e,3,0,"mat-optgroup",52),l()()(),s(238,"input",67,15),g("change",function(o){k(e);let r=v();return T(r.uploadKernelImageFile(o,"device"))}),l(),s(240,"input",67,16),g("change",function(o){k(e);let r=v();return T(r.uploadKernelImageFile(o,"global"))}),l()(),s(242,"mat-form-field",30)(243,"mat-label"),d(244,"Kernel command line"),l(),s(245,"input",31),g("input",function(o){k(e);let r=v();return T(r.kernelCommandLine.set(o.target.value))}),l()()()(),s(246,"div",45)(247,"div",46)(248,"h3",47),d(249,"Bios"),l()(),s(250,"div",49)(251,"div",64)(252,"div",65)(253,"button",56),g("click",function(){k(e);let o=Pe(267);return T(o.click())}),d(254,"Upload to device"),l(),s(255,"button",57),g("click",function(){k(e);let o=Pe(269);return T(o.click())}),d(256,"Upload globally"),l(),s(257,"mat-form-field",66)(258,"mat-label"),d(259,"Bios image"),l(),s(260,"input",50,17),g("input",function(o){k(e);let r=v();return r.biosImage.set(o.target.value),T(r.onAdvancedFileInput(o))})("focus",function(){k(e);let o=Pe(261),r=v();return r.filteredNodeFiles=r.allNodeFiles,r.filteredGlobalFiles=r.allGlobalFiles,o.openPanel(),r.refreshNodeFiles(),T(r.refreshQemuImages())}),l(),s(262,"mat-autocomplete",null,18),A(264,j1e,3,0,"mat-optgroup",51),A(265,H1e,3,0,"mat-optgroup",52),l()()(),s(266,"input",67,19),g("change",function(o){k(e);let r=v();return T(r.uploadBiosFile(o,"device"))}),l(),s(268,"input",67,20),g("change",function(o){k(e);let r=v();return T(r.uploadBiosFile(o,"global"))}),l()()()(),s(270,"div",45)(271,"div",46)(272,"h3",47),d(273,"Optimization"),l()(),s(274,"div",49)(275,"mat-checkbox",40),g("change",function(o){k(e);let r=v();return T(r.linkedClone.set(o.checked))}),d(276,"Linked clone"),l(),s(277,"mat-checkbox",40),g("change",function(o){k(e);let r=v();return T(r.createConfigDisk.set(o.checked))}),d(278,"Auto-create config disk"),l(),s(279,"mat-form-field",30)(280,"mat-label"),d(281,"Max CPUs (hot-plug)"),l(),s(282,"input",31),g("input",function(o){k(e);let r=v();return T(r.maxcpus.set(o.target.value))}),l()(),s(283,"mat-checkbox",40),g("change",function(o){k(e);let r=v();return T(r.activateCpuThrottling.set(o.checked))}),d(284," Activate CPU throttling "),l(),A(285,U1e,4,1,"mat-form-field",30),s(286,"mat-form-field",30)(287,"mat-label"),d(288,"Process priority"),l(),s(289,"mat-select",35),g("valueChange",function(o){k(e);let r=v();return T(r.processPriority.set(o))}),Y(290,G1e,2,2,"mat-option",36,Ae),l()()()(),s(292,"div",45)(293,"div",46)(294,"h3",47),d(295,"Additional settings"),l()(),s(296,"div",49)(297,"mat-form-field",30)(298,"mat-label"),d(299,"Qemu binary path"),l(),s(300,"input",31),g("input",function(o){k(e);let r=v();return T(r.qemuPath.set(o.target.value))}),l()(),s(301,"mat-form-field",30)(302,"mat-label"),d(303,"Options"),l(),s(304,"input",31),g("input",function(o){k(e);let r=v();return T(r.options.set(o.target.value))}),l()(),s(305,"mat-checkbox",40),g("change",function(o){k(e);let r=v();return T(r.tpm.set(o.checked))}),d(306," Enable the Trusted Platform Module (TPM) "),l(),s(307,"mat-checkbox",40),g("change",function(o){k(e);let r=v();return T(r.uefi.set(o.checked))}),d(308," Enable the UEFI boot mode "),l()()()()(),s(309,"mat-tab",68)(310,"mat-form-field",30)(311,"mat-label"),d(312,"Usage"),l(),s(313,"textarea",69),g("input",function(o){k(e);let r=v();return T(r.usage.set(o.target.value))}),l()()()()()}if(n&2){let e=Pe(11),t=Pe(76),o=Pe(99),r=Pe(122),a=Pe(145),c=Pe(173),p=Pe(216),u=Pe(235),h=Pe(263),_=v();m(6),C("value",_.nodeName()),m(6),Z(_.node==null?null:_.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",_.separatorKeysCodes),m(5),C("value",_.platform()),m(),Z(_.selectPlatform),m(5),C("value",_.ram()),m(6),C("value",_.cpus()),m(4),C("value",_.bootPriority()),m(),Z(_.bootPriorities),m(5),C("value",_.onClose()),m(),Z(_.onCloseOptions),m(6),C("value",_.consoleType()),m(),Z(_.consoleTypes),m(5),C("value",_.auxType()),m(),Z(_.auxConsoleTypes),m(2),C("checked",_.consoleAutoStart()),m(17),C("value",_.hdaDiskImage())("matAutocomplete",t),m(3),O(_.projectDiskFiles.length?77:-1),m(2),Z(_.filteredImages),m(5),C("value",_.hdaDiskInterface()),m(),Z(_.diskInterfaces),m(12),C("value",_.hdbDiskImage())("matAutocomplete",o),m(3),O(_.projectDiskFiles.length?100:-1),m(2),Z(_.filteredImages),m(5),C("value",_.hdbDiskInterface()),m(),Z(_.diskInterfaces),m(12),C("value",_.hdcDiskImage())("matAutocomplete",r),m(3),O(_.projectDiskFiles.length?123:-1),m(2),Z(_.filteredImages),m(5),C("value",_.hdcDiskInterface()),m(),Z(_.diskInterfaces),m(12),C("value",_.hddDiskImage())("matAutocomplete",a),m(3),O(_.projectDiskFiles.length?146:-1),m(2),Z(_.filteredImages),m(5),C("value",_.hddDiskInterface()),m(),Z(_.diskInterfaces),m(16),C("value",_.cdromImage())("matAutocomplete",c),m(4),O(_.filteredIsoFiles.length?174:-1),m(),O(_.filteredGlobalIsoImages.length?175:-1),m(6),C("value",_.adapters()),m(4),C("value",_.macAddress()),m(4),C("value",_.adapterType()),m(),Z(_.networkTypes),m(5),C("checked",_.replicateNetworkState()),m(18),C("value",_.initrd())("matAutocomplete",p),m(4),O(_.filteredNodeFiles.length?217:-1),m(),O(_.filteredGlobalFiles.length?218:-1),m(14),C("value",_.kernelImage())("matAutocomplete",u),m(4),O(_.filteredNodeFiles.length?236:-1),m(),O(_.filteredGlobalFiles.length?237:-1),m(8),C("value",_.kernelCommandLine()),m(15),C("value",_.biosImage())("matAutocomplete",h),m(4),O(_.filteredNodeFiles.length?264:-1),m(),O(_.filteredGlobalFiles.length?265:-1),m(10),C("checked",_.linkedClone()),m(2),C("checked",_.createConfigDisk()),m(5),C("value",_.maxcpus()),m(),C("checked",_.activateCpuThrottling()),m(2),O(_.activateCpuThrottling()?285:-1),m(4),C("value",_.processPriority()),m(),Z(_.priorities),m(10),C("value",_.qemuPath()),m(4),C("value",_.options()),m(),C("checked",_.tpm()),m(2),C("checked",_.uefi()),m(6),C("value",_.usage())}}var pw=(()=>{class n{dialog=f(nt);dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);qemuService=f(Kr);qemuConfigurationService=f(Om);cd=f(Q);imageManagerService=f(Lc);validationService=f(zi);controller;node;name;consoleTypes=[];auxConsoleTypes=[];onCloseOptions=[];bootPriorities=[];diskInterfaces=[];displayedColumns=["adapter_number","port_name","adapter_type","actions"];networkTypes=[];qemuImages=[];filteredImages=[];projectDiskFiles=[];projectIsoFiles=[];globalIsoImages=[];allNodeFiles=[];allGlobalFiles=[];filteredNodeFiles=[];filteredGlobalFiles=[];filteredIsoFiles=[];filteredGlobalIsoImages=[];selectPlatform=[];separatorKeysCodes=[13,188];conf={autoFocus:!1,panelClass:["base-dialog-panel","qemu-configurator-dialog-panel"],disableClose:!0};dialogRefQemuImageCreator;nodeName=U("");ram=U("");platform=U("");cpus=U("");bootPriority=U("");onClose=U("");consoleType=U("");auxType=U("");consoleAutoStart=U(!1);hdaDiskImage=U("");hdaDiskInterface=U("");hdbDiskImage=U("");hdbDiskInterface=U("");hdcDiskImage=U("");hdcDiskInterface=U("");hddDiskImage=U("");hddDiskInterface=U("");cdromImage=U("");initrd=U("");kernelImage=U("");kernelCommandLine=U("");biosImage=U("");activateCpuThrottling=U(!1);cpuThrottling=U("");processPriority=U("");qemuPath=U("");options=U("");tpm=U(!1);uefi=U(!1);usage=U("");linkedClone=U(!1);maxcpus=U("");createConfigDisk=U(!1);adapters=U("");macAddress=U("");adapterType=U("");replicateNetworkState=U(!1);ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||""),this.ram.set(e.properties.ram?.toString()||""),this.platform.set(e.properties.platform||""),this.cpus.set(e.properties.cpus?.toString()||""),this.bootPriority.set(e.properties.boot_priority||""),this.onClose.set(e.properties.on_close||""),this.consoleType.set(e.console_type||""),this.auxType.set(e.aux_type||""),this.consoleAutoStart.set(e.console_auto_start||!1),this.hdaDiskImage.set(e.properties.hda_disk_image||""),this.hdaDiskInterface.set(e.properties.hda_disk_interface||""),this.hdbDiskImage.set(e.properties.hdb_disk_image||""),this.hdbDiskInterface.set(e.properties.hdb_disk_interface||""),this.hdcDiskImage.set(e.properties.hdc_disk_image||""),this.hdcDiskInterface.set(e.properties.hdc_disk_interface||""),this.hddDiskImage.set(e.properties.hdd_disk_image||""),this.hddDiskInterface.set(e.properties.hdd_disk_interface||""),this.cdromImage.set(e.properties.cdrom_image||""),this.initrd.set(e.properties.initrd||""),this.kernelImage.set(e.properties.kernel_image||""),this.kernelCommandLine.set(e.properties.kernel_command_line||""),this.biosImage.set(e.properties.bios_image||""),this.cpuThrottling.set(e.properties.cpu_throttling?.toString()||""),this.processPriority.set(e.properties.process_priority||""),this.qemuPath.set(e.properties.qemu_path||""),this.options.set(e.properties.options||""),this.tpm.set(e.properties.tpm||!1),this.uefi.set(e.properties.uefi||!1),this.usage.set(e.properties.usage||""),this.linkedClone.set(e.properties.linked_clone??!0),this.maxcpus.set(e.properties.maxcpus?.toString()||""),this.createConfigDisk.set(e.properties.create_config_disk??!1),this.adapters.set(e.properties.adapters?.toString()||""),this.macAddress.set(e.properties.mac_address||""),this.adapterType.set(e.properties.adapter_type||""),this.replicateNetworkState.set(e.properties.replicate_network_connection_state||!1),this.node.tags||(this.node.tags=[]),this.nodeService.getNodeFiles(this.controller,e.project_id,e.node_id).subscribe({next:t=>{this.allNodeFiles=t.map(o=>o.path),this.projectDiskFiles=t.filter(o=>o.file_type?.toLowerCase().includes("qemu")||o.file_type?.toLowerCase().includes("qcow")||o.file_type?.toLowerCase().includes("vmdk")||o.file_type?.toLowerCase().includes("vmware")||o.file_type?.toLowerCase().includes("virtual")||o.file_type?.toLowerCase().includes("disk image")).map(o=>o.path),this.projectIsoFiles=t.filter(o=>o.file_type?.toLowerCase().includes("iso 9660")||o.file_type?.toLowerCase().includes("cd-rom")).map(o=>o.path),this.cd.markForCheck()},error:()=>{}}),this.imageManagerService.getImages(this.controller).subscribe({next:t=>{this.globalIsoImages=t.filter(o=>o.filename?.endsWith(".iso")).map(o=>o.filename),this.cd.markForCheck()},error:()=>{}}),this.getConfiguration(),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}}),this.qemuService.getImages(this.controller).subscribe({next:e=>{this.qemuImages=e,this.filteredImages=e,this.allGlobalFiles=e.map(t=>t.filename),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load QEMU images";this.toasterService.error(t),this.cd.markForCheck()}}),this.selectPlatform=this.qemuConfigurationService.getPlatform()}openQemuImageCreator(){this.dialogRefQemuImageCreator=this.dialog.open(dw,this.conf);let e=this.dialogRefQemuImageCreator.componentInstance;e.controller=this.controller,e.nodeId=this.node.node_id,e.projectId=this.node.project_id,this.dialogRefQemuImageCreator.afterClosed().subscribe(t=>{if(t?.mountPoint&&t?.filename){let o=t.mountPoint.toLowerCase(),r={hda:this.hdaDiskImage,hdb:this.hdbDiskImage,hdc:this.hdcDiskImage,hdd:this.hddDiskImage};r[o]&&(r[o].set(t.filename),this.cd.markForCheck())}})}openIsoAutocomplete(e){e&&e.openPanel&&e.openPanel()}refreshQemuImages(){this.qemuService.getImages(this.controller).subscribe({next:e=>{this.qemuImages=e,this.filteredImages=e,this.allGlobalFiles=e.map(t=>t.filename),this.cd.markForCheck()},error:()=>{}})}refreshNodeFiles(){this.nodeService.getNodeFiles(this.controller,this.node.project_id,this.node.node_id).subscribe({next:e=>{this.allNodeFiles=e.map(t=>t.path),this.projectDiskFiles=e.filter(t=>t.file_type?.toLowerCase().includes("qemu")||t.file_type?.toLowerCase().includes("qcow")||t.file_type?.toLowerCase().includes("vmdk")||t.file_type?.toLowerCase().includes("vmware")||t.file_type?.toLowerCase().includes("virtual")||t.file_type?.toLowerCase().includes("disk image")).map(t=>t.path),this.projectIsoFiles=e.filter(t=>t.file_type?.toLowerCase().includes("iso 9660")||t.file_type?.toLowerCase().includes("cd-rom")).map(t=>t.path),this.cd.markForCheck()},error:()=>{}})}refreshGlobalImages(){this.imageManagerService.getImages(this.controller).subscribe({next:e=>{this.globalIsoImages=e.filter(t=>t.filename?.endsWith(".iso")).map(t=>t.filename),this.cd.markForCheck()},error:()=>{}})}uploadCdromImageFile(e,t="global"){let o=e.target.files[0];if(!o)return;let r=o.name;(t==="device"?this.nodeService.uploadNodeFile(this.controller,this.node.project_id,this.node.node_id,r,o):this.imageManagerService.uploadedImage(this.controller,!1,r,o)).subscribe({next:()=>{this.node.properties.cdrom_image=r,this.cdromImage.set(r),t==="device"?this.refreshNodeFiles():this.refreshGlobalImages(),this.toasterService.success(`Uploaded ${r}`),this.cd.markForCheck()},error:c=>{let p=c.error?.message||c.message||"Failed to upload image";this.toasterService.error(p)}})}uploadFile(e,t,o,r){let a=e.name;(r==="device"?this.nodeService.uploadNodeFile(this.controller,this.node.project_id,this.node.node_id,a,e):this.imageManagerService.uploadedImage(this.controller,!1,a,e)).subscribe({next:()=>{this.node.properties[o]=a,t.set(a),r==="device"?this.refreshNodeFiles():this.refreshGlobalImages(),this.toasterService.success(`Uploaded ${a}`),this.cd.markForCheck()},error:p=>{this.toasterService.error(p.error?.message||p.message||"Failed to upload")}})}uploadInitrdFile(e,t="global"){e.target.files[0]&&this.uploadFile(e.target.files[0],this.initrd,"initrd",t)}uploadKernelImageFile(e,t="global"){e.target.files[0]&&this.uploadFile(e.target.files[0],this.kernelImage,"kernel_image",t)}uploadBiosFile(e,t="global"){e.target.files[0]&&this.uploadFile(e.target.files[0],this.biosImage,"bios_image",t)}getConfiguration(){this.consoleTypes=this.qemuConfigurationService.getConsoleTypes(),this.auxConsoleTypes=this.qemuConfigurationService.getAuxConsoleTypes(),this.onCloseOptions=this.qemuConfigurationService.getOnCloseOptions(),this.qemuConfigurationService.getNetworkTypes().forEach(e=>{this.networkTypes.push(e)}),this.bootPriorities=this.qemuConfigurationService.getBootPriorities(),this.diskInterfaces=this.qemuConfigurationService.getDiskInterfaces()}filterImages(e){let t=e.target.value.toLowerCase();return this.qemuImages.filter(o=>o.filename.toLowerCase().includes(t))}onAdvancedFileInput(e){let t=e.target.value.toLowerCase();this.filteredNodeFiles=this.allNodeFiles.filter(o=>o.toLowerCase().includes(t)),this.filteredGlobalFiles=this.allGlobalFiles.filter(o=>o.toLowerCase().includes(t))}onCdromInput(e){let t=e.target.value.toLowerCase();this.filteredIsoFiles=this.projectIsoFiles.filter(o=>o.toLowerCase().includes(t)),this.filteredGlobalIsoImages=this.globalIsoImages.filter(o=>o.toLowerCase().includes(t))}onHdaImageInput(e){this.filteredImages=this.filterImages(e)}onHdbImageInput(e){this.filteredImages=this.filterImages(e)}onHdcImageInput(e){this.filteredImages=this.filterImages(e)}onHddImageInput(e){this.filteredImages=this.filterImages(e)}openCustomAdaptersDialog(){let e=this.node.port_name_format||"Ethernet{0}",t=this.node.port_segment_size||0,o=this.node.properties.adapter_type||"e1000",r=this.node.properties.adapters||0,a=this.node.custom_adapters||[],c=[];for(let u=0;u<r;u++){let h=a.find(_=>_.adapter_number===u);if(h)c.push({adapter_number:h.adapter_number,adapter_type:h.adapter_type,port_name:h.port_name,mac_address:h.mac_address||""});else{let _;if(t>0){let S=Math.floor(u/t),x=u%t;_=e.replace("{0}",String(S*t+x))}else _=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:o,port_name:_,mac_address:""})}}this.dialog.open(Vc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:o,currentAdapters:r}}).afterClosed().subscribe(u=>{u&&(this.node.custom_adapters=u.adapters,u.requiredAdapters!==void 0&&(this.node.properties.adapters=u.requiredAdapters,this.adapters.set(u.requiredAdapters.toString())),this.cd.markForCheck())})}onSaveClick(){let e=this.validationService.required(this.nodeName(),"Name");if(!e.isValid){this.toasterService.error(e.errorMessage);return}let t=this.validationService.required(this.ram(),"RAM");if(!t.isValid){this.toasterService.error(t.errorMessage);return}this.node.name=this.nodeName(),this.node.properties.ram=parseInt(this.ram(),10)||0,this.node.properties.platform=this.platform(),this.node.properties.cpus=parseFloat(this.cpus())||0,this.node.properties.boot_priority=this.bootPriority(),this.node.properties.on_close=this.onClose(),this.node.console_type=this.consoleType(),this.node.aux_type=this.auxType(),this.node.console_auto_start=this.consoleAutoStart(),this.node.properties.hda_disk_image=this.hdaDiskImage(),this.node.properties.hda_disk_interface=this.hdaDiskInterface(),this.node.properties.hdb_disk_image=this.hdbDiskImage(),this.node.properties.hdb_disk_interface=this.hdbDiskInterface(),this.node.properties.hdc_disk_image=this.hdcDiskImage(),this.node.properties.hdc_disk_interface=this.hdcDiskInterface(),this.node.properties.hdd_disk_image=this.hddDiskImage(),this.node.properties.hdd_disk_interface=this.hddDiskInterface(),this.node.properties.cdrom_image=this.cdromImage(),this.node.properties.initrd=this.initrd(),this.node.properties.kernel_image=this.kernelImage(),this.node.properties.kernel_command_line=this.kernelCommandLine(),this.node.properties.bios_image=this.biosImage(),this.node.properties.cpu_throttling=parseInt(this.cpuThrottling(),10)||null,this.node.properties.process_priority=this.processPriority(),this.node.properties.qemu_path=this.qemuPath(),this.node.properties.options=this.options(),this.node.properties.tpm=this.tpm(),this.node.properties.uefi=this.uefi(),this.node.properties.usage=this.usage(),this.node.properties.linked_clone=this.linkedClone(),this.node.properties.maxcpus=parseInt(this.maxcpus(),10)||void 0,this.node.properties.create_config_disk=this.createConfigDisk(),this.node.properties.adapters=parseInt(this.adapters(),10)||0,this.node.properties.mac_address=this.macAddress(),this.node.properties.adapter_type=this.adapterType(),this.node.properties.replicate_network_connection_state=this.replicateNetworkState(),this.nodeService.updateNodeWithCustomAdapters(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:o=>{let r=o.error?.message||o.message||"Failed to update node";this.toasterService.error(r)}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-qemu"]],inputs:{nodeName:[1,"nodeName"],ram:[1,"ram"],platform:[1,"platform"],cpus:[1,"cpus"],bootPriority:[1,"bootPriority"],onClose:[1,"onClose"],consoleType:[1,"consoleType"],auxType:[1,"auxType"],consoleAutoStart:[1,"consoleAutoStart"],hdaDiskImage:[1,"hdaDiskImage"],hdaDiskInterface:[1,"hdaDiskInterface"],hdbDiskImage:[1,"hdbDiskImage"],hdbDiskInterface:[1,"hdbDiskInterface"],hdcDiskImage:[1,"hdcDiskImage"],hdcDiskInterface:[1,"hdcDiskInterface"],hddDiskImage:[1,"hddDiskImage"],hddDiskInterface:[1,"hddDiskInterface"],cdromImage:[1,"cdromImage"],initrd:[1,"initrd"],kernelImage:[1,"kernelImage"],kernelCommandLine:[1,"kernelCommandLine"],biosImage:[1,"biosImage"],activateCpuThrottling:[1,"activateCpuThrottling"],cpuThrottling:[1,"cpuThrottling"],processPriority:[1,"processPriority"],qemuPath:[1,"qemuPath"],options:[1,"options"],tpm:[1,"tpm"],uefi:[1,"uefi"],usage:[1,"usage"],linkedClone:[1,"linkedClone"],maxcpus:[1,"maxcpus"],createConfigDisk:[1,"createConfigDisk"],adapters:[1,"adapters"],macAddress:[1,"macAddress"],adapterType:[1,"adapterType"],replicateNetworkState:[1,"replicateNetworkState"]},outputs:{nodeName:"nodeNameChange",ram:"ramChange",platform:"platformChange",cpus:"cpusChange",bootPriority:"bootPriorityChange",onClose:"onCloseChange",consoleType:"consoleTypeChange",auxType:"auxTypeChange",consoleAutoStart:"consoleAutoStartChange",hdaDiskImage:"hdaDiskImageChange",hdaDiskInterface:"hdaDiskInterfaceChange",hdbDiskImage:"hdbDiskImageChange",hdbDiskInterface:"hdbDiskInterfaceChange",hdcDiskImage:"hdcDiskImageChange",hdcDiskInterface:"hdcDiskInterfaceChange",hddDiskImage:"hddDiskImageChange",hddDiskInterface:"hddDiskInterfaceChange",cdromImage:"cdromImageChange",initrd:"initrdChange",kernelImage:"kernelImageChange",kernelCommandLine:"kernelCommandLineChange",biosImage:"biosImageChange",activateCpuThrottling:"activateCpuThrottlingChange",cpuThrottling:"cpuThrottlingChange",processPriority:"processPriorityChange",qemuPath:"qemuPathChange",options:"optionsChange",tpm:"tpmChange",uefi:"uefiChange",usage:"usageChange",linkedClone:"linkedCloneChange",maxcpus:"maxcpusChange",createConfigDisk:"createConfigDiskChange",adapters:"adaptersChange",macAddress:"macAddressChange",adapterType:"adapterTypeChange",replicateNetworkState:"replicateNetworkStateChange"},decls:12,vars:2,consts:[["chipList",""],["hdaAuto","matAutocomplete"],["hdbAuto","matAutocomplete"],["hdcAuto","matAutocomplete"],["hddAuto","matAutocomplete"],["fileDevice",""],["fileGlobal",""],["isoTrigger","matAutocompleteTrigger"],["isoAuto","matAutocomplete"],["initrdTrigger","matAutocompleteTrigger"],["initrdAuto","matAutocomplete"],["fileinitrdDevice",""],["fileinitrdGlobal",""],["kernelTrigger","matAutocompleteTrigger"],["kernelAuto","matAutocomplete"],["filekernelDevice",""],["filekernelGlobal",""],["biosTrigger","matAutocompleteTrigger"],["biosAuto","matAutocomplete"],["filebiosDevice",""],["filebiosGlobal",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["label","General settings"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[2,"display","grid","grid-template-columns","1fr 1fr 1fr 1fr","gap","16px","align-items","start"],[3,"valueChange","value"],[3,"value"],["matSuffix",""],["matInput","","type","text","min","1",3,"input","value"],[2,"display","grid","grid-template-columns","1fr 1fr","gap","16px"],[3,"change","checked"],["label","HDD"],[1,"hdd-create-section"],["mat-raised-button","","color","primary",1,"create-button",3,"click"],[1,"disk-cards-grid"],[1,"disk-card"],[1,"disk-card__header"],[1,"disk-card__title"],[1,"disk-card__badge"],[1,"disk-card__content"],["matInput","","type","text",3,"input","focus","value","matAutocomplete"],["label","This device files"],["label","Global images"],["label","CD/DVD"],[1,"form-container"],[2,"margin-bottom","8px","display","flex","gap","8px"],["mat-raised-button","","color","primary",3,"click"],["mat-raised-button","",3,"click"],["type","file","accept",".iso",1,"nonvisible",3,"change"],["label","Network"],["matInput","","min","0","type","text",3,"input","value"],[1,"custom-adapters-section"],["label","Advanced"],[1,"card-stack"],[1,"form-container",2,"gap","8px"],[2,"display","flex","gap","8px","align-items","center"],[1,"form-field",2,"flex","1"],["type","file",1,"nonvisible",3,"change"],["label","Usage"],["matInput","",3,"input","value"],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"h1",21),d(1),l(),s(2,"div",22)(3,"div",23)(4,"div",24)(5,"mat-card",25),A(6,W1e,314,59,"div"),l()()()(),s(7,"div",26)(8,"button",27),g("click",function(){return o.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",28),g("click",function(){return o.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for Qemu VM ",o.name),m(5),O(o.name?6:-1))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,To,tr,nr,we,Me,et,Mi,Se,Ee,vt,At,_t,EC,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ot,Gt,Yr,Sa,Ko],encapsulation:2,changeDetection:0})}return n})();function q1e(n,i){n&1&&(s(0,"th",21),d(1,"Source Port : DLCI"),l())}function Q1e(n,i){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=i.$implicit;m(),j(e.portIn)}}function X1e(n,i){n&1&&(s(0,"th",21),d(1,"Destination Port : DLCI"),l())}function K1e(n,i){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=i.$implicit;m(),j(e.portOut)}}function Y1e(n,i){n&1&&(s(0,"th",21),d(1,"Actions"),l())}function Z1e(n,i){if(n&1){let e=z();s(0,"td",22)(1,"button",23),g("click",function(){let o=k(e).$implicit,r=v();return T(r.delete(o))}),s(2,"mat-icon",24),d(3,"delete"),l()()()}}function J1e(n,i){n&1&&R(0,"tr",25)}function ebe(n,i){n&1&&R(0,"tr",26)}var uw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);cd=f(Q);validationService=f(zi);controller;node;name;consoleTypes=[];nodeMappings=new Map;nodeMappingsDataSource=[];dataSource=[];displayedColumns=["portIn","portOut","actions"];nodeName=U("");sourcePort=U("");sourceDlci=U("");destinationPort=U("");destinationDlci=U("");ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||"");let t=e.properties.mappings;Object.keys(t).forEach(o=>{this.nodeMappings.set(o,t[o])}),this.nodeMappingsDataSource=Array.from(this.nodeMappings.entries()).map(([o,r])=>({portIn:o,portOut:r})),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}delete(e){this.nodeMappingsDataSource=this.nodeMappingsDataSource.filter(t=>t!==e)}add(){let e=this.sourcePort(),t=this.sourceDlci(),o=this.destinationPort(),r=this.destinationDlci(),a=this.validationService.required(e,"Source Port");if(!a.isValid){this.toasterService.error(a.errorMessage);return}if(!this.validationService.validatePort(e).isValid){this.toasterService.error("Source Port must be a non-negative integer");return}let p=this.validationService.required(t,"Source DLCI");if(!p.isValid){this.toasterService.error(p.errorMessage);return}let u=this.validationService.required(o,"Destination Port");if(!u.isValid){this.toasterService.error(u.errorMessage);return}if(!this.validationService.validatePort(o).isValid){this.toasterService.error("Destination Port must be a non-negative integer");return}let _=this.validationService.required(r,"Destination DLCI");if(!_.isValid){this.toasterService.error(_.errorMessage);return}let S={portIn:`${e}:${t}`,portOut:`${o}:${r}`};this.nodeMappingsDataSource.filter(x=>x.portIn===S.portIn).length>0?this.toasterService.error("Mapping already defined."):(this.nodeMappingsDataSource=this.nodeMappingsDataSource.concat([S]),this.clearUserInput())}clearUserInput(){this.sourcePort.set(""),this.sourceDlci.set(""),this.destinationPort.set(""),this.destinationDlci.set("")}strMapToObj(e){let t=Object.create(null);for(let[o,r]of e)t[o]=r;return t}onSaveClick(){let e=this.validationService.required(this.nodeName(),"Name");if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}this.node.name=this.nodeName(),this.nodeMappings.clear(),this.nodeMappingsDataSource.forEach(t=>{this.nodeMappings.set(t.portIn,t.portOut)}),this.node.properties.mappings=Array.from(this.nodeMappings).reduce((t,[o,r])=>Object.assign(t,{[o]:r}),{}),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(o)}})}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-switch"]],inputs:{nodeName:[1,"nodeName"],sourcePort:[1,"sourcePort"],sourceDlci:[1,"sourceDlci"],destinationPort:[1,"destinationPort"],destinationDlci:[1,"destinationDlci"]},outputs:{nodeName:"nodeNameChange",sourcePort:"sourcePortChange",sourceDlci:"sourceDlciChange",destinationPort:"destinationPortChange",destinationDlci:"destinationDlciChange"},decls:48,vars:9,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"fr-switch__input-grid"],[1,"fr-switch__add-btn"],["mat-button","",3,"click"],["mat-table","",3,"dataSource"],["matColumnDef","portIn"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","portOut"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","matTooltip","Delete mapping","matTooltipClass","custom-tooltip",3,"click"],["aria-label","Delete mapping"],["mat-header-row",""],["mat-row",""]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1)(3,"div",2)(4,"div",3)(5,"mat-card")(6,"div",4)(7,"mat-form-field",5)(8,"mat-label"),d(9,"Name"),l(),s(10,"input",6),g("input",function(a){return o.nodeName.set(a.target.value)}),l()()(),s(11,"div",7)(12,"mat-form-field",5)(13,"mat-label"),d(14,"Source Port"),l(),s(15,"input",6),g("input",function(a){return o.sourcePort.set(a.target.value)}),l()(),s(16,"mat-form-field",5)(17,"mat-label"),d(18,"Destination Port"),l(),s(19,"input",6),g("input",function(a){return o.destinationPort.set(a.target.value)}),l()(),s(20,"mat-form-field",5)(21,"mat-label"),d(22,"Source DLCI"),l(),s(23,"input",6),g("input",function(a){return o.sourceDlci.set(a.target.value)}),l()(),s(24,"mat-form-field",5)(25,"mat-label"),d(26,"Destination DLCI"),l(),s(27,"input",6),g("input",function(a){return o.destinationDlci.set(a.target.value)}),l()()(),s(28,"div",8)(29,"button",9),g("click",function(){return o.add()}),d(30,"Add"),l()(),s(31,"table",10),Le(32,11),xe(33,q1e,2,0,"th",12)(34,Q1e,2,1,"td",13),Ve(),Le(35,14),xe(36,X1e,2,0,"th",12)(37,K1e,2,1,"td",13),Ve(),Le(38,15),xe(39,Y1e,2,0,"th",12)(40,Z1e,4,0,"td",13),Ve(),xe(41,J1e,1,0,"tr",16)(42,ebe,1,0,"tr",17),l()()()()(),s(43,"div",18)(44,"button",19),g("click",function(){return o.onCancelClick()}),d(45,"Cancel"),l(),s(46,"button",20),g("click",function(){return o.onSaveClick()}),d(47,"Apply"),l()()),t&2&&(m(),ee("Configurator for Frame-Relay switch ",o.name),m(9),C("value",o.nodeName()),m(5),C("value",o.sourcePort()),m(4),C("value",o.destinationPort()),m(4),C("value",o.sourceDlci()),m(4),C("value",o.destinationDlci()),m(4),C("dataSource",o.nodeMappingsDataSource),m(10),C("matHeaderRowDef",o.displayedColumns),m(),C("matRowDefColumns",o.displayedColumns))},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,we,Me,et,Se,Ee,W,pe,je,ie,de,wt,It],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}",".fr-switch__input-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.fr-switch__add-btn[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:16px}.fr-switch__add-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:80%}"],changeDetection:0})}return n})();var Qz=(()=>{class n{getConsoleTypes(){return["telnet","ssh","none"]}getOnCloseoptions(){return[["Power off the VM","power_off"],["Send the shutdown signal (ACPI)","shutdown_signal"],["Save the VM state","save_vm_state"]]}getCategories(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getNetworkTypes(){return["PCnet-PCI II (Am79C970A)","PCNet-FAST III (Am79C973)","Intel PRO/1000 MT Desktop (82540EM)","Intel PRO/1000 T Server (82543GC)","Intel PRO/1000 MT Server (82545EM)","Paravirtualized Network (virtio-net)"]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var tbe=(n,i)=>i[1];function nbe(n,i){if(n&1){let e=z();s(0,"mat-chip",27),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",28),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function ibe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function obe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function rbe(n,i){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",9)(2,"form",10)(3,"mat-form-field",11)(4,"mat-label"),d(5,"Name"),l(),R(6,"input",12),l(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),Y(12,nbe,4,1,"mat-chip",null,Ae),l(),s(14,"input",14),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),Y(19,ibe,2,2,"mat-option",16,Ae),l()(),s(21,"mat-checkbox",17),d(22," Auto start console "),l(),s(23,"mat-form-field",11)(24,"mat-label"),d(25,"RAM"),l(),R(26,"input",18),s(27,"span",19),d(28,"MB"),l()(),s(29,"mat-form-field",11)(30,"mat-label"),d(31,"On close"),l(),s(32,"mat-select",20),Y(33,obe,2,2,"mat-option",16,tbe),l()(),s(35,"mat-checkbox",21),d(36," Start VM in headless mode "),l()()(),s(37,"mat-tab",22)(38,"form",10)(39,"mat-checkbox",23),d(40," Allow GNS3 to use any configured VirtualBox adapter "),l(),R(41,"br")(42,"br"),s(43,"button",24),g("click",function(){k(e);let o=v();return T(o.openCustomAdaptersDialog())}),d(44,"Custom Adapters"),l()()(),s(45,"mat-tab",25)(46,"form",10)(47,"mat-form-field",11)(48,"mat-label"),d(49,"Usage"),l(),R(50,"textarea",26),l()()()()}if(n&2){let e=Pe(11),t=v();m(2),C("formGroup",t.generalSettingsForm),m(10),Z(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(5),Z(t.consoleTypes),m(14),Z(t.onCloseOptions),m(5),C("formGroup",t.generalSettingsForm),m(8),C("formGroup",t.generalSettingsForm)}}var Xz=(()=>{class n{dialogRef=f(Ie);dialog=f(nt);nodeService=f(ut);toasterService=f(te);formBuilder=f(Vn);virtualBoxConfigurationService=f(Qz);cd=f(Q);controller;node;name;generalSettingsForm;consoleTypes=[];onCloseOptions=[];separatorKeysCodes=[13,188];networkTypes=[];constructor(){this.generalSettingsForm=this.formBuilder.group({name:new Ye("",Ue.required),console_type:new Ye(""),console_auto_start:new Ye(!1),ram:new Ye("",Ue.required),on_close:new Ye(""),headless:new Ye(!1),use_any_adapter:new Ye(!1),usage:new Ye("")})}ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.generalSettingsForm.patchValue({name:e.name,console_type:e.console_type||"",console_auto_start:e.console_auto_start||!1,ram:e.properties.ram||"",on_close:e.properties.on_close||"",headless:e.properties.headless||!1,use_any_adapter:e.properties.use_any_adapter||!1,usage:e.properties.usage||""}),this.node.tags||(this.node.tags=[]),this.getConfiguration(),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.virtualBoxConfigurationService.getConsoleTypes(),this.onCloseOptions=this.virtualBoxConfigurationService.getOnCloseoptions(),this.networkTypes=this.virtualBoxConfigurationService.getNetworkTypes()}openCustomAdaptersDialog(){let e=this.node.port_name_format||"Ethernet{0}",t=this.node.port_segment_size||0,o=this.node.properties.adapter_type||"e1000",r=this.node.properties.adapters||0,a=this.node.custom_adapters||[],c=[];for(let u=0;u<r;u++){let h=a.find(_=>_.adapter_number===u);if(h)c.push({adapter_number:h.adapter_number,adapter_type:h.adapter_type,port_name:h.port_name,mac_address:h.mac_address||""});else{let _;if(t>0){let S=Math.floor(u/t),x=u%t;_=e.replace("{0}",String(S*t+x))}else _=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:o,port_name:_,mac_address:""})}}this.dialog.open(Vc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:o,currentAdapters:r}}).afterClosed().subscribe(u=>{u&&(this.node.custom_adapters=u.adapters,u.requiredAdapters!==void 0&&(this.node.properties.adapters=u.requiredAdapters),this.cd.markForCheck())})}onSaveClick(){if(this.generalSettingsForm.valid){let e=this.generalSettingsForm.value;this.node.name=e.name,this.node.console_type=e.console_type,this.node.console_auto_start=e.console_auto_start,this.node.properties.ram=e.ram,this.node.properties.on_close=e.on_close,this.node.properties.headless=e.headless,this.node.properties.use_any_adapter=e.use_any_adapter,this.node.properties.usage=e.usage,this.nodeService.updateNodeWithCustomAdapters(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(o),this.cd.markForCheck()}})}else this.toasterService.error("Fill all required fields.")}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-virtualbox"]],decls:12,vars:2,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["label","General settings"],[3,"formGroup"],[1,"form-field"],["matInput","","formControlName","name","type","text"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],["formControlName","console_type"],[3,"value"],["formControlName","console_auto_start"],["matInput","","formControlName","ram","type","number"],["matSuffix",""],["formControlName","on_close"],["formControlName","headless"],["label","Network"],["formControlName","use_any_adapter"],["mat-raised-button","","color","primary",3,"click"],["label","Usage"],["matInput","","formControlName","usage"],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),A(6,rbe,51,5,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),g("click",function(){return o.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),g("click",function(){return o.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for VirtualBox VM ",o.name),m(5),O(o.name?6:-1))},dependencies:[ne,Xe,at,Ft,_r,Pt,rt,Dt,Rt,zt,_e,Ne,Fe,Mt,On,To,tr,nr,we,Me,et,Mi,Se,Ee,vt,At,_t,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ot,Gt],encapsulation:2,changeDetection:0})}return n})();var Kz=(()=>{class n{getConsoleTypes(){return["telnet","ssh","none"]}getOnCloseoptions(){return[["Power off the VM","power_off"],["Send the shutdown signal (ACPI)","shutdown_signal"],["Save the VM state","save_vm_state"]]}getCategories(){return[["Default","guest"],["Routers","router"],["Switches","switch"],["End devices","guest"],["Security devices","firewall"]]}getNetworkTypes(){return["default","e1000","e1000e","flexible","vlance","vmxnet","vmxnet2","vmxnet3"]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var abe=(n,i)=>i[1];function sbe(n,i){if(n&1){let e=z();s(0,"mat-chip",26),g("removed",function(){let o=k(e).$implicit,r=v(2);return T(r.removeTag(o))}),d(1),s(2,"mat-icon",27),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function lbe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function cbe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function dbe(n,i){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",9)(2,"form",10)(3,"mat-form-field",11)(4,"mat-label"),d(5,"Name"),l(),R(6,"input",12),l(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),Y(12,sbe,4,1,"mat-chip",null,Ae),l(),s(14,"input",14),g("matChipInputTokenEnd",function(o){k(e);let r=v();return T(r.addTag(o))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),Y(19,lbe,2,2,"mat-option",16,Ae),l()(),s(21,"mat-checkbox",17),d(22," Auto start console "),l(),s(23,"mat-form-field",11)(24,"mat-label"),d(25,"On close"),l(),s(26,"mat-select",18),Y(27,cbe,2,2,"mat-option",16,abe),l()(),s(29,"mat-checkbox",19),d(30," Start VM in headless mode "),l(),s(31,"mat-checkbox",20),d(32," Use a linked base VM (experimental) "),l()()(),s(33,"mat-tab",21)(34,"form",10)(35,"mat-checkbox",22),d(36," Allow GNS3 to override non custom VMware adapter "),l(),R(37,"br")(38,"br"),s(39,"button",23),g("click",function(){k(e);let o=v();return T(o.openCustomAdaptersDialog())}),d(40,"Custom Adapters"),l()()(),s(41,"mat-tab",24)(42,"form",10)(43,"mat-form-field",11)(44,"mat-label"),d(45,"Usage"),l(),R(46,"textarea",25),l()()()()}if(n&2){let e=Pe(11),t=v();m(2),C("formGroup",t.generalSettingsForm),m(10),Z(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(5),Z(t.consoleTypes),m(8),Z(t.onCloseOptions),m(7),C("formGroup",t.generalSettingsForm),m(8),C("formGroup",t.generalSettingsForm)}}var Yz=(()=>{class n{dialogRef=f(Ie);dialog=f(nt);nodeService=f(ut);toasterService=f(te);formBuilder=f(Vn);vmwareConfigurationService=f(Kz);cd=f(Q);controller;node;name;generalSettingsForm;separatorKeysCodes=[13,188];consoleTypes=[];onCloseOptions=[];networkTypes=[];constructor(){this.generalSettingsForm=this.formBuilder.group({name:new Ye("",Ue.required),console_type:new Ye(""),console_auto_start:new Ye(!1),on_close:new Ye(""),headless:new Ye(!1),linked_clone:new Ye(!1),use_any_adapter:new Ye(!1),usage:new Ye("")})}ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.generalSettingsForm.patchValue({name:e.name,console_type:e.console_type||"",console_auto_start:e.console_auto_start||!1,on_close:e.properties.on_close||"",headless:e.properties.headless||!1,linked_clone:e.properties.linked_clone||!1,use_any_adapter:e.properties.use_any_adapter||!1,usage:e.properties.usage||""}),this.node.tags||(this.node.tags=[]),this.getConfiguration(),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.vmwareConfigurationService.getConsoleTypes(),this.onCloseOptions=this.vmwareConfigurationService.getOnCloseoptions(),this.networkTypes=this.vmwareConfigurationService.getNetworkTypes()}openCustomAdaptersDialog(){let e=this.node.port_name_format||"Ethernet{0}",t=this.node.port_segment_size||0,o=this.node.properties.adapter_type||"e1000",r=this.node.properties.adapters||0,a=this.node.custom_adapters||[],c=[];for(let u=0;u<r;u++){let h=a.find(_=>_.adapter_number===u);if(h)c.push({adapter_number:h.adapter_number,adapter_type:h.adapter_type,port_name:h.port_name,mac_address:h.mac_address||""});else{let _;if(t>0){let S=Math.floor(u/t),x=u%t;_=e.replace("{0}",String(S*t+x))}else _=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:o,port_name:_,mac_address:""})}}this.dialog.open(Vc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:o,currentAdapters:r}}).afterClosed().subscribe(u=>{u&&(this.node.custom_adapters=u.adapters,u.requiredAdapters!==void 0&&(this.node.properties.adapters=u.requiredAdapters),this.cd.markForCheck())})}onSaveClick(){if(this.generalSettingsForm.valid){let e=this.generalSettingsForm.value;this.node.name=e.name,this.node.console_type=e.console_type,this.node.console_auto_start=e.console_auto_start,this.node.properties.on_close=e.on_close,this.node.properties.headless=e.headless,this.node.properties.linked_clone=e.linked_clone,this.node.properties.use_any_adapter=e.use_any_adapter,this.node.properties.usage=e.usage,this.nodeService.updateNodeWithCustomAdapters(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(o)}})}else this.toasterService.error("Fill all required fields.")}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-vmware"]],decls:12,vars:2,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["label","General settings"],[3,"formGroup"],[1,"form-field"],["matInput","","formControlName","name","type","text"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],["formControlName","console_type"],[3,"value"],["formControlName","console_auto_start"],["formControlName","on_close"],["formControlName","headless"],["formControlName","linked_clone"],["label","Network"],["formControlName","use_any_adapter"],["mat-raised-button","","color","primary",3,"click"],["label","Usage"],["matInput","","formControlName","usage"],[3,"removed"],["matChipRemove",""]],template:function(t,o){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),A(6,dbe,47,5,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),g("click",function(){return o.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),g("click",function(){return o.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for VMware VM ",o.name),m(5),O(o.name?6:-1))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,_e,Ne,Fe,Mt,On,To,tr,nr,we,Me,et,Se,Ee,vt,At,_t,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ot,Gt],encapsulation:2,changeDetection:0})}return n})();function mbe(n,i){if(n&1){let e=z();s(0,"mat-chip",17),g("removed",function(){let o=k(e).$implicit,r=v();return T(r.removeTag(o))}),d(1),s(2,"mat-icon",18),d(3,"cancel"),l()()}if(n&2){let e=i.$implicit;m(),ee(" ",e," ")}}function pbe(n,i){if(n&1&&(s(0,"mat-option",12),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}var hw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);vpcsConfigurationService=f(Lm);cd=f(Q);validationService=f(zi);controller;node;name;separatorKeysCodes=[13,188];consoleTypes=[];nodeName=U("");consoleType=U("");consoleAutoStart=U(!1);ngOnInit(){this.nodeService.getNode(this.controller,this.node).subscribe({next:e=>{this.node=e,this.name=e.name,this.nodeName.set(e.name||""),this.consoleType.set(e.console_type||""),this.consoleAutoStart.set(e.console_auto_start||!1),this.getConfiguration(),this.node.tags||(this.node.tags=[]),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getConfiguration(){this.consoleTypes=this.vpcsConfigurationService.getConsoleTypes()}onSaveClick(){let e=this.validationService.required(this.nodeName(),"Name");if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}this.node.name=this.nodeName(),this.node.console_type=this.consoleType(),this.node.console_auto_start=this.consoleAutoStart(),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(o),this.cd.markForCheck()}})}onCancelClick(){this.dialogRef.close()}addTag(e){let t=(e.value||"").trim();t&&this.node&&(this.node.tags||(this.node.tags=[]),this.node.tags.push(t)),e.chipInput&&e.chipInput.clear()}removeTag(e){if(!this.node.tags)return;let t=this.node.tags.indexOf(e);t>=0&&this.node.tags.splice(t,1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-configurator-vpcs"]],inputs:{nodeName:[1,"nodeName"],consoleType:[1,"consoleType"],consoleAutoStart:[1,"consoleAutoStart"]},outputs:{nodeName:"nodeNameChange",consoleType:"consoleTypeChange",consoleAutoStart:"consoleAutoStartChange"},decls:32,vars:6,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],[1,"form-container"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[3,"valueChange","value"],[3,"value"],[3,"change","checked"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],[3,"removed"],["matChipRemove",""]],template:function(t,o){if(t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),d(9,"Name"),l(),s(10,"input",8),g("input",function(a){return o.nodeName.set(a.target.value)}),l()(),s(11,"mat-form-field",9)(12,"mat-label"),d(13,"Tags"),l(),s(14,"mat-chip-grid",null,0),Y(16,mbe,4,1,"mat-chip",null,Ae),l(),s(18,"input",10),g("matChipInputTokenEnd",function(a){return o.addTag(a)}),l()(),s(19,"mat-form-field",7)(20,"mat-label"),d(21,"Console type"),l(),s(22,"mat-select",11),g("valueChange",function(a){return o.consoleType.set(a)}),Y(23,pbe,2,2,"mat-option",12,Ae),l()(),s(25,"mat-checkbox",13),g("change",function(a){return o.consoleAutoStart.set(a.checked)}),d(26," Auto start console "),l()()()()()(),s(27,"div",14)(28,"button",15),g("click",function(){return o.onCancelClick()}),d(29,"Cancel"),l(),s(30,"button",16),g("click",function(){return o.onSaveClick()}),d(31,"Apply"),l()()),t&2){let r=Pe(15);m(),ee("Configurator for VPCS node ",o.name),m(9),C("value",o.nodeName()),m(6),Z(o.node==null?null:o.node.tags),m(2),C("matChipInputFor",r)("matChipInputSeparatorKeyCodes",o.separatorKeysCodes),m(4),C("value",o.consoleType()),m(),Z(o.consoleTypes),m(2),C("checked",o.consoleAutoStart())}},dependencies:[ne,Xe,_e,Ne,Fe,Mt,On,we,Me,et,Se,Ee,vt,At,_t,W,pe,ti,Jn,vi,Ci,mi,ie,de,Ot,Gt],encapsulation:2,changeDetection:0})}return n})();var fw=(()=>{class n{dialog=f(nt);controller=le(void 0);node=le(void 0);conf={panelClass:["base-dialog-panel","configurator-dialog-panel"],autoFocus:!1,disableClose:!1};dialogRef;configureNode(){let e=this.node();e.node_type==="vpcs"?this.dialogRef=this.dialog.open(hw,this.conf):e.node_type==="ethernet_hub"?this.dialogRef=this.dialog.open(aw,this.conf):e.node_type==="ethernet_switch"?this.dialogRef=this.dialog.open(rw,this.conf):e.node_type==="cloud"?this.dialogRef=this.dialog.open(nw,this.conf):e.node_type==="dynamips"?this.dialogRef=this.dialog.open(sw,this.conf):e.node_type==="iou"?this.dialogRef=this.dialog.open(lw,this.conf):e.node_type==="qemu"?this.dialogRef=this.dialog.open(pw,it(K({},this.conf),{panelClass:["base-dialog-panel","configurator-dialog-panel"]})):e.node_type==="virtualbox"?this.dialogRef=this.dialog.open(Xz,this.conf):e.node_type==="vmware"?this.dialogRef=this.dialog.open(Yz,this.conf):e.node_type==="docker"?this.dialogRef=this.dialog.open(ow,it(K({},this.conf),{panelClass:["base-dialog-panel","configurator-dialog-panel","docker-configurator-dialog-panel"]})):e.node_type==="nat"?this.dialogRef=this.dialog.open(cw,this.conf):e.node_type==="frame_relay_switch"?this.dialogRef=this.dialog.open(uw,this.conf):e.node_type==="atm_switch"&&(this.dialogRef=this.dialog.open(ew,it(K({},this.conf),{panelClass:["base-dialog-panel","configurator-dialog-panel","atm-switch-config-panel"]})));let t=this.dialogRef.componentInstance;t.controller=this.controller(),t.node=e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-config-node-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.configureNode()}),s(1,"mat-icon"),d(2,"settings_applications"),l(),s(3,"span"),d(4,"Configure"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function ube(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.startNodes())}),s(1,"mat-icon"),d(2,"play_arrow"),l(),s(3,"span"),d(4,"Start"),l()()}}var gw=(()=>{class n{nodeService=f(ut);toasterService=f(te);cdr=f(Q);progressService=f(no);controller=le(void 0);nodes=le(void 0);isNodeWithStoppedStatus;ngOnChanges(e){e.nodes&&(this.isNodeWithStoppedStatus=!1,this.nodes().forEach(t=>{(t.status==="stopped"||t.status==="suspended")&&(this.isNodeWithStoppedStatus=!0)}))}startNodes(){this.progressService.activate(),this.nodes().forEach(e=>{this.nodeService.start(this.controller(),e).subscribe({next:t=>{this.nodes().indexOf(e)===this.nodes().length-1&&this.progressService.deactivate()},error:t=>{this.progressService.deactivate();let o=t.error?.message||t.message||"Failed to start node";this.toasterService.error(o),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-start-node-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},features:[bn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&A(0,ube,5,0,"button",0),t&2&&O(o.isNodeWithStoppedStatus?0:-1)},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function hbe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.suspendNodes())}),s(1,"mat-icon"),d(2,"pause"),l(),s(3,"span"),d(4,"Suspend"),l()()}}var _w=(()=>{class n{nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller=le(void 0);nodes=le(void 0);isNodeWithStartedStatus;ngOnChanges(e){e.nodes&&(this.isNodeWithStartedStatus=!1,this.nodes().forEach(t=>{t.status==="started"&&(this.isNodeWithStartedStatus=!0)}))}suspendNodes(){this.nodes().forEach(e=>{this.nodeService.suspend(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to suspend node";this.toasterService.error(o),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-suspend-node-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},features:[bn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&A(0,hbe,5,0,"button",0),t&2&&O(o.isNodeWithStartedStatus?0:-1)},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function fbe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.stopNodes())}),s(1,"mat-icon"),d(2,"stop"),l(),s(3,"span"),d(4,"Stop"),l()()}}var vw=(()=>{class n{nodeService=f(ut);toasterService=f(te);cdr=f(Q);progressService=f(no);controller=le(void 0);nodes=le(void 0);isNodeWithStartedStatus;ngOnChanges(e){e.nodes&&(this.isNodeWithStartedStatus=!1,this.nodes().forEach(t=>{t.status==="started"&&(this.isNodeWithStartedStatus=!0)}))}stopNodes(){this.progressService.activate(),this.nodes().forEach(e=>{this.nodeService.stop(this.controller(),e).subscribe({next:t=>{this.nodes().indexOf(e)===this.nodes().length-1&&this.progressService.deactivate()},error:t=>{this.progressService.deactivate();let o=t.error?.message||t.message||"Failed to stop node";this.toasterService.error(o),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-stop-node-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},features:[bn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&A(0,fbe,5,0,"button",0),t&2&&O(o.isNodeWithStartedStatus?0:-1)},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function gbe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.reloadNodes())}),s(1,"mat-icon"),d(2,"refresh"),l(),s(3,"span"),d(4,"Reload"),l()()}}var Cw=(()=>{class n{nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller=le(void 0);nodes=le(void 0);filteredNodes=[];ngOnInit(){(this.nodes()||[]).forEach(t=>{(t.node_type==="vpcs"||t.node_type==="qemu"||t.node_type==="virtualbox"||t.node_type==="vmware")&&this.filteredNodes.push(t)})}reloadNodes(){this.filteredNodes.forEach(e=>{this.nodeService.reload(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to reload node";this.toasterService.error(o),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-reload-node-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&A(0,gbe,5,0,"button",0),t&2&&O(o.filteredNodes.length>0?0:-1)},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var dp=(()=>{class n{toasterService;constructor(e){this.toasterService=e}buildVncWebSocketUrl(e,t){return`${e.protocol==="https:"?"wss":"ws"}://${e.host}:${e.port}/${wi.current_version}/projects/${t.project_id}/nodes/${t.node_id}/console/vnc?token=${e.authToken}`}buildVncConsolePageUrl(e,t){let o=this.buildVncWebSocketUrl(e,t);return`assets/vnc-console/index.html?${new URLSearchParams({ws_url:o,node_name:t.name,node_id:t.node_id,project_id:t.project_id,autoconnect:"1"}).toString()}`}openVncConsole(e,t,o=!1){if(t.status!=="started"){this.toasterService.error("Node must be started before opening console");return}if(t.console_type!=="vnc"){this.toasterService.error(`Node console type is ${t.console_type}, not vnc`);return}try{let r=this.buildVncConsolePageUrl(e,t),a=10,c=1024+a,p=768+a;if(t.properties){let h=t.properties;if(h.console_resolution){let S=h.console_resolution.split("x");S.length===2&&(c=parseInt(S[0],10)+a,p=parseInt(S[1],10)+a)}}let u;if(o)u=window.open(r,"_blank");else{let h=`VNC-${t.name}`;u=window.open(r,h,`width=${c},height=${p}`)}(!u||u.closed||typeof u.closed>"u")&&this.toasterService.error("Popup was blocked. Please allow popups for this site.")}catch(r){this.toasterService.error(`Failed to open VNC console: ${r.message}`)}}static \u0275fac=function(t){return new(t||n)(ge(te))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var bw=(()=>{class n{nodeConsoleService=f(rr);vncConsoleService=f(dp);toasterService=f(te);router=f(ht);mapSettingsService=f(go);cdr=f(Q);controller=le(void 0);project=le(void 0);nodes=le(void 0);openWebConsoleInline=new ve;openConsole(){if(this.nodes().length!==1){this.toasterService.error("Inline web console is only supported for a single node.");return}let e=this.nodes()[0],t=this.controller(),o=this.project();if(!(!t||!o)){if(e.status!=="started"){this.toasterService.error(`Please start the node '${e.name}' before opening the console.`);return}if(e.console_type==="none"){this.toasterService.error(`Node '${e.name}' has no console configured.`);return}e.console_type==="vnc"||e.console_type&&e.console_type.startsWith("http")?this.openWebConsoleInline.emit({node:e,controller:t,project:o}):e.console_type==="telnet"||e.console_type==="ssh"?(this.mapSettingsService.logConsoleSubject.next(!0),setTimeout(()=>{this.nodeConsoleService.openConsoleForNode(e),this.cdr.markForCheck()},500)):this.toasterService.error(`Console type '${e.console_type}' is not supported for inline web console.`)}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-http-console-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],nodes:[1,"nodes"]},outputs:{openWebConsoleInline:"openWebConsoleInline"},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.openConsole()}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Web console (Inline)"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var xw=(()=>{class n{nodeConsoleService=f(rr);vncConsoleService=f(dp);toasterService=f(te);router=f(ht);controller=le(void 0);nodes=le(void 0);openConsole(){let e="",t=0;this.nodes().forEach(o=>{if(o.console_type!=="none")if(o.status==="started")if(o.console_type==="vnc")this.vncConsoleService.openVncConsole(this.controller(),o,!0);else if(o.console_type&&o.console_type.startsWith("http")){(o.console_host==="0.0.0.0"||o.console_host==="0:0:0:0:0:0:0:0"||o.console_host==="::")&&(o.console_host=this.controller().host);let r=`${o.console_type}://${o.console_host}:${o.console}`;window.open(r,"_blank")}else if(o.console_type==="telnet"||o.console_type==="ssh"){let r=this.router.url.split("/"),a=`/static/web-ui/${r[1]}/${r[2]}/${r[3]}/${r[4]}/nodes/${o.node_id}`;window.open(a,"_blank")}else this.toasterService.error(`Console type '${o.console_type}' not supported in new tab for node ${o.name}.`);else t++,e+=o.name+" "}),t>0&&this.toasterService.error("Please start the following nodes if you want to open consoles in new tabs: "+e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-http-console-new-tab-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.openConsole()}),s(1,"mat-icon"),d(2,"http"),l(),s(3,"span"),d(4,"Web console in new tab"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var eg={UKNOWN:"Unknown"},UA={CHROME:"Chrome",FIREFOX:"Firefox",SAFARI:"Safari",OPERA:"Opera",IE:"IE",MS_EDGE:"MS-Edge",MS_EDGE_CHROMIUM:"MS-Edge-Chromium",FB_MESSANGER:"FB-Messanger",SAMSUNG:"Samsung",UCBROWSER:"UC-Browser",UNKNOWN:eg.UKNOWN},yw={HTC:/HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel/,NEXUS_PHONE:/Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6/,DELL:/Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b/,MOTOROLA:new RegExp(`Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|
A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|
MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|
ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|
WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|
XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|
XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052`),SAMSUNG:new RegExp(`\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|
GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|
GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|
GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|
GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|
GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|
GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|
GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|
GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|
GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|
GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|
GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|
GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|
GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|
GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|
GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|
GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|
GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|
SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|
SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|
SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|
SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|
SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|
SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|
SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|
SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|
SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|
SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|
SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|
SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|
SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|
SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|
SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|
SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|
SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|
SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|
SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|
SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|
SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|
SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|
SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|
SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|
SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|
SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|
SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|
SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|
SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|
SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|
SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|
GT-N7105|SCH-I535|SM-N900A|SM-N900T|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|
GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|
GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|
SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|
SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|
SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F`),LG:new RegExp(`\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|
LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|
C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|
LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|
VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|
MS323|M257)`),SONY:/SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533/,ASUS:/Asus.*Galaxy|PadFone.*Mobile/,NOKIA_LUMIA:/Lumia [0-9]{3,4}/,MICROMAX:/Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b/,PALM:/PalmSource|Palm/,VERTU:/Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature/,PANTECH:new RegExp(`PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|
IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|
IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|
CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|
P2000|P7040|P7000|C790`),FLY:/IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250/,WIKO:new RegExp(`KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|
SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|
CINK KING|CINK PEAX|CINK SLIM|SUBLIM`),I_MOBILE:/i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)/,SIMVALLEY:/\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b/,WOLFGANG:/AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q/,ALCATEL:/Alcatel|Mobile; rv:49.0|Mobile; ALCATEL 4052R; rv:48.0/,NINTENDO:/Nintendo (3DS|Switch)/,AMOI:/Amoi/,INQ:/INQ/,VITA:/\bVita\b/,BLACKBERRY:/\bBlackBerry\b|\bBB10\b|rim[0-9]+/,FIREFOX_OS:/\bFirefox-OS\b/,IPHONE:/\biPhone\b/,iPod:/\biPod\b/,ANDROID:/\bAndroid\b/,WINDOWS_PHONE:/\bWindows-Phone\b/,GENERIC_PHONE:new RegExp(`Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|
up.link|vodafone|\\bwap\\b|nokia|Nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser`)},Jf={iPad:/iPad|iPad.*Mobile/,NexusTablet:/Android.*Nexus[\s]+(7|9|10)/,GoogleTablet:/Android.*Pixel C/,SamsungTablet:new RegExp(`SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|
GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|
SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|
GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|
SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|
GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|
SHV-E230S|SHW-M180K|SHW-M180L|SM-T865|SM-T290|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|
SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|
GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T385M|SM-P585M|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|
SM-P601|SM-P605|SM-P615|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|
GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|
SM-T510|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|
SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T500|SM-T330|
SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|
SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|
SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|
SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|
SM-T719|SM-T725|SM-T813|SM-T819|SM-T580|SM-T590|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|
SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-P585Y|SM-X200`),Kindle:new RegExp(`Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|
KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk/[0-9.]+ like Chrome /[0-9.]+ (?!Mobile)`),SurfaceTablet:/Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)/,HPTablet:/HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10/,AsusTablet:new RegExp(`^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|
TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|
Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|
ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|
ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b|\\bP024\\b|\\bP00C\\b`),BlackBerryTablet:/PlayBook|RIM Tablet/,HTCtablet:/HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410/,MotorolaTablet:/xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617/,NookTablet:/Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2/,AcerTablet:new RegExp(`Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|
W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|
\\bA3-A20\\b|\\bA3-A30`),ToshibaTablet:/Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO/,LGTablet:/\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\b/,FujitsuTablet:/Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b/,PrestigioTablet:new RegExp(`PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|
PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|
PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|
PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|
PMT5887|PMT5001|PMT5002`),LenovoTablet:new RegExp(`Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|
YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|
B8000|B8080)(-|)(FL|F|HV|H|)|TB-X606F|TB-X103F|TB-X304F|TB-X304L|TB-X704F|TB-8703F|Tab2A7-10F|TB2-X30L|TB-8504F`),DellTablet:/Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7/,YarvikTablet:new RegExp(`Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|
TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|
TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|
TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|
TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b`),MedionTablet:/Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB/,ArnovaTablet:/97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2/,IntensoTablet:/INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004/,IRUTablet:/M702pro/,MegafonTablet:/MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b/,EbodaTablet:/E-Boda (Supreme|Impresspeed|Izzycomm|Essential)/,AllViewTablet:/Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)/,ArchosTablet:new RegExp(`\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10|
Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b`),AinolTablet:/NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark/,NokiaLumiaTablet:/Lumia 2520/,SonyTablet:new RegExp(`Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|
SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|
EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|
SGP612|SGP712`),PhilipsTablet:/\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b/,CubeTablet:/Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT/,CobyTablet:new RegExp(`MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|
MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010`),MIDTablet:new RegExp(`M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|
MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|
MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10`),MSITablet:new RegExp(`MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|
Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b`),SMiTTablet:/Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)/,RockChipTablet:/Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A/,FlyTablet:/IQ310|Fly Vision/,bqTablet:new RegExp(`Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|
Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))|Maxwell.*Lite|Maxwell.*Plus`),HuaweiTablet:new RegExp(`MediaPad|MediaPad 7 Youth|MediaPad T3 10|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|
S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-W09`),NecTablet:/\bN-06D|\bN-08D/,PantechTablet:/Pantech.*P4100/,BronchoTablet:/Broncho.*(N701|N708|N802|a710)/,VersusTablet:/TOUCHPAD.*[78910]|\bTOUCHTAB\b/,ZyncTablet:/z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900/,PositivoTablet:/TB07STA|TB10STA|TB07FTA|TB10FTA/,NabiTablet:/Android.*\bNabi/,KoboTablet:/Kobo Touch|\bK080\b|\bVox\b Build|\bArc\b Build/,DanewTablet:/DSlide.*\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\b/,TexetTablet:new RegExp(`NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|
TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|
TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|
TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|
TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|
TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|
TB-436|TB-416|TB-146SE|TB-126SE`),PlaystationTablet:/Playstation.*(Portable|Vita)/,TrekstorTablet:/ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab/,PyleAudioTablet:/\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\b/,AdvanTablet:new RegExp(`Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|
T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b`),DanyTechTablet:`Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|
Genius TAB GII|Genius TAB GIII|Genius Tab S1`,GalapadTablet:/Android.*\bG1\b(?!\))/,MicromaxTablet:/Funbook|Micromax.*\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\b/,KarbonnTablet:/Android.*\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\b/,AllFineTablet:/Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide/,PROSCANTablet:new RegExp(`\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|
PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|
PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|
PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b`),YONESTablet:/BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026/,ChangJiaTablet:new RegExp(`TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|
TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|
TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|
TPC10111|TPC10203|TPC10205|TPC10503`),GUTablet:/TX-A1301|TX-M9002|Q702|kf026/,PointOfViewTablet:new RegExp(`TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|
TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|
TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|
TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10`),OvermaxTablet:new RegExp(`OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|
MagicTab|Stream|TB-08|TB-09)|Qualcore 1027`),HCLTablet:/HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync/,DPSTablet:/DPS Dream 9|DPS Dual 7/,VistureTablet:/V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10/,CrestaTablet:/CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989/,MediatekTablet:/\bMT8125|MT8389|MT8135|MT8377\b/,ConcordeTablet:/Concorde([ ]+)?Tab|ConCorde ReadMan/,GoCleverTablet:new RegExp(`GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|
TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|
GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|
TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|
TAB R104|TAB R83.3|TAB A1042`),ModecomTablet:new RegExp(`FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|
FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|
FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003`),VoninoTablet:new RegExp(`\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|
Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|
Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b`),ECSTablet:/V07OT2|TM105A|S10OT1|TR10CS1/,StorexTablet:/eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab/,VodafoneTablet:/SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497/,EssentielBTablet:/Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2/,RossMoorTablet:/RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711/,iMobileTablet:/i-mobile i-note/,TolinoTablet:/tolino tab [0-9.]+|tolino shine/,AudioSonicTablet:/\bC-22Q|T7-QC|T-17B|T-17P\b/,AMPETablet:/Android.* A78 /,SkkTablet:/Android.* (SKYPAD|PHOENIX|CYCLOPS)/,TecnoTablet:/TECNO P9|TECNO DP8D/,JXDTablet:new RegExp(`Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|
S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|
P1000|P300|S18|S6600|S9100)\\b`),iJoyTablet:new RegExp(`Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|
Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|
Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|
Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|
Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)`),FX2Tablet:/FX2 PAD7|FX2 PAD10/,XoroTablet:new RegExp(`KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|
PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|
PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|
TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151`),ViewsonicTablet:/ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a/,VerizonTablet:/QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1/,OdysTablet:/LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\bXELIO\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10/,CaptivaTablet:/CAPTIVA PAD/,IconbitTablet:new RegExp(`NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|
NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S`),TeclastTablet:new RegExp(`T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|
\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|
\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|
\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|
\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|
\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|
\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|
\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|
\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi`),OndaTablet:new RegExp(`\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|
V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|
V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|
Vi40)\\b[s]+|V10 \\b4G\\b`),JaytechTablet:/TPC-PA762/,BlaupunktTablet:/Endeavour 800NG|Endeavour 1010/,DigmaTablet:/\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\b/,EvolioTablet:/ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b/,LavaTablet:/QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b/,AocTablet:/MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712/,MpmanTablet:new RegExp(`MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|
\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|
MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010`),CelkonTablet:/CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b/,WolderTablet:new RegExp(`miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|
POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|
FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b`),MediacomTablet:"M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA",MiTablet:/\bMI PAD\b|\bHM NOTE 1W\b/,NibiruTablet:/Nibiru M1|Nibiru Jupiter One/,NexoTablet:/NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI/,LeaderTablet:new RegExp(`TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|
TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100`),UbislateTablet:/UbiSlate[\s]?7C/,PocketBookTablet:/Pocketbook/,KocasoTablet:/\b(TB-1207)\b/,HisenseTablet:/\b(F5281|E2371)\b/,Hudl:/Hudl HT7S3|Hudl 2/,TelstraTablet:/T-Hub2/,Honeywell:/RT10A/,GenericTablet:new RegExp(`Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|
A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|
Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107`)},mp={BLACKBERRY:"Blackberry",FIREFOX_OS:"Firefox-OS",CHROME_BOOK:"Chrome-Book",WINDOWS_PHONE:"Windows-Phone",VITA:"Vita",PS4:"PS4",MAC:"Macintosh",CHROMECAST:"Chromecast",APPLE_TV:"Apple-TV",GOOGLE_TV:"Google-TV",ANDROID:"Android",Tesla:"Tesla",iPad:"iPad",IPHONE:"iPhone",iPod:"iPod",UNKNOWN:eg.UKNOWN,HTC:"HTC",NEXUS_PHONE:"Nexus Phone",NexusTablet:"Nexus Tablet",DELL:"Dell",MOTOROLA:"Motorola",SAMSUNG:"Samsung",LG:"LG",SONY:"Sony",ASUS:"Asus",NOKIA_LUMIA:"Nokia Lumia",MICROMAX:"Micromax",PALM:"Palm",VERTU:"Vertu",PANTECH:"PANTECH",FLY:"Fly",WIKO:"WIKO",I_MOBILE:"i-mobile",SIMVALLEY:"Simvalley",WOLFGANG:"Wolfgang",ALCATEL:"Alcatel",HONEYWELL:"Honeywell",NINTENDO:"Nintendo",AMOI:"Amoi",INQ:"INQ",GENERIC_PHONE:"Generic Phone",MI_SE_9:"Mi SE 9"},Zz=[mp.PS4,mp.CHROME_BOOK,mp.MAC,mp.DELL,mp.ASUS,mp.UNKNOWN],_be={WINDOWS:"Windows",MAC:"Mac",IOS:"iOS",ANDROID:"Android",LINUX:"Linux",UNIX:"Unix",FIREFOX_OS:"Firefox-OS",CHROME_OS:"Chrome-OS",WINDOWS_PHONE:"Windows-Phone",UNKNOWN:eg.UKNOWN},vbe={WINDOWS_3_11:"windows-3-11",WINDOWS_95:"windows-95",WINDOWS_ME:"windows-me",WINDOWS_98:"windows-98",WINDOWS_CE:"windows-ce",WINDOWS_2000:"windows-2000",WINDOWS_XP:"windows-xp",WINDOWS_SERVER_2003:"windows-server-2003",WINDOWS_VISTA:"windows-vista",WINDOWS_7:"windows-7",WINDOWS_8_1:"windows-8-1",WINDOWS_8:"windows-8",WINDOWS_10:"windows-10",WINDOWS_PHONE_7_5:"windows-phone-7-5",WINDOWS_PHONE_8_1:"windows-phone-8-1",WINDOWS_PHONE_10:"windows-phone-10",WINDOWS_NT_4_0:"windows-nt-4-0",MACOSX_11_0:"mac-os-x-11-0",MACOSX_16:"mac-os-x-16",MACOSX_15:"mac-os-x-15",MACOSX_14:"mac-os-x-14",MACOSX_13:"mac-os-x-13",MACOSX_12:"mac-os-x-12",MACOSX_11:"mac-os-x-11",MACOSX_10:"mac-os-x-10",MACOSX_9:"mac-os-x-9",MACOSX_8:"mac-os-x-8",MACOSX_7:"mac-os-x-7",MACOSX_6:"mac-os-x-6",MACOSX_5:"mac-os-x-5",MACOSX_4:"mac-os-x-4",MACOSX_3:"mac-os-x-3",MACOSX_2:"mac-os-x-2",MACOSX:"mac-os-x",iOS:"iOS",ANDROID_9:"android-9",UNKNOWN:eg.UKNOWN.toLowerCase()},Jz={WINDOWS:{and:[{or:[/\bWindows|(Win\d\d)\b/,/\bWin 9x\b/]},{not:/\bWindows Phone\b/}]},MAC:{and:[/\bMac OS\b/,{not:{or:[/\biPhone\b/,/\biPad\b/,/\biPod\b/,/\bWindows Phone\b/]}}]},IOS:{and:[{or:[/\biPad\b/,/\biPhone\b/,/\biPod\b/]},{not:/\bWindows Phone\b/}]},ANDROID:{and:[/\bAndroid\b/,{not:/\bWindows Phone\b/}]},LINUX:/\bLinux\b/,UNIX:/\bUNIX\b/,FIREFOX_OS:{and:[/\bFirefox\b/,/Mobile\b/]},CHROME_OS:/\bCrOS\b/,WINDOWS_PHONE:{or:[/\bIEMobile\b/,/\bWindows Phone\b/]},PS4:/\bMozilla\/5.0 \(PlayStation 4\b/,VITA:/\bMozilla\/5.0 \(Play(S|s)tation Vita\b/},Cbe={CHROME:{and:[{or:[/\bChrome\b/,/\bCriOS\b/,/\bHeadlessChrome\b/]},{not:{or:[/\bOPR\b/,/\bEdg(e|A|iOS)\b/,/\bEdg\/\b/,/\bSamsungBrowser\b/,/\bUCBrowser\b/]}}]},FIREFOX:{or:[/\bFirefox\b/,/\bFxiOS\b/]},SAFARI:{and:[/^((?!CriOS).)*\Safari\b.*$/,{not:{or:[/\bOPR\b/,/\bEdg(e|A|iOS)\b/,/\bEdg\/\b/,/\bWindows Phone\b/,/\bSamsungBrowser\b/,/\bUCBrowser\b/]}}]},OPERA:{or:[/Opera\b/,/\bOPR\b/]},IE:{or:[/\bMSIE\b/,/\bTrident\b/,/^Mozilla\/5\.0 \(Windows NT 10\.0; Win64; x64\)$/]},MS_EDGE:{or:[/\bEdg(e|A|iOS)\b/]},MS_EDGE_CHROMIUM:/\bEdg\/\b/,PS4:/\bMozilla\/5.0 \(PlayStation 4\b/,VITA:/\bMozilla\/5.0 \(Play(S|s)tation Vita\b/,FB_MESSANGER:/\bFBAN\/MessengerForiOS\b/,SAMSUNG:/\bSamsungBrowser\b/,UCBROWSER:/\bUCBrowser\b/},bbe=it(K(K(K({},yw),Jf),Jz),{FIREFOX_OS:{and:[/\bFirefox\b/,/\bMobile\b/]},CHROME_BOOK:/\bCrOS\b/,PS4:/\bMozilla\/5.0 \(PlayStation 4\b/,CHROMECAST:/\bCrKey\b/,APPLE_TV:/^iTunes-AppleTV\/4.1$/,GOOGLE_TV:/\bGoogleTV\b/,Tesla:/Tesla\/([0-9]{4}.[0-9]{1,2}.?[0-9]{0,2}.?[0-9]{0,2})-(.{7})/,MI_SE_9:/\bXiaomi\b/,MAC:{and:[/\bMac OS\b/,{not:{or:[/\biPhone\b/,/\biPad\b/,/\biPod\b/,/\bWindows Phone\b/]}}]}}),zA={WINDOWS_3_11:/Win16/,WINDOWS_95:/(Windows 95|Win95|Windows_95)/,WINDOWS_ME:/(Win 9x 4.90|Windows ME)/,WINDOWS_98:/(Windows 98|Win98)/,WINDOWS_CE:/Windows CE/,WINDOWS_2000:/(Windows NT 5.0|Windows 2000)/,WINDOWS_XP:/(Windows NT 5.1|Windows XP)/,WINDOWS_SERVER_2003:/Windows NT 5.2/,WINDOWS_VISTA:/Windows NT 6.0/,WINDOWS_7:/(Windows 7|Windows NT 6.1)/,WINDOWS_8_1:/(Windows 8.1|Windows NT 6.3)/,WINDOWS_8:/(Windows 8|Windows NT 6.2)/,WINDOWS_10:/(Windows NT 10.0)/,WINDOWS_PHONE_7_5:/(Windows Phone OS 7.5)/,WINDOWS_PHONE_8_1:/(Windows Phone 8.1)/,WINDOWS_PHONE_10:/(Windows Phone 10)/,WINDOWS_NT_4_0:{and:[/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/,{not:/Windows NT 10.0/}]},MACOSX:/(MAC OS X\s*[^ 0-9])/,MACOSX_3:/(Darwin 10.3|Mac OS X 10.3)/,MACOSX_4:/(Darwin 10.4|Mac OS X 10.4)/,MACOSX_5:/(Mac OS X 10.5)/,MACOSX_6:/(Mac OS X 10.6)/,MACOSX_7:/(Mac OS X 10.7)/,MACOSX_8:/(Mac OS X 10.8)/,MACOSX_9:/(Mac OS X 10.9)/,MACOSX_10:/(Mac OS X 10.10)/,MACOSX_11:/(Mac OS X 10.11)/,MACOSX_12:/(Mac OS X 10.12)/,MACOSX_13:/(Mac OS X 10.13)/,MACOSX_14:/(Mac OS X 10.14)/,MACOSX_15:/(Mac OS X 10.15)/,MACOSX_16:/(Mac OS X 10.16)/,MACOSX_11_0:{or:[/11_0 like Mac OS X/,/Mac OS X 11/]},iOS:/(iPhone OS\s*[0-9_]+)/,ANDROID_9:/(Android 9)/},jA={CHROME:[/\bChrome\/([\d\.]+)\b/,/\bCriOS\/([\d\.]+)\b/,/\bHeadlessChrome\/([\d\.]+)\b/],FIREFOX:[/\bFirefox\/([\d\.]+)\b/,/\bFxiOS\/([\d\.]+)\b/],SAFARI:[/\bVersion\/([\d\.]+)\b/,/\bSafari\/([\d\.]+)\b/],OPERA:[/\bVersion\/([\d\.]+)\b/,/\bOPR\/([\d\.]+)\b/],IE:[/\bMSIE ([\d\.]+\w?)\b/,/\brv:([\d\.]+\w?)\b/],MS_EDGE:/\bEdg(?:e|A|iOS)\/([\d\.]+)\b/,MS_EDGE_CHROMIUM:/\bEdg\/([\d\.]+)\b/,SAMSUNG:/\bSamsungBrowser\/([\d\.]+)\b/,UCBROWSER:/\bUCBrowser\/([\d\.]+)\b/},xbe=Object.keys(zA).reduce((n,i)=>(n[i]=zA[i],n),{}),e9=Object.keys(jA).reduce((n,i)=>(n[UA[i]]=jA[i],n),{}),nd=Object.freeze({__proto__:null,GENERAL:eg,BROWSERS:UA,MOBILES_RE:yw,TABLETS_RE:Jf,DEVICES:mp,DESKTOP_DEVICES:Zz,OS:_be,OS_VERSIONS:vbe,OS_RE:Jz,BROWSERS_RE:Cbe,DEVICES_RE:bbe,OS_VERSIONS_RE_MAP:zA,BROWSER_VERSIONS_RE_MAP:jA,OS_VERSIONS_RE:xbe,BROWSER_VERSIONS_RE:e9}),$A=class{constructor(){}test(i,e){return typeof e=="string"&&(e=new RegExp(e)),e instanceof RegExp?e.test(i):e&&Array.isArray(e.and)?e.and.every(t=>this.test(i,t)):e&&Array.isArray(e.or)?e.or.some(t=>this.test(i,t)):e&&e.not?!this.test(i,e.not):!1}exec(i,e){return typeof e=="string"&&(e=new RegExp(e)),e instanceof RegExp?e.exec(i):e&&Array.isArray(e)?e.reduce((t,o)=>t||this.exec(i,o),null):null}},Rv=(function(n){return n.Mobile="mobile",n.Tablet="tablet",n.Desktop="desktop",n.Unknown="unknown",n})(Rv||{}),HA=(function(n){return n.Portrait="portrait",n.Landscape="landscape",n})(HA||{}),BA="iPad",Sw=(()=>{class n{constructor(e){this.platformId=e,this.ua="",this.userAgent="",this.os="",this.browser="",this.device="",this.os_version="",this.browser_version="",this.reTree=new $A,this.deviceType="",this.orientation="",xs(this.platformId)&&typeof window<"u"&&(this.userAgent=window.navigator.userAgent),this.setDeviceInfo(this.userAgent)}setDeviceInfo(e=this.userAgent){e!==this.userAgent&&(this.userAgent=e);let t=[{const:"OS",prop:"os"},{const:"BROWSERS",prop:"browser"},{const:"DEVICES",prop:"device"},{const:"OS_VERSIONS",prop:"os_version"}];if(t.forEach(o=>{this[o.prop]=Object.keys(nd[o.const]).reduce((r,a)=>nd[o.const][a]==="device"&&xs(this.platformId)&&(this.reTree.test(this.userAgent,Jf[BA])||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)?(r[nd[o.const][a]]=BA,Object):(r[nd[o.const][a]]=this.reTree.test(e,nd[`${o.const}_RE`][a]),r),{})}),t.forEach(o=>{this[o.prop]=Object.keys(nd[o.const]).map(r=>nd[o.const][r]).reduce((r,a)=>o.prop==="device"&&r===nd[o.const].ANDROID?this[o.prop][a]?a:r:r===nd[o.const].UNKNOWN&&this[o.prop][a]?a:r,nd[o.const].UNKNOWN)}),this.browser_version="0",this.browser!==UA.UNKNOWN){let o=e9[this.browser],r=this.reTree.exec(e,o);r&&(this.browser_version=r[1])}typeof window<"u"&&window.matchMedia?this.orientation=window.matchMedia("(orientation: landscape)").matches?HA.Landscape:HA.Portrait:this.orientation=eg.UKNOWN,this.deviceType=this.isTablet()?Rv.Tablet:this.isMobile(this.userAgent)?Rv.Mobile:this.isDesktop(this.userAgent)?Rv.Desktop:Rv.Unknown}getDeviceInfo(){return{userAgent:this.userAgent,os:this.os,browser:this.browser,device:this.device,os_version:this.os_version,browser_version:this.browser_version,deviceType:this.deviceType,orientation:this.orientation}}isMobile(e=this.userAgent){return this.isTablet(e)?!1:!!Object.keys(yw).find(o=>this.reTree.test(e,yw[o]))}isTablet(e=this.userAgent){return xs(this.platformId)&&(this.reTree.test(this.userAgent,Jf[BA])||typeof navigator<"u"&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)?!0:!!Object.keys(Jf).find(o=>!!this.reTree.test(e,Jf[o]))}isDesktop(e=this.userAgent){return this.device===mp.UNKNOWN&&(this.isMobile(e)||this.isTablet(e))?!1:Zz.indexOf(this.device)>-1}}return n.\u0275fac=function(e){return new(e||n)(ge(Bu))},n.\u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var pp=(()=>{class n{toasterService;deviceService;loginService;constructor(e,t,o){this.toasterService=e,this.deviceService=t,this.loginService=o}createHiddenIframe(e,t){let o=document.createElement("iframe");return o.src=t,o.id="hiddenIframe",o.style.display="none",e.appendChild(o),o}openUriUsingFirefox(e){var t=document.querySelector("#hiddenIframe");t||(t=this.createHiddenIframe(document.body,"about:blank"));try{t.contentWindow.location.href=e}catch(o){o.name==="NS_ERROR_UNKNOWN_PROTOCOL"&&this.toasterService.error("Protocol handler does not exist")}}async open(e){let t=this.deviceService.getDeviceInfo();console.log("Launching external protocol handler with "+t.browser+": "+e),t.browser==="Firefox"?this.openUriUsingFirefox(e):location.assign(e)}static \u0275fac=function(t){return new(t||n)(ge(te),ge(Sw),ge(dl))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var n9=Bs(GA());function wbe(n,i){if(n&1){let e=z();s(0,"button",0),g("click",function(){k(e);let o=v();return T(o.openConsole(o.auxiliary=!0))}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Auxiliary console"),l()()}}var tg=(()=>{class n{toasterService=f(te);nodeService=f(ut);deviceService=f(Sw);protocolHandlerService=f(pp);cd=f(Q);controller=le(void 0);node=le(void 0);updatedNode=ae(void 0);openConsole(e=!1){let t=this.node();t&&this.nodeService.getNode(this.controller(),t).subscribe({next:o=>{this.updatedNode.set(o),this.cd.markForCheck(),this.startConsole(e)},error:o=>{let r=o.error?.message||o.message||"Failed to get node information";this.toasterService.error(r),this.cd.markForCheck()}})}startConsole(e){let t=this.updatedNode()||this.node();if(t)if(t.status!=="started")this.toasterService.error("This node must be started before a console can be opened");else{(t.console_host==="0.0.0.0"||t.console_host==="0:0:0:0:0:0:0:0"||t.console_host==="::")&&(t=it(K({},t),{console_host:this.controller().host}),this.updatedNode.set(t));try{var o,r=t.console_host;if(n9.IPv6.isValid(r)&&(r=`[${r}]`),t.console_type==="telnet"||t.console_type==="ssh"){var a;if(e===!0){if(a=t.properties.aux,a===void 0){this.toasterService.error("Auxiliary console port is not set.");return}}else a=t.console;o=`gns3+${t.console_type}://${r}:${a}?name=${encodeURIComponent(t.name)}&project_id=${t.project_id}&node_id=${t.node_id}`}else if(t.console_type==="vnc")o=`gns3+vnc://${r}:${t.console}?name=${t.name}&project_id=${t.project_id}&node_id=${t.node_id}`;else if(t.console_type&&t.console_type.startsWith("spice"))o=`gns3+spice://${r}:${t.console}?name=${encodeURIComponent(t.name)}&project_id=${t.project_id}&node_id=${t.node_id}`;else{if(t.console_type&&t.console_type.startsWith("http"))return o=`${t.console_type}://${r}:${t.console}`,window.open(o);this.toasterService.error("Supported console types are: telnet, ssh, vnc, spice and spice+agent.");return}this.protocolHandlerService.open(o)}catch(c){this.toasterService.error(c)}}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-console-device-action-browser"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:6,vars:1,consts:[["mat-menu-item","",3,"click"],["mat-menu-item",""]],template:function(t,o){if(t&1&&(s(0,"button",0),g("click",function(){return o.openConsole()}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Console"),l()(),A(5,wbe,5,0,"button",1)),t&2){let r;m(5),O(((r=o.node())==null?null:r.node_type)==="docker"||((r=o.node())==null?null:r.node_type)==="dynamips"||((r=o.node())==null?null:r.node_type)==="qemu"?5:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Mw=(()=>{class n{nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller=le(void 0);node=le(void 0);isolate(){this.nodeService.isolate(this.controller(),this.node()).subscribe(e=>{},e=>{this.toasterService.error(e.error?.message||e.message||"Failed to isolate node"),this.cdr.markForCheck()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-isolate-node-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.isolate()}),s(1,"mat-icon"),d(2,"gps_off"),l(),s(3,"span"),d(4,"Isolate"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var kw=(()=>{class n{nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller=le(void 0);node=le(void 0);unisolate(){this.nodeService.unisolate(this.controller(),this.node()).subscribe({next:e=>{},error:e=>{let t=e.error?.message||e.message||"Failed to unisolate node";this.toasterService.error(t),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-unisolate-node-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.unisolate()}),s(1,"mat-icon"),d(2,"gps_not_fixed"),l(),s(3,"span"),d(4,"Un-isolate"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Tw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);formBuilder=f(Vn);cd=f(Q);controller;node;inputForm;name;constructor(){this.name="",this.inputForm=this.formBuilder.group({name:new Ye("",Ue.required)})}ngOnInit(){this.node&&(this.name=this.node.name,this.inputForm.get("name")?.setValue(this.node.name)),this.cd.markForCheck()}onSaveClick(){if(this.inputForm.valid){let e=this.inputForm.get("name")?.value;this.node.name=e,this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let o=t.error?.message||t.message||"Failed to update node.";this.toasterService.error(o),this.cd.markForCheck()}})}else this.toasterService.error("Fill all required fields.")}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-change-hostname-dialog-component"]],decls:13,vars:2,consts:[[1,"change-hostname"],[1,"change-hostname__title"],[1,"change-hostname__form",3,"formGroup"],["appearance","fill",1,"change-hostname__field"],["matInput","","type","text","formControlName","name","placeholder","Name"],[1,"change-hostname__actions"],["mat-button","","color","accent",3,"click"],["mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"h1",1),d(2),l(),s(3,"form",2)(4,"mat-form-field",3)(5,"mat-label"),d(6,"Name"),l(),R(7,"input",4),l()(),s(8,"div",5)(9,"button",6),g("click",function(){return o.onCancelClick()}),d(10,"Cancel"),l(),s(11,"button",7),g("click",function(){return o.onSaveClick()}),d(12,"Apply"),l()()()),t&2&&(m(2),ee("Change hostname for node ",o.name),m(),C("formGroup",o.inputForm))},dependencies:[_e,W,pe,Se,Ee,Me,et,we,Mt,Dt,at,Ft,Pt,rt,Rt,zt],styles:[".change-hostname[_ngcontent-%COMP%]{padding:16px}.change-hostname__title[_ngcontent-%COMP%]{margin-bottom:16px;font-size:18px}.change-hostname__form[_ngcontent-%COMP%]{margin-bottom:24px}.change-hostname__field[_ngcontent-%COMP%]{width:100%}.change-hostname__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}"],changeDetection:0})}return n})();var Ew=(()=>{class n{dialog=f(nt);controller=le(void 0);node=le(void 0);changeHostname(){let t=this.dialog.open(Tw,{autoFocus:!1,disableClose:!1}).componentInstance;t.controller=this.controller(),t.node=this.node()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-change-hostname-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.changeHostname()}),s(1,"mat-icon"),d(2,"edit"),l(),s(3,"span"),d(4,"Change hostname"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Dw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);cd=f(Q);controller;node;symbol;ngOnInit(){this.symbol=this.node.symbol,this.cd.markForCheck()}symbolChanged(e){this.symbol=e,this.cd.markForCheck()}onCloseClick(){this.dialogRef.close()}onSelectClick(){this.nodeService.updateSymbol(this.controller,this.node,this.symbol).subscribe({next:()=>{this.onCloseClick()},error:e=>{let t=e.error?.message||e.message||"Failed to update symbol";this.toasterService.error(t),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-change-symbol-dialog"]],inputs:{controller:"controller",node:"node"},decls:9,vars:3,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[3,"symbolChanged","controller","symbol"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1)(3,"app-symbols",2),g("symbolChanged",function(a){return o.symbolChanged(a)}),l()(),s(4,"div",3)(5,"button",4),g("click",function(){return o.onCloseClick()}),d(6,"Cancel"),l(),s(7,"button",5),g("click",function(){return o.onSelectClick()}),d(8,"Apply"),l()()),t&2&&(m(),ee("Change symbol for node: ",o.node.name),m(2),C("controller",o.controller)("symbol",o.symbol))},dependencies:[_e,Ne,Fe,W,pe,Em],styles:[".modal-form-container[_ngcontent-%COMP%]{padding:16px;overflow-y:auto;max-height:500px}.menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.radio-selection[_ngcontent-%COMP%]{width:90%}.mat-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-left:16px}.non-visible[_ngcontent-%COMP%]{display:none}.example-full-width[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var Pw=(()=>{class n{dialog=f(nt);dialogConfig=f(fo);controller=le(void 0);node=le(void 0);changeSymbol(){let e=this.dialogConfig.openConfig("changeSymbol",{autoFocus:!1,disableClose:!1}),o=this.dialog.open(Dw,e).componentInstance;o.controller=this.controller(),o.node=this.node()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-change-symbol-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.changeSymbol()}),s(1,"mat-icon"),d(2,"find_replace"),l(),s(3,"span"),d(4,"Change symbol"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Iw=(()=>{class n{nodeService=f(ut);nodesDataSource=f(di);drawingService=f(Ri);drawingsDataSource=f(Ei);toasterService=f(te);cdr=f(Q);controller=le(void 0);project=le(void 0);drawings=le([]);nodes=le([]);duplicate(){for(let e of this.nodes())this.nodeService.duplicate(this.controller(),e).subscribe({next:t=>{this.nodesDataSource.add(t)},error:t=>{if(t.status===409)this.toasterService.error(`Shutdown ${e.name} before duplicating`);else{let o=t.error?.message||t.message||"Failed to duplicate node";this.toasterService.error(o)}this.cdr.markForCheck()}});for(let e of this.drawings())this.drawingService.duplicate(this.controller(),e.project_id,e).subscribe({next:t=>{this.drawingsDataSource.add(t)},error:t=>{let o=t.error?.message||t.message||"Failed to duplicate drawing";this.toasterService.error(o),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-duplicate-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],drawings:[1,"drawings"],nodes:[1,"nodes"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.duplicate()}),s(1,"mat-icon"),d(2,"filter_none"),l(),s(3,"span"),d(4,"Duplicate"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var vs=(()=>{class n{constructor(){}getCurveInterpolator(e){switch(e){case"basis":return kv;case"catmullrom":return Du;case"monotone":return Tv;default:return Du}}convert(e){let t="";if(e.element instanceof kr)t=`${e.element.stroke_dasharray==""?`<rect fill="${e.element.fill}" fill-opacity="${e.element.fill_opacity}" height="${e.element.height}" width="${e.element.width}" rx="${e.element.rx}" ry="${e.element.ry}" />`:`<rect fill="${e.element.fill}" fill-opacity="${e.element.fill_opacity}" height="${e.element.height}" width="${e.element.width}" stroke="${e.element.stroke}" stroke-width="${e.element.stroke_width}" stroke-dasharray="${e.element.stroke_dasharray}" rx="${e.element.rx}" ry="${e.element.ry}" />`}`;else if(e.element instanceof xi)t=`${e.element.stroke_dasharray==""?`<ellipse fill="${e.element.fill}" fill-opacity="${e.element.fill_opacity}" cx="${e.element.cx}" cy="${e.element.cy}" rx="${e.element.rx}" ry="${e.element.ry}"/>`:`<ellipse fill="${e.element.fill}" fill-opacity="${e.element.fill_opacity}" cx="${e.element.cx}" cy="${e.element.cy}" rx="${e.element.rx}" ry="${e.element.ry}" stroke="${e.element.stroke}" stroke-width="${e.element.stroke_width}" stroke-dasharray="${e.element.stroke_dasharray}" />`}`;else if(e.element instanceof Pa){let o=e.element,r=o.arrow_start?' marker-start="url(#line-start)"':"",a=o.arrow_end?' marker-end="url(#line-end)"':"",c=o.control_offset?` data-control-offset="${o.control_offset.join(",")}"`:"";t=`<line stroke="${o.stroke}" stroke-width="${o.stroke_width}" x1="${o.x1}" x2="${o.x2}" y1="${o.y1}" y2="${o.y2}" stroke-dasharray="${o.stroke_dasharray??"none"}"${r}${a} data-drawing-type="${o.drawing_type??"straight"}" data-arrow-start="${o.arrow_start??!1}" data-arrow-end="${o.arrow_end??!1}"${c} />`}else if(e.element instanceof ua){let o=e.element,r=o.points.map(p=>[p.x,p.y]);t=`<path d="${Eu().curve(this.getCurveInterpolator(o.curve_type||"catmullrom"))(r)||""}" stroke="${o.stroke}" stroke-width="${o.stroke_width}" stroke-dasharray="${o.stroke_dasharray??"none"}" fill="none" data-curve-type="${o.curve_type??"catmullrom"}" data-arrow-start="${o.arrow_start}" data-arrow-end="${o.arrow_end}" />`}else if(e.element instanceof _s)t=`<text fill="${e.element.fill}" fill-opacity="1.0" font-family="${e.element.font_family}" font-size="${e.element.font_size}" font-weight="${e.element.font_weight}">${e.element.text}</text>`;else return"";return`<svg height="${e.element.height}" width="${e.element.width}">${t}</svg>`}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var up=(()=>{class n{get(e){return+e.value>=0?null:{negativeValue:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ng=(()=>{class n{get(e){return+e.value>-360&&+e.value<=360?null:{negativeValue:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Lv=(n,i)=>i.value;function Mbe(n,i){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Fill color"),l(),s(3,"input",4),g("input",function(o){k(e);let r=v();return T(r.onFillChange(o.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.fill)}}function kbe(n,i){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function Tbe(n,i){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Width"),l(),s(3,"input",12),g("input",function(o){k(e);let r=v();return T(r.onWidthChange(+o.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.width)}}function Ebe(n,i){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Height"),l(),s(3,"input",12),g("input",function(o){k(e);let r=v();return T(r.onHeightChange(+o.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.height)}}function Dbe(n,i){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Corner radius"),l(),s(3,"input",13),g("input",function(o){k(e);let r=v();return T(r.onRxChange(+o.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.rx)}}function Pbe(n,i){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function Ibe(n,i){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function Abe(n,i){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Curve type"),l(),s(3,"mat-select",6),g("selectionChange",function(o){k(e);let r=v();return T(r.onCurveTypeChange(o.value))}),Y(4,Pbe,2,2,"mat-option",7,Lv),l()(),s(6,"mat-form-field",3)(7,"mat-label"),d(8,"Arrow direction"),l(),s(9,"mat-select",6),g("selectionChange",function(o){k(e);let r=v();return T(r.onArrowDirectionChange(o.value))}),Y(10,Ibe,2,2,"mat-option",7,Lv),l()()}if(n&2){let e=v();m(3),C("value",e.element.curve_type),m(),Z(e.curveTypes),m(5),C("value",e.element.arrow_direction),m(),Z(e.arrowDirections)}}function Obe(n,i){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function Nbe(n,i){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function Fbe(n,i){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Arrow direction"),l(),s(3,"mat-select",6),g("selectionChange",function(o){k(e);let r=v();return T(r.onLineArrowDirectionChange(o.value))}),Y(4,Obe,2,2,"mat-option",7,Lv),l()(),s(6,"mat-form-field",3)(7,"mat-label"),d(8,"Drawing type"),l(),s(9,"mat-select",6),g("selectionChange",function(o){k(e);let r=v();return T(r.onLineDrawingTypeChange(o.value))}),Y(10,Nbe,2,2,"mat-option",7,Lv),l()()}if(n&2){let e=v();m(3),C("value",e.element.line_arrow_direction),m(),Z(e.arrowDirections),m(5),C("value",e.element.line_drawing_type),m(),Z(e.lineDrawingTypes)}}function Rbe(n,i){n&1&&(s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Rotation"),l(),R(3,"input",14),l())}var Aw=(()=>{class n{dialogRef=f(Ie);drawingToMapDrawingConverter=f(qm);mapDrawingToSvgConverter=f(vs);drawingService=f(Ri);drawingsDataSource=f(Ei);formBuilder=f(Vn);toasterService=f(te);nonNegativeValidator=f(up);rotationValidator=f(ng);qtDasharrayFixer=f(Yc);cd=f(Q);controller;project;drawing;element;formGroup;borderTypes=[{qt:"none",value:"none",name:"Solid"},{qt:"10, 2",value:"25, 25",name:"Dash"},{qt:"4, 2",value:"5, 25",name:"Dot"},{qt:"12, 3, 5, 3",value:"5, 25, 25",name:"Dash Dot"},{qt:"12, 3, 5, 3, 5, 3",value:"25, 25, 5, 25, 5",name:"Dash Dot Dot"},{qt:"",value:"",name:"No border"}];curveTypes=[{value:"catmullrom",name:"Catmull-Rom (Smooth)"},{value:"basis",name:"Basis (B-spline)"},{value:"monotone",name:"Monotone"}];arrowDirections=[{value:"none",name:"No Arrow"},{value:"end",name:"End Arrow"},{value:"start",name:"Start Arrow"},{value:"both",name:"Both Arrows"}];lineDrawingTypes=[{value:"straight",name:"Straight Line"},{value:"freeform",name:"Freeform (Control Point)"}];constructor(){this.formGroup=this.formBuilder.group({borderWidth:new Ye("",[Ue.required,this.nonNegativeValidator.get]),rotation:new Ye("",[Ue.required,this.rotationValidator.get])})}ngOnInit(){let e;this.element=new WA,this.drawing.element instanceof kr||this.drawing.element instanceof xi?(this.element.fill=this.drawing.element.fill,this.element.width=this.drawing.element.width,this.element.height=this.drawing.element.height,this.element.stroke=this.drawing.element.stroke,this.element.stroke_dasharray=this.drawing.element.stroke_dasharray==null&&this.drawing.element.stroke_width==null?"":this.drawing.element.stroke_dasharray??"none",this.element.stroke_width=this.drawing.element.stroke_width):this.drawing.element instanceof Pa?(this.element.stroke=this.drawing.element.stroke,this.element.stroke_dasharray=this.drawing.element.stroke_dasharray==null&&this.drawing.element.stroke_width==null?"":this.drawing.element.stroke_dasharray??"none",this.element.stroke_width=this.drawing.element.stroke_width,this.drawing.element.arrow_start&&this.drawing.element.arrow_end?this.element.line_arrow_direction="both":this.drawing.element.arrow_start?this.element.line_arrow_direction="start":this.drawing.element.arrow_end?this.element.line_arrow_direction="end":this.element.line_arrow_direction="none",this.element.line_drawing_type=this.drawing.element.drawing_type||"straight"):this.drawing.element instanceof ua&&(this.element.stroke=this.drawing.element.stroke,this.element.stroke_dasharray=this.drawing.element.stroke_dasharray==null&&this.drawing.element.stroke_width==null?"":this.drawing.element.stroke_dasharray??"none",this.element.stroke_width=this.drawing.element.stroke_width,this.element.curve_type=this.drawing.element.curve_type||"catmullrom",this.drawing.element.arrow_start&&this.drawing.element.arrow_end?this.element.arrow_direction="both":this.drawing.element.arrow_start?this.element.arrow_direction="start":this.drawing.element.arrow_end?this.element.arrow_direction="end":this.element.arrow_direction="none"),this.drawing.element instanceof kr&&(this.element.rx=this.drawing.element.rx,this.element.ry=this.drawing.element.ry),this.element.stroke_width===void 0&&(this.element.stroke_width=0),this.formGroup.controls.borderWidth.setValue(this.element.stroke_width),this.formGroup.controls.rotation.setValue(this.drawing.rotation)}onFillChange(e){this.element.fill=e,this.cd.markForCheck()}onStrokeChange(e){this.element.stroke=e,this.cd.markForCheck()}onStrokeDasharrayChange(e){this.element.stroke_dasharray=e,this.cd.markForCheck()}onWidthChange(e){this.element.width=e,this.cd.markForCheck()}onHeightChange(e){this.element.height=e,this.cd.markForCheck()}onRxChange(e){this.element.rx=e,this.cd.markForCheck()}onCurveTypeChange(e){this.element.curve_type=e,this.cd.markForCheck()}onArrowDirectionChange(e){this.element.arrow_direction=e,this.cd.markForCheck()}onLineArrowDirectionChange(e){this.element.line_arrow_direction=e,this.cd.markForCheck()}onLineDrawingTypeChange(e){this.element.line_drawing_type=e,this.cd.markForCheck()}onNoClick(){this.dialogRef.close()}onYesClick(){if(this.formGroup.valid){this.element.stroke_dasharray==""?this.element.stroke_width=0:this.element.stroke_width=this.formGroup.get("borderWidth").value===0?2:this.formGroup.get("borderWidth").value,this.drawing.rotation=this.formGroup.get("rotation").value,this.drawing.element instanceof kr||this.drawing.element instanceof xi?(this.drawing.element.fill=this.element.fill,this.drawing.element.width=this.element.width,this.drawing.element.height=this.element.height,this.drawing.element.stroke=this.element.stroke??"#000000",this.drawing.element.stroke_dasharray=this.element.stroke_dasharray,this.drawing.element.stroke_width=this.element.stroke_width):this.drawing.element instanceof Pa?(this.element.stroke_dasharray!=""?(this.drawing.element.stroke=this.element.stroke??"#000000",this.drawing.element.stroke_dasharray=this.element.stroke_dasharray===""?"none":this.element.stroke_dasharray,this.drawing.element.stroke_width=this.element.stroke_width===0?2:this.element.stroke_width):this.toasterService.warning("No border style line element not supported"),this.drawing.element.stroke=this.element.stroke,this.drawing.element.stroke_dasharray=this.element.stroke_dasharray,this.drawing.element.stroke_width=this.element.stroke_width===0?2:this.element.stroke_width,this.drawing.element.arrow_start=this.element.line_arrow_direction==="start"||this.element.line_arrow_direction==="both",this.drawing.element.arrow_end=this.element.line_arrow_direction==="end"||this.element.line_arrow_direction==="both",this.drawing.element.drawing_type=this.element.line_drawing_type||"straight",this.drawing.element.drawing_type==="freeform"&&!this.drawing.element.control_offset&&(this.drawing.element.control_offset=[0,0])):this.drawing.element instanceof ua&&(this.drawing.element.stroke=this.element.stroke??"#000000",this.drawing.element.stroke_dasharray=this.element.stroke_dasharray===""?"none":this.element.stroke_dasharray,this.drawing.element.stroke_width=this.element.stroke_width===0?2:this.element.stroke_width,this.drawing.element.curve_type=this.element.curve_type||"catmullrom",this.drawing.element.arrow_start=this.element.arrow_direction==="start"||this.element.arrow_direction==="both",this.drawing.element.arrow_end=this.element.arrow_direction==="end"||this.element.arrow_direction==="both"),this.drawing.element instanceof kr?(this.drawing.element.rx=this.element.rx,this.drawing.element.ry=this.element.rx):this.drawing.element instanceof xi&&(this.drawing.element.rx=this.element.width/2,this.drawing.element.ry=this.element.height/2);let e=this.drawingToMapDrawingConverter.convert(this.drawing);e.element=this.drawing.element,this.drawing.svg=this.mapDrawingToSvgConverter.convert(e),this.drawingService.update(this.controller,this.drawing).subscribe({next:t=>{this.drawingsDataSource.update(t),this.dialogRef.close()},error:t=>{let o=t.error?.message||t.message||"Failed to update drawing";this.toasterService.error(o),this.cd.markForCheck()}})}else this.toasterService.error("Entered data is incorrect")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-style-editor"]],decls:30,vars:10,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[3,"formGroup"],[1,"form-field"],["matInput","","type","color",3,"input","value"],["matInput","","formControlName","borderWidth","type","number","min","0","max","100"],[3,"selectionChange","value"],[3,"value"],[1,"form-field","full-width"],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["matInput","","min","0","type","number",3,"input","value"],["matInput","","type","number","min","0","max","100",3,"input","value"],["matInput","","formControlName","rotation","type","number"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Style editor"),l(),s(2,"div",1)(3,"form",2),A(4,Mbe,4,1,"mat-form-field",3),s(5,"mat-form-field",3)(6,"mat-label"),d(7,"Border color"),l(),s(8,"input",4),g("input",function(a){return o.onStrokeChange(a.target.value)}),l()(),s(9,"mat-form-field",3)(10,"mat-label"),d(11,"Border width"),l(),R(12,"input",5),l(),s(13,"mat-form-field",3)(14,"mat-label"),d(15,"Border style"),l(),s(16,"mat-select",6),g("selectionChange",function(a){return o.onStrokeDasharrayChange(a.value)}),Y(17,kbe,2,2,"mat-option",7,Lv),l()(),A(19,Tbe,4,1,"mat-form-field",3),A(20,Ebe,4,1,"mat-form-field",3),A(21,Dbe,4,1,"mat-form-field",8),A(22,Abe,12,2),A(23,Fbe,12,2),A(24,Rbe,4,0,"mat-form-field",8),l()(),s(25,"div",9)(26,"button",10),g("click",function(){return o.onNoClick()}),d(27,"Cancel"),l(),s(28,"button",11),g("click",function(){return o.onYesClick()}),d(29,"Apply"),l()()),t&2&&(m(3),C("formGroup",o.formGroup),m(),O(o.element.fill!==void 0?4:-1),m(4),C("value",o.element.stroke),m(8),C("value",o.element.stroke_dasharray),m(),Z(o.borderTypes),m(2),O(o.element.width!==void 0?19:-1),m(),O(o.element.height!==void 0?20:-1),m(),O(o.element.rx!==void 0?21:-1),m(),O(o.element.curve_type!==void 0?22:-1),m(),O(o.element.line_arrow_direction!==void 0?23:-1),m(),O(o.element.line_drawing_type===void 0||o.element.line_drawing_type==="straight"?24:-1))},dependencies:[ne,Dt,at,Ft,_r,Pt,rt,dc,Xu,Rt,zt,_e,Ne,Fe,we,Me,et,Se,Ee,vt,At,_t,Fo,W,pe],styles:[".item[_ngcontent-%COMP%]{height:16px;font-size:12px;margin-bottom:8px}.item-name[_ngcontent-%COMP%]{margin-bottom:8px}.item-value[_ngcontent-%COMP%]{width:100%;margin-bottom:8px}.input-color[_ngcontent-%COMP%]{padding:0;border-width:0px;width:100%;background-color:transparent;outline:none}input[_ngcontent-%COMP%]:focus{outline:none}input[type=color][_ngcontent-%COMP%]{-webkit-appearance:none;border:none;height:16px}input[type=color][_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}input[type=color][_ngcontent-%COMP%]::-webkit-color-swatch{border:none}.modal-form-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px;padding:16px;max-width:600px}.modal-form-container[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:contents}.form-field[_ngcontent-%COMP%]{width:100%}.form-field.full-width[_ngcontent-%COMP%]{grid-column:1/-1}@media(max-width:500px){.modal-form-container[_ngcontent-%COMP%]{grid-template-columns:1fr}}"],changeDetection:0})}return n})(),WA=class{fill;width;height;stroke;stroke_width;stroke_dasharray;rx;ry;curve_type;arrow_direction;line_arrow_direction;line_drawing_type};function Lbe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.editStyle())}),s(1,"mat-icon"),d(2,"style"),l(),s(3,"span"),d(4,"Edit style"),l()()}}var Ow=(()=>{class n{dialog=f(nt);controller=le(void 0);project=le(void 0);drawing=le(void 0);isImageDrawing=!1;constructor(){}ngOnChanges(){let e=this.drawing();this.isImageDrawing=e?.element instanceof Kc}editStyle(){let t=this.dialog.open(Aw,{panelClass:["base-dialog-panel","simple-dialog-panel","edit-style-action-dialog-panel"],autoFocus:!1,disableClose:!1}).componentInstance;t.controller=this.controller(),t.project=this.project(),t.drawing=this.drawing()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-edit-style-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],drawing:[1,"drawing"]},features:[bn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&A(0,Lbe,5,0,"button",0),t&2&&O(!o.isImageDrawing&&o.drawing()?0:-1)},dependencies:[_e,Ge,Ze,ie,de],encapsulation:2,changeDetection:0})}return n})();var Vbe=["textArea"],Nw=(()=>{class n{textArea=Nt("textArea");dialogRef=f(Ie);drawingToMapDrawingConverter=f(qm);mapDrawingToSvgConverter=f(vs);drawingService=f(Ri);drawingsDataSource=f(Ei);renderer=f(Si);nodeService=f(ut);nodesDataSource=f(di);linkService=f(Fi);linksDataSource=f(zo);formBuilder=f(Vn);toasterService=f(te);rotationValidator=f(ng);fontFixer=f(ta);cdr=f(Q);controller;project;drawing;node;label;link;linkNode;element;rotation;isTextEditable;formGroup;constructor(){}ngOnInit(){this.formGroup=this.formBuilder.group({rotation:new Ye("",[Ue.required,this.rotationValidator.get])}),this.label&&this.node?(this.isTextEditable=!1,this.rotation=this.label.rotation.toString(),this.element=this.getTextElementFromLabel()):this.linkNode&&this.link?(this.isTextEditable=!0,this.label=this.link.nodes.find(o=>o.node_id===this.linkNode.node_id).label,this.rotation=this.label.rotation.toString(),this.element=this.getTextElementFromLabel()):this.drawing&&(this.isTextEditable=!0,this.rotation=this.drawing.rotation.toString(),this.element=this.drawing.element);let e={font_family:this.element.font_family,font_size:this.element.font_size,font_weight:this.element.font_weight};e=this.fontFixer.fix(e),this.formGroup.controls.rotation.setValue(this.rotation);let t=this.textArea();this.renderer.setStyle(t.nativeElement,"color",this.element.fill),this.renderer.setStyle(t.nativeElement,"font-family",e.font_family),this.renderer.setStyle(t.nativeElement,"font-size",`${e.font_size}pt`),this.renderer.setStyle(t.nativeElement,"font-weight",e.font_weight)}getTextElementFromLabel(){var e=[],t=new _s;for(var o of this.label.style.split(";"))e.push({property:o.split(": ")[0],value:o.split(": ")[1]});return t.text=this.label.text?this.label.text:"",t.font_family=e.find(r=>r.property==="font-family")?e.find(r=>r.property==="font-family").value:"TypeWriter",t.font_size=e.find(r=>r.property==="font-size")?+e.find(r=>r.property==="font-size").value:10,t.font_weight=e.find(r=>r.property==="font-weight")?e.find(r=>r.property==="font-weight").value:"normal",t.fill=e.find(r=>r.property==="fill")?e.find(r=>r.property==="fill").value:"#000000",t.fill_opacity=e.find(r=>r.property==="fill-opacity")?+e.find(r=>r.property==="fill-opacity").value:1,t}getStyleFromTextElement(){return`font-family: ${this.element.font_family};font-size: ${this.element.font_size};font-weight: ${this.element.font_weight};fill: ${this.element.fill};fill-opacity: ${this.element.fill_opacity};`}onNoClick(){this.dialogRef.close()}onYesClick(){if(this.formGroup.valid){if(this.rotation=this.formGroup.get("rotation").value,this.label&&this.node)this.node.label.style=this.getStyleFromTextElement(),this.node.label.rotation=+this.rotation,this.nodeService.updateLabel(this.controller,this.node,this.node.label).subscribe({next:e=>{this.nodesDataSource.update(e),this.dialogRef.close(),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to update node label";this.toasterService.error(t),this.cdr.markForCheck()}});else if(this.linkNode&&this.link)this.label.style=this.getStyleFromTextElement(),this.label.rotation=+this.rotation,this.label.text=this.element.text,this.linkService.updateLink(this.controller,this.link).subscribe({next:e=>{this.linksDataSource.update(e),this.dialogRef.close(),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to update link";this.toasterService.error(t),this.cdr.markForCheck()}});else if(this.drawing){this.drawing.rotation=+this.rotation,this.drawing.element=this.element;let e=this.drawingToMapDrawingConverter.convert(this.drawing);e.element=this.drawing.element,this.drawing.svg=this.mapDrawingToSvgConverter.convert(e),this.drawingService.update(this.controller,this.drawing).subscribe({next:t=>{this.drawingsDataSource.update(t),this.dialogRef.close(),this.cdr.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to update drawing";this.toasterService.error(o),this.cdr.markForCheck()}})}}else this.toasterService.error("Entered data is incorrect")}changeTextColor(e){this.element.fill=e,this.renderer.setStyle(this.textArea().nativeElement,"color",e),this.cdr.markForCheck()}changeFontFamily(e){this.element.font_family=e.value,this.renderer.setStyle(this.textArea().nativeElement,"font-family",e.value),this.cdr.markForCheck()}changeFontSize(e){let t=parseFloat(e);!isNaN(t)&&t>0&&(this.element.font_size=t,this.renderer.setStyle(this.textArea().nativeElement,"font-size",`${t}pt`),this.cdr.markForCheck())}changeFontWeight(e){this.element.font_weight=e.value,this.renderer.setStyle(this.textArea().nativeElement,"font-weight",e.value),this.cdr.markForCheck()}changeTextDecoration(e){this.element.text_decoration=e.value,this.renderer.setStyle(this.textArea().nativeElement,"text-decoration",e.value),this.cdr.markForCheck()}onTextChange(e){this.element.text=e,this.cdr.markForCheck()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-text-editor"]],viewQuery:function(t,o){t&1&&Xt(o.textArea,Vbe,5),t&2&&Kt()},decls:87,vars:8,consts:[["textArea",""],["mat-dialog-title",""],["mat-dialog-content",""],[1,"text-editor-grid"],["matInput","","type","color",3,"input","value"],[3,"valueChange","selectionChange","value"],["value","TypeWriter"],["value","Arial"],["value","Courier New"],["value","Times New Roman"],["value","Helvetica"],["value","Verdana"],["value","Georgia"],["value","Comic Sans MS"],["matInput","","type","number","min","1","max","200","step","0.5",3,"input","value"],["value","normal"],["value","bold"],["value","lighter"],["value","bolder"],["value","100"],["value","200"],["value","300"],["value","400"],["value","500"],["value","600"],["value","700"],["value","800"],["value","900"],["value","none"],["value","underline"],["value","line-through"],["value","overline"],[3,"formGroup"],["formControlName","rotation","matInput","","type","text"],[1,"text-editor-textarea"],["id","textArea",1,"text",3,"input","value","readonly"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){if(t&1){let r=z();s(0,"h1",1),d(1,"Text editor"),l(),s(2,"div",2)(3,"div",3)(4,"mat-form-field")(5,"mat-label"),d(6,"Fill color"),l(),s(7,"input",4),g("input",function(c){return o.changeTextColor(c.target.value)}),l()(),s(8,"mat-form-field")(9,"mat-label"),d(10,"Font family"),l(),s(11,"mat-select",5),ac("valueChange",function(c){return k(r),rc(o.element.font_family,c)||(o.element.font_family=c),T(c)}),g("selectionChange",function(c){return o.changeFontFamily(c)}),s(12,"mat-option",6),d(13,"TypeWriter"),l(),s(14,"mat-option",7),d(15,"Arial"),l(),s(16,"mat-option",8),d(17,"Courier New"),l(),s(18,"mat-option",9),d(19,"Times New Roman"),l(),s(20,"mat-option",10),d(21,"Helvetica"),l(),s(22,"mat-option",11),d(23,"Verdana"),l(),s(24,"mat-option",12),d(25,"Georgia"),l(),s(26,"mat-option",13),d(27,"Comic Sans MS"),l()()(),s(28,"mat-form-field")(29,"mat-label"),d(30,"Font size"),l(),s(31,"input",14),g("input",function(c){return o.changeFontSize(c.target.value)}),l()(),s(32,"mat-form-field")(33,"mat-label"),d(34,"Font weight"),l(),s(35,"mat-select",5),ac("valueChange",function(c){return k(r),rc(o.element.font_weight,c)||(o.element.font_weight=c),T(c)}),g("selectionChange",function(c){return o.changeFontWeight(c)}),s(36,"mat-option",15),d(37,"Normal"),l(),s(38,"mat-option",16),d(39,"Bold"),l(),s(40,"mat-option",17),d(41,"Lighter"),l(),s(42,"mat-option",18),d(43,"Bolder"),l(),s(44,"mat-option",19),d(45,"100 (Thin)"),l(),s(46,"mat-option",20),d(47,"200 (Extra Light)"),l(),s(48,"mat-option",21),d(49,"300 (Light)"),l(),s(50,"mat-option",22),d(51,"400 (Normal)"),l(),s(52,"mat-option",23),d(53,"500 (Medium)"),l(),s(54,"mat-option",24),d(55,"600 (Semi Bold)"),l(),s(56,"mat-option",25),d(57,"700 (Bold)"),l(),s(58,"mat-option",26),d(59,"800 (Extra Bold)"),l(),s(60,"mat-option",27),d(61,"900 (Black)"),l()()(),s(62,"mat-form-field")(63,"mat-label"),d(64,"Text decoration"),l(),s(65,"mat-select",5),ac("valueChange",function(c){return k(r),rc(o.element.text_decoration,c)||(o.element.text_decoration=c),T(c)}),g("selectionChange",function(c){return o.changeTextDecoration(c)}),s(66,"mat-option",28),d(67,"None"),l(),s(68,"mat-option",29),d(69,"Underline"),l(),s(70,"mat-option",30),d(71,"Line Through"),l(),s(72,"mat-option",31),d(73,"Overline"),l()()(),s(74,"form",32)(75,"mat-form-field")(76,"mat-label"),d(77,"Rotation"),l(),R(78,"input",33),l()(),s(79,"div",34)(80,"textarea",35,0),g("input",function(c){return o.onTextChange(c.target.value)}),l()()()(),s(82,"div",36)(83,"button",37),g("click",function(){return o.onNoClick()}),d(84,"Cancel"),l(),s(85,"button",38),g("click",function(){return o.onYesClick()}),d(86,"Apply"),l()()}t&2&&(m(7),C("value",o.element.fill),m(4),oc("value",o.element.font_family),m(20),C("value",o.element.font_size),m(4),oc("value",o.element.font_weight),m(30),oc("value",o.element.text_decoration),m(9),C("formGroup",o.formGroup),m(6),C("value",o.element.text)("readonly",!o.isTextEditable))},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,_e,Ne,Fe,bt,we,Me,et,Se,Ee,W,pe,vt,At,_t,Fo],styles:[".text[_ngcontent-%COMP%]{width:100%;min-height:100px;height:auto;font-family:inherit;resize:vertical;line-height:1.4}"],changeDetection:0})}return n})();var Fw=(()=>{class n{dialog=f(nt);controller=le(void 0);project=le(void 0);drawing=le(void 0);node=le(void 0);label=le(void 0);link=le(void 0);linkNode=le(void 0);editText(){let t=this.dialog.open(Nw,{panelClass:["base-dialog-panel","edit-text-action-dialog-panel"],autoFocus:!1,disableClose:!1}).componentInstance;t.controller=this.controller(),t.project=this.project(),t.drawing=this.drawing(),t.node=this.node(),t.label=this.label(),t.link=this.link(),t.linkNode=this.linkNode()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-edit-text-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],drawing:[1,"drawing"],node:[1,"node"],label:[1,"label"],link:[1,"link"],linkNode:[1,"linkNode"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.editText()}),s(1,"mat-icon"),d(2,"text_format"),l(),s(3,"span"),d(4,"Edit text"),l()())},dependencies:[_e,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function Bbe(n,i){if(n&1){let e=z();s(0,"div",2)(1,"textarea",6,0),g("input",function(o){k(e);let r=v();return T(r.onConfigChange(o.target.value))}),l()()}if(n&2){let e=v();m(),C("value",e.config())}}function zbe(n,i){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",7)(2,"textarea",8,0),g("input",function(o){k(e);let r=v();return T(r.onConfigChange(o.target.value))}),l()(),s(4,"mat-tab",9)(5,"textarea",8,0),g("input",function(o){k(e);let r=v();return T(r.onPrivateConfigChange(o.target.value))}),l()()()}if(n&2){let e=v();m(2),C("value",e.config()),m(3),C("value",e.privateConfig())}}var Rw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller;project;node;config=U("");privateConfig=U("");ngOnInit(){this.nodeService.getStartupConfiguration(this.controller,this.node).subscribe({next:e=>{this.config.set(e),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load startup configuration";this.toasterService.error(t),this.cdr.markForCheck()}}),(this.node.node_type==="iou"||this.node.node_type==="dynamips")&&this.nodeService.getPrivateConfiguration(this.controller,this.node).subscribe({next:e=>{this.privateConfig.set(e),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load private configuration";this.toasterService.error(t),this.cdr.markForCheck()}})}onConfigChange(e){this.config.set(e),this.cdr.markForCheck()}onPrivateConfigChange(e){this.privateConfig.set(e),this.cdr.markForCheck()}onSaveClick(){this.nodeService.saveConfiguration(this.controller,this.node,this.config()).subscribe({next:e=>{this.node.node_type==="iou"||this.node.node_type==="dynamips"?this.nodeService.savePrivateConfiguration(this.controller,this.node,this.privateConfig()).subscribe({next:t=>{this.dialogRef.close(),this.toasterService.success(`Configuration for node ${this.node.name} saved.`),this.cdr.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to save private configuration";this.toasterService.error(o),this.cdr.markForCheck()}}):(this.dialogRef.close(),this.toasterService.success(`Configuration for node ${this.node.name} saved.`),this.cdr.markForCheck())},error:e=>{let t=e.error?.message||e.message||"Failed to save configuration";this.toasterService.error(t),this.cdr.markForCheck()}})}onCancelClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-config-editor"]],inputs:{config:[1,"config"],privateConfig:[1,"privateConfig"]},outputs:{config:"configChange",privateConfig:"privateConfigChange"},decls:9,vars:3,consts:[["textArea",""],["mat-dialog-title",""],[1,"modal-form-container"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["id","textArea",1,"textArea",3,"input","value"],["label","Startup config"],["id","textArea",1,"textAreaTab",3,"input","value"],["label","Private config"]],template:function(t,o){t&1&&(s(0,"h1",1),d(1),l(),A(2,Bbe,3,1,"div",2),A(3,zbe,7,2,"mat-tab-group"),s(4,"div",3)(5,"button",4),g("click",function(){return o.onCancelClick()}),d(6,"Cancel"),l(),s(7,"button",5),g("click",function(){return o.onSaveClick()}),d(8,"Apply"),l()()),t&2&&(m(),ee("Configuration for node ",o.node.name),m(),O(o.node.node_type==="vpcs"?2:-1),m(),O(o.node.node_type==="iou"||o.node.node_type==="dynamips"?3:-1))},dependencies:[_e,Ne,Fe,W,pe,pn],styles:[".textArea[_ngcontent-%COMP%]{width:100%;height:350px}.textAreaTab[_ngcontent-%COMP%]{width:100%;height:300px}"],changeDetection:0})}return n})();function jbe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.editConfig())}),s(1,"mat-icon"),d(2,"settings"),l(),s(3,"span"),d(4,"Edit config"),l()()}}var Lw=(()=>{class n{dialog=f(nt);controller=le(void 0);project=le(void 0);node=le(void 0);editConfig(){let t=this.dialog.open(Rw,{panelClass:["base-dialog-panel","edit-config-action-dialog-panel"],autoFocus:!1,disableClose:!1}).componentInstance;t.controller=this.controller(),t.project=this.project(),t.node=this.node()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-edit-config-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],node:[1,"node"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,jbe,5,0,"button",0),t&2){let r;O(((r=o.node())==null?null:r.node_type)==="vpcs"||((r=o.node())==null?null:r.node_type)==="iou"||((r=o.node())==null?null:r.node_type)==="dynamips"?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var ig=(()=>{class n{dialogRef=f(Ie);close(e){this.dialogRef.close(e)}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-config-dialog"]],decls:11,vars:0,consts:[["mat-dialog-title",""],["mat-dialog-content",""],[1,"config-options"],["mat-raised-button","","color","primary",3,"click"],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Choose configuration file"),l(),s(2,"div",1)(3,"div",2)(4,"button",3),g("click",function(){return o.close("startup-config")}),d(5,"Startup configuration"),l(),s(6,"button",3),g("click",function(){return o.close("private-config")}),d(7,"Private configuration"),l()()(),s(8,"div",4)(9,"button",5),g("click",function(){return o.onClose()}),d(10,"Cancel"),l()())},dependencies:[_e,Ne,Fe,bt,W,pe],styles:[".config-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding:8px 0}"],changeDetection:0})}return n})();function $be(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.exportConfig())}),s(1,"mat-icon"),d(2,"call_made"),l(),s(3,"span"),d(4,"Export config"),l()()}}var Vw=(()=>{class n{nodeService=f(ut);dialog=f(nt);toasterService=f(te);cdr=f(Q);controller=le(void 0);node=le(void 0);exportConfig(){let e=this.node();if(e.node_type==="vpcs")this.nodeService.getStartupConfiguration(this.controller(),e).subscribe({next:t=>{this.downloadByHtmlTag(t)},error:t=>{let o=t.error?.message||t.message||"Failed to export configuration";this.toasterService.error(o),this.cdr.markForCheck()}});else{let t=this.dialog.open(ig,{panelClass:["base-dialog-panel","export-config-action-dialog-panel"],autoFocus:!1,disableClose:!1}),o=t.componentInstance;t.afterClosed().subscribe({next:r=>{r==="startup-config"?this.nodeService.getStartupConfiguration(this.controller(),this.node()).subscribe({next:a=>{this.downloadByHtmlTag(a)},error:a=>{let c=a.error?.message||a.message||"Failed to export startup configuration";this.toasterService.error(c),this.cdr.markForCheck()}}):r==="private-config"&&this.nodeService.getPrivateConfiguration(this.controller(),this.node()).subscribe({next:a=>{this.downloadByHtmlTag(a)},error:a=>{let c=a.error?.message||a.message||"Failed to export private configuration";this.toasterService.error(c),this.cdr.markForCheck()}})},error:r=>{let a=r.error?.message||r.message||"Failed to get config type";this.toasterService.error(a),this.cdr.markForCheck()}})}}downloadByHtmlTag(e){let t=document.createElement("a");t.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(e)}`);let r=this.node();r.node_type==="vpcs"?t.setAttribute("download",`${r.name}_startup.vpc`):(r.node_type==="iou"||r.node_type==="dynamips")&&t.setAttribute("download",`${r.name}_startup.cfg`);var a=new MouseEvent("click");t.dispatchEvent(a)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-export-config-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,$be,5,0,"button",0),t&2){let r;O(((r=o.node())==null?null:r.node_type)==="vpcs"||((r=o.node())==null?null:r.node_type)==="dynamips"||((r=o.node())==null?null:r.node_type)==="iou"?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Hbe=["fileInput"],Bw=(()=>{class n{nodeService=f(ut);toasterService=f(te);dialog=f(nt);cdr=f(Q);controller=le(void 0);node=le(void 0);fileInput=Nt("fileInput");configType;triggerClick(){if(this.fileInput().nativeElement.value="",this.node().node_type!=="vpcs"){let e=this.dialog.open(ig,{panelClass:["base-dialog-panel","import-config-action-dialog-panel"],autoFocus:!1,disableClose:!1}),t=e.componentInstance;e.afterClosed().subscribe({next:o=>{this.configType=o,this.cdr.markForCheck(),this.fileInput().nativeElement.click()},error:o=>{let r=o.error?.message||o.message||"Failed to get config type";this.toasterService.error(r),this.cdr.markForCheck()}})}else this.configType="startup-config",this.fileInput().nativeElement.click()}importConfig(e){let t=e.target.files[0],o=new FileReader;o.onload=r=>{let a=o.result;typeof a!="string"&&(a=a.toString()),this.configType==="startup-config"?this.nodeService.saveConfiguration(this.controller(),this.node(),a).subscribe({next:()=>{this.toasterService.success(`Configuration for node ${this.node().name} imported.`),this.cdr.markForCheck()},error:c=>{this.toasterService.error(c.error?.message||c.message||"Failed to import startup configuration"),this.cdr.markForCheck()}}):this.configType==="private-config"?this.nodeService.savePrivateConfiguration(this.controller(),this.node(),a).subscribe({next:()=>{this.toasterService.success(`Configuration for node ${this.node().name} imported.`),this.cdr.markForCheck()},error:c=>{this.toasterService.error(c.error?.message||c.message||"Failed to import private configuration"),this.cdr.markForCheck()}}):this.toasterService.error("No configuration type selected")},o.readAsText(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-import-config-action"]],viewQuery:function(t,o){t&1&&Xt(o.fileInput,Hbe,5),t&2&&Kt()},inputs:{controller:[1,"controller"],node:[1,"node"]},decls:7,vars:0,consts:[["fileInput",""],["type","file","accept",".txt, .vpc, .cfg",1,"non-visible",3,"change"],["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"input",1,0),g("change",function(a){return o.importConfig(a)}),l(),s(2,"button",2),g("click",function(){return o.triggerClick()}),s(3,"mat-icon"),d(4,"call_received"),l(),s(5,"span"),d(6,"Import config"),l()())},dependencies:[W,ie,de,Ge,Ze],styles:[".non-visible[_ngcontent-%COMP%]{display:none}"],changeDetection:0})}return n})();var Ube=(n,i)=>i.key;function Gbe(n,i){n&1&&(s(0,"div")(1,"h6",3),d(2,"Computing Idle-PC values, please wait..."),l(),s(3,"div",4),R(4,"mat-spinner",5),l()())}function Wbe(n,i){if(n&1&&(s(0,"mat-option",9),d(1),l()),n&2){let e=i.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}function qbe(n,i){if(n&1){let e=z();s(0,"h1",6),d(1,"Choose an Idle-PC value"),l(),s(2,"mat-form-field",7)(3,"mat-select",8),g("selectionChange",function(o){k(e);let r=v();return T(r.idlePC.set(o.value))}),Y(4,Wbe,2,2,"mat-option",9,Ube),l()()}if(n&2){let e=v();m(3),C("value",e.idlePC())("matTooltip",e.getTooltip()),m(),Z(e.idlepcs)}}function Qbe(n,i){if(n&1){let e=z();s(0,"button",2),g("click",function(){k(e);let o=v();return T(o.onCompute())}),d(1,"Compute"),l()}}function Xbe(n,i){if(n&1){let e=z();s(0,"button",2),g("click",function(){k(e);let o=v();return T(o.onApply())}),d(1,"Apply"),l()}}var zw=(()=>{class n{nodeService=f(ut);dialogRef=f(Ie);toasterService=f(te);cd=f(Q);controller;node;idlepcs=[];idlePC=U("");isComputing=!1;ngOnInit(){this.onCompute()}getTooltip(){return`Best Idle-PC values are obtained when IOS is in idle state, after the 'Press RETURN to get started' message has appeared on the console, messages have finished displaying on the console and you have have actually pressed the RETURN key.
Finding the right idle-pc value is a trial and error process, consisting of applying different Idle-PC values and monitoring the CPU usage.
Select each value that appears in the list and click Apply, and note the CPU usage a few moments later. When you have found the value that minimises the CPU usage, apply that value.`}onCompute(){this.isComputing=!0,this.nodeService.getIdlePCProposals(this.controller,this.node).subscribe({next:e=>{let t=[];for(let o of e){let r=o.match(/^(0x[0-9a-f]{8})\s+\[(\d+)\]$/);if(r){let a=r[1],c=parseInt(r[2],10);50<=c&&c<=60&&(o+="*"),t.push({key:a,name:o})}}this.idlepcs=t,this.idlepcs.length>0&&this.idlePC.set(this.idlepcs[0].key),this.isComputing=!1,this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to compute idle-PC proposals";this.toasterService.error(t),this.isComputing=!1,this.cd.markForCheck()}})}onClose(){this.dialogRef.close()}onApply(){this.idlePC()&&this.idlePC()!=="0x0"&&(this.node.properties.idlepc=this.idlePC(),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated with idle-PC value ${this.idlePC()}`),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to update node with idle-PC value";this.toasterService.error(t),this.cd.markForCheck()}}))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-idle-pc-dialog"]],inputs:{controller:"controller",node:"node",idlePC:[1,"idlePC"]},outputs:{idlePC:"idlePCChange"},decls:7,vars:4,consts:[["mat-dialog-actions",""],["mat-button","","color","accent"],["mat-button","","color","accent",3,"click"],["align","center"],["mat-dialog-content","","align","center"],["color","accent"],["mat-dialog-title",""],[1,"form-field"],["placeholder","Idle-PC","matTooltipClass","multiline-tooltip",3,"selectionChange","value","matTooltip"],[3,"value"]],template:function(t,o){t&1&&(A(0,Gbe,5,0,"div"),A(1,qbe,6,2),s(2,"div",0),A(3,Qbe,2,0,"button",1),A(4,Xbe,2,0,"button",1),s(5,"button",2),g("click",function(){return o.onClose()}),d(6,"Close"),l()()),t&2&&(O(o.isComputing?0:-1),m(),O(o.isComputing?-1:1),m(2),O(o.isComputing?-1:3),m(),O(o.isComputing?-1:4))},dependencies:[_e,Ne,Fe,bt,W,pe,pn,li,Se,Me,io,vt,At,_t,Xe],styles:[".container[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between}.multiline-tooltip[_ngcontent-%COMP%]{background-color:var(--mat-app-surface);color:var(--mat-app-on-surface-color);white-space:pre-line}"],changeDetection:0})}return n})();function Kbe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.idlePC())}),s(1,"mat-icon"),d(2,"query_builder"),l(),s(3,"span"),d(4,"Idle-PC"),l()()}}var jw=(()=>{class n{nodeService=f(ut);dialog=f(nt);controller=le(void 0);node=le(void 0);idlePC(){let t=this.dialog.open(zw,{panelClass:["base-dialog-panel","idle-pc-action-dialog-panel"],autoFocus:!1,disableClose:!1}).componentInstance;t.controller=this.controller(),t.node=this.node()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-idle-pc-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,Kbe,5,0,"button",0),t&2){let r;O(((r=o.node())==null?null:r.node_type)==="dynamips"?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function Ybe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.autoIdlePC())}),s(1,"mat-icon"),d(2,"query_builder"),l(),s(3,"span"),d(4,"Auto Idle-PC"),l()()}}var $w=(()=>{class n{nodeService=f(ut);toasterService=f(te);progressService=f(no);cdr=f(Q);controller=le(void 0);node=le(void 0);autoIdlePC(){this.progressService.activate(),this.nodeService.getAutoIdlePC(this.controller(),this.node()).subscribe({next:e=>{this.progressService.deactivate(),e.idlepc!==null&&this.toasterService.success(`Node ${this.node().name} updated with idle-PC value ${e.idlepc}`),this.cdr.markForCheck()},error:e=>{this.progressService.deactivate();let t=e.error?.message||e.message||"Failed to update idle-PC value";this.toasterService.error(t),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-auto-idle-pc-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,Ybe,5,0,"button",0),t&2){let r;O(((r=o.node())==null?null:r.node_type)==="dynamips"?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Hw=(()=>{class n{nodesDataSource=f(di);drawingsDataSource=f(Ei);nodeService=f(ut);drawingService=f(Ri);toasterService=f(te);cdr=f(Q);controller=le(void 0);nodes=le(void 0);drawings=le(void 0);moveLayerUp(){this.nodes().forEach(e=>{e.z++,this.nodesDataSource.update(e),this.nodeService.update(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to move layer up";this.toasterService.error(o),this.cdr.markForCheck()}})}),this.drawings().forEach(e=>{e.z++,this.drawingsDataSource.update(e),this.drawingService.update(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to move layer up";this.toasterService.error(o),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-move-layer-up-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"],drawings:[1,"drawings"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.moveLayerUp()}),s(1,"mat-icon"),d(2,"keyboard_arrow_up"),l(),s(3,"span"),d(4,"Move layer up"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Uw=(()=>{class n{nodesDataSource=f(di);drawingsDataSource=f(Ei);nodeService=f(ut);drawingService=f(Ri);toasterService=f(te);cdr=f(Q);controller=le(void 0);nodes=le(void 0);drawings=le(void 0);moveLayerDown(){this.nodes().forEach(e=>{e.z--,this.nodesDataSource.update(e),this.nodeService.update(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to move layer down";this.toasterService.error(o),this.cdr.markForCheck()}})}),this.drawings().forEach(e=>{e.z--,this.drawingsDataSource.update(e),this.drawingService.update(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to move layer down";this.toasterService.error(o),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-move-layer-down-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"],drawings:[1,"drawings"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.moveLayerDown()}),s(1,"mat-icon"),d(2,"keyboard_arrow_down"),l(),s(3,"span"),d(4,"Move layer down"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Gw=(()=>{class n{nodesDataSource=f(di);drawingsDataSource=f(Ei);nodeService=f(ut);drawingService=f(Ri);toasterService=f(te);cdr=f(Q);controller=le(void 0);nodes=le([]);drawings=le([]);bringToFront(){let e=Math.max(...this.nodes().map(r=>r.z)),t=Math.max(...this.drawings().map(r=>r.z)),o=Math.max(e,t);o<100&&o++,this.nodes().forEach(r=>{r.z=o,this.nodesDataSource.update(r),this.nodeService.update(this.controller(),r).subscribe({next:()=>{this.cdr.markForCheck()},error:a=>{let c=a.error?.message||a.message||"Failed to bring node to front";this.toasterService.error(c),this.cdr.markForCheck()}})}),this.drawings().forEach(r=>{r.z=o,this.drawingsDataSource.update(r),this.drawingService.update(this.controller(),r).subscribe({next:()=>{this.cdr.markForCheck()},error:a=>{let c=a.error?.message||a.message||"Failed to bring drawing to front";this.toasterService.error(c),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-bring-to-front-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"],drawings:[1,"drawings"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.bringToFront()}),s(1,"mat-icon"),d(2,"vertical_align_top"),l(),s(3,"span"),d(4,"Bring to front"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var og=(()=>{class n{protocolHandlerService;constructor(e){this.protocolHandlerService=e}startCapture(e,t,o,r){let a=`gns3+pcap://${e.host}:${e.port}?protocol=${e.protocol.slice(0,-1)}&project_id=${t.project_id}&link_id=${o.link_id}&project=${t.name}&name=${r}`;this.protocolHandlerService.open(a)}static \u0275fac=function(t){return new(t||n)(ge(pp))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Zbe=(n,i)=>i[1];function Jbe(n,i){if(n&1&&(s(0,"h1",0),d(1,"Starting Web Wireshark"),l(),s(2,"div",1),R(3,"mat-spinner",2),s(4,"p",3),d(5),l()(),s(6,"div",4)(7,"button",5),d(8,"Cancel"),l(),s(9,"button",6),d(10,"Starting..."),l()()),n&2){let e=v();m(5),j(e.loadingMessage())}}function exe(n,i){if(n&1&&(s(0,"div",7)(1,"p"),d(2),l()()),n&2){let e=v(2);m(2),j(e.errorMessage())}}function txe(n,i){if(n&1&&(s(0,"mat-option",12),d(1),l()),n&2){let e=i.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function nxe(n,i){if(n&1){let e=z();A(0,exe,3,1,"div",7),s(1,"h1",0),d(2,"Packet capture"),l(),s(3,"div",8)(4,"form",9)(5,"mat-form-field",10)(6,"mat-label"),d(7,"Link type"),l(),s(8,"mat-select",11),Y(9,txe,2,2,"mat-option",12,Zbe),l()(),s(11,"mat-form-field",10)(12,"mat-label"),d(13,"Capture file name"),l(),R(14,"input",13),l(),s(15,"mat-checkbox",14),g("change",function(o){k(e);let r=v();return T(r.startProgram.set(o.checked))}),d(16," Start the capture visualization program "),l(),s(17,"mat-checkbox",14),g("change",function(o){k(e);let r=v();return T(r.webWireshark.set(o.checked))}),d(18," Web Wireshark "),l()()(),s(19,"div",4)(20,"button",15),g("click",function(){k(e);let o=v();return T(o.onNoClick())}),d(21,"Cancel"),l(),s(22,"button",16),g("click",function(){k(e);let o=v();return T(o.onYesClick())}),d(23,"Ok"),l()()}if(n&2){let e=v();O(e.errorMessage()?0:-1),m(4),C("formGroup",e.inputForm),m(5),Z(e.linkTypes),m(6),C("checked",e.startProgram()),m(2),C("checked",e.webWireshark())}}var Ww=(()=>{class n{controller;project;link;linkTypes=[];inputForm;startProgram=U(!1);webWireshark=U(!1);isLoading=ae(!1);loadingMessage=ae("");errorMessage=ae("");dialogRef=f(Ie);linkService=f(Fi);formBuilder=f(Vn);toasterService=f(te);nodesDataSource=f(di);linksDataSource=f(zo);packetCaptureService=f(og);constructor(){this.inputForm=this.formBuilder.group({linkType:new Ye("",Ue.required),fileName:new Ye("",Ue.required)})}ngOnInit(){this.link.link_type==="ethernet"?this.linkTypes=[["Ethernet","DLT_EN10MB"]]:this.linkTypes=[["Cisco HDLC","DLT_C_HDLC"],["Cisco PPP","DLT_PPP_SERIAL"],["Frame Relay","DLT_FRELAY"],["ATM","DLT_ATM_RFC1483"]],this.linkTypes.length>0&&this.inputForm.controls.linkType.setValue(this.linkTypes[0][1]);let e=this.nodesDataSource.get(this.link.nodes[0].node_id),t=this.nodesDataSource.get(this.link.nodes[1].node_id),o=this.link.nodes[0].label.text,r=this.link.nodes[1].label.text,a=`${e.name}_${o}_to_${t.name}_${r}`.replace(/\s+/g,"_").replace(/[/\\]/g,"-").replace(/[^0-9A-Za-z_-]/g,"");this.inputForm.controls.fileName.setValue(a)}onYesClick(){this.errorMessage.set("");let e=!1;if(this.link.nodes.forEach(o=>{this.nodesDataSource.get(o.node_id).status==="started"&&(e=!0)}),!e){this.toasterService.error("Cannot capture because there is no running device on this link");return}if(this.inputForm.invalid){this.toasterService.error("Fill all required fields");return}let t={capture_file_name:this.inputForm.get("fileName").value,data_link_type:this.inputForm.get("linkType").value,wireshark:this.webWireshark()};this.webWireshark()?(this.isLoading.set(!0),this.loadingMessage.set("Starting Web Wireshark, please wait..."),this.linkService.startCaptureOnLink(this.controller,this.link,t).subscribe({next:o=>{this.linksDataSource.update(o),this.startProgram()&&this.packetCaptureService.startCapture(this.controller,this.project,this.link,t.capture_file_name),this.isLoading.set(!1),this.dialogRef.close()},error:o=>{if(this.isLoading.set(!1),o.status===409){let r=o.error?.message||o.error?.detail||o.message;this.errorMessage.set(r||"A packet capture is already running on this link. Please stop the existing capture first.")}else o.status===404?this.errorMessage.set("The link or controller could not be found. Please refresh the page and try again."):o.status===403?this.errorMessage.set("You do not have permission to start packet capture on this link."):this.errorMessage.set(`Failed to start Web Wireshark: ${o.message||"Unknown error"}`)}})):(this.startProgram()&&this.packetCaptureService.startCapture(this.controller,this.project,this.link,t.capture_file_name),this.linkService.startCaptureOnLink(this.controller,this.link,t).subscribe({next:o=>{this.linksDataSource.update(o),this.dialogRef.close()},error:o=>{let r=o.error?.message||o.message||"Failed to start capture";this.errorMessage.set(r)}}))}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-start-capture"]],inputs:{startProgram:[1,"startProgram"],webWireshark:[1,"webWireshark"]},outputs:{startProgram:"startProgramChange",webWireshark:"webWiresharkChange"},decls:2,vars:1,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"loading-content"],["color","accent"],[1,"loading-message"],["mat-dialog-actions",""],["mat-button","","disabled","","color","accent"],["mat-button","","disabled","","mat-raised-button","","color","primary"],[1,"error-message"],[1,"modal-form-container"],[3,"formGroup"],[1,"input-field"],["formControlName","linkType","ngDefaultControl",""],[3,"value"],["matInput","","formControlName","fileName","type","text"],[3,"change","checked"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&A(0,Jbe,11,1)(1,nxe,24,4),t&2&&O(o.isLoading()?0:1)},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,_e,Ne,Fe,bt,W,pe,we,Me,et,Se,Ee,vt,At,_t,Ot,Gt,pn,li],styles:[".input-field[_ngcontent-%COMP%]{width:100%}.nested-checkbox[_ngcontent-%COMP%]{margin-left:24px}.loading-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;gap:16px}.loading-content[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{width:40px;height:40px}.loading-content[_ngcontent-%COMP%] .loading-message[_ngcontent-%COMP%]{margin:0;text-align:center;color:var(--mat-sys-on-surface);font-size:14px}.error-message[_ngcontent-%COMP%]{padding:16px;margin-bottom:16px;background:var(--mat-sys-error-container);border-radius:4px}.error-message[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--mat-sys-on-error-container);font-size:14px}"],changeDetection:0})}return n})();function ixe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.startCapture())}),s(1,"mat-icon"),d(2,"loupe"),l(),s(3,"span"),d(4,"Start capture"),l()()}}var qw=(()=>{class n{dialog=f(nt);dialogConfig=f(fo);controller=le(void 0);project=le(void 0);link=le(void 0);startCapture(){let e=this.dialogConfig.openConfig("startCapture",{autoFocus:!1,disableClose:!1}),o=this.dialog.open(Ww,e).componentInstance;o.controller=this.controller(),o.project=this.project(),o.link=this.link()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-start-capture-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],link:[1,"link"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,ixe,5,0,"button",0),t&2){let r;O(((r=o.link())==null?null:r.capturing)===!1?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function oxe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.stopCapture())}),s(1,"mat-icon"),d(2,"pause_circle_filled"),l(),s(3,"span"),d(4,"Stop capture"),l()()}}var Qw=(()=>{class n{linkService=f(Fi);toasterService=f(te);cdr=f(Q);controller=le(void 0);link=le(void 0);stopCapture(){this.linkService.stopCaptureOnLink(this.controller(),this.link()).subscribe({next:()=>{},error:e=>{let t=e.error?.message||e.message||"Failed to stop capture";this.toasterService.error(t),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-stop-capture-action"]],inputs:{controller:[1,"controller"],link:[1,"link"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,oxe,5,0,"button",0),t&2){let r;O((r=o.link())!=null&&r.capturing?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function rxe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.startCapture())}),s(1,"mat-icon"),d(2,"search"),l(),s(3,"span"),d(4,"Start Wireshark"),l()()}}var Xw=(()=>{class n{packetCaptureService=f(og);controller=le(void 0);project=le(void 0);link=le(void 0);startCapture(){var e=this.link().capture_file_name.split(".");this.packetCaptureService.startCapture(this.controller(),this.project(),this.link(),e[0])}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-start-capture-on-started-link-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],link:[1,"link"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,rxe,5,0,"button",0),t&2){let r;O((r=o.link())!=null&&r.capturing?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var rg=(()=>{class n{toasterService;constructor(e){this.toasterService=e}parseWebSocketUrl(e){try{let t=new URL(e),o=t.protocol==="wss:",r=t.hostname,a=t.port||(o?"443":"80"),c=t.pathname,p=t.searchParams.get("token")||void 0;return{server:r,port:a,ssl:o,path:c,token:p}}catch(t){throw this.toasterService.error(`Invalid WebSocket URL: ${t.message}`),t}}buildXpraWebSocketUrl(e,t){return`${e.protocol==="https:"?"wss":"ws"}://${e.host}:${e.port}/v3/projects/${t.project_id}/nodes/${t.node_id}/console/xpra?token=${e.authToken}`}buildXpraConsolePageUrl(e){let{server:t,port:o,ssl:r}=this.parseWebSocketUrl(e),a=new URLSearchParams;a.set("server",t),a.set("port",o),a.set("ssl",r?"true":"false");let c=new URL(e),p=c.pathname+c.search;return a.set("path",p),a.set("sound","true"),a.set("clipboard","true"),a.set("encoding","h264"),`assets/xpra-html5/index.html?${a.toString()}`}buildXpraConsolePageUrlFromNode(e,t){let o=this.buildXpraWebSocketUrl(e,t);return this.buildXpraConsolePageUrl(o)}buildXpraWebSocketUrlForWebWireshark(e,t){return`${e.protocol==="https:"?"wss":"ws"}://${e.host}:${e.port}/v3/projects/${t.project_id}/links/${t.link_id}/capture/web-wireshark?token=${e.authToken}`}openXpraConsole(e,t,o=!1){if(t.status!=="started"){this.toasterService.error("Node must be started before opening console");return}try{let r=this.buildXpraConsolePageUrlFromNode(e,t),a=10,c=1280+a,p=720+a,u;if(o)u=window.open(r,"_blank");else{let h=`Xpra-${t.name}`;u=window.open(r,h,`width=${c},height=${p}`)}(!u||u.closed||typeof u.closed>"u")&&this.toasterService.error("Popup was blocked. Please allow popups for this site.")}catch(r){this.toasterService.error(`Failed to open Xpra console: ${r.message}`)}}static \u0275fac=function(t){return new(t||n)(ge(te))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function axe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.startWebWireshark())}),s(1,"mat-icon"),d(2,"analytics"),l(),s(3,"span"),d(4,"Start Web Wireshark"),l()()}}var i9=(()=>{class n{xpraConsoleService=f(rg);toasterService=f(te);controller=le(void 0);project=le(void 0);link=le(void 0);startWebWireshark(){let e=this.controller(),t=this.project(),o=this.link();if(!e||!t||!o){this.toasterService.error("Missing controller, project or link");return}let r=this.xpraConsoleService.buildXpraWebSocketUrlForWebWireshark(e,o),a=this.xpraConsoleService.buildXpraConsolePageUrl(r),c=window.open(a,"_blank");(!c||c.closed||typeof c.closed>"u")&&this.toasterService.error("Popup was blocked. Please allow popups for this site.")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-start-web-wireshark-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],link:[1,"link"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,axe,5,0,"button",0),t&2){let r;O((r=o.link())!=null&&r.capturing&&((r=o.link())!=null&&r.wireshark)?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function sxe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.onOpenWebWiresharkInline())}),s(1,"mat-icon"),d(2,"open_in_full"),l(),s(3,"span"),d(4,"Open Web Wireshark (Inline)"),l()()}}var o9=(()=>{class n{controller=le(void 0);project=le(void 0);link=le(void 0);openWebWiresharkInline=new ve;onOpenWebWiresharkInline(){let e=this.controller(),t=this.project(),o=this.link();!e||!t||!o||this.openWebWiresharkInline.emit({link:o,controller:e,project:t})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-start-web-wireshark-inline-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],link:[1,"link"]},outputs:{openWebWiresharkInline:"openWebWiresharkInline"},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,sxe,5,0,"button",0),t&2){let r;O((r=o.link())!=null&&r.capturing&&((r=o.link())!=null&&r.wireshark)?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function lxe(n,i){if(n&1&&(s(0,"div",2)(1,"h6"),d(2),l(),s(3,"span",5),d(4),l()()),n&2){let e=i.$implicit;m(2),ee(" ",e.name," "),m(2),ee(" ",e.description," ")}}var Kw=(()=>{class n{dialogRef=f(Ie);title;messages;onCloseClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-help-dialog"]],inputs:{title:"title",messages:"messages"},decls:8,vars:1,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[1,"message"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],[1,"description"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1),Y(3,lxe,5,2,"div",2,Hi),l(),s(5,"div",3)(6,"button",4),g("click",function(){return o.onCloseClick()}),d(7,"Close"),l()()),t&2&&(m(),j(o.title),m(2),Z(o.messages))},dependencies:[_e,Ne,Fe,W,pe,ie],styles:[".message[_ngcontent-%COMP%]{margin-bottom:8px}.description[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);opacity:.7}"],changeDetection:0})}return n})();function cxe(n,i){if(n&1){let e=z();s(0,"div",1)(1,"div",5)(2,"div",6)(3,"mat-form-field",7)(4,"mat-label"),d(5,"Frequency drop"),l(),s(6,"input",8),g("input",function(o){k(e);let r=v();return T(r.onFrequencyDropChange(+o.target.value))}),l(),s(7,"span",9),d(8,"packets"),l()(),s(9,"mat-form-field",7)(10,"mat-label"),d(11,"Packet loss"),l(),s(12,"input",8),g("input",function(o){k(e);let r=v();return T(r.onPacketLossChange(+o.target.value))}),l(),s(13,"span",9),d(14,"%"),l()(),s(15,"mat-form-field",7)(16,"mat-label"),d(17,"Corrupt"),l(),s(18,"input",8),g("input",function(o){k(e);let r=v();return T(r.onCorruptChange(+o.target.value))}),l(),s(19,"span",9),d(20,"%"),l()()(),s(21,"div",6)(22,"mat-form-field",7)(23,"mat-label"),d(24,"Delay latency"),l(),s(25,"input",8),g("input",function(o){k(e);let r=v();return T(r.onDelayLatencyChange(+o.target.value))}),l(),s(26,"span",9),d(27,"ms"),l()(),s(28,"mat-form-field",7)(29,"mat-label"),d(30,"Delay jitter"),l(),s(31,"input",8),g("input",function(o){k(e);let r=v();return T(r.onDelayJitterChange(+o.target.value))}),l(),s(32,"span",9),d(33,"ms"),l()()()(),s(34,"mat-form-field",7)(35,"mat-label"),d(36,"Berkeley Packet Filter (BPF)"),l(),s(37,"textarea",10),g("input",function(o){k(e);let r=v();return T(r.onBpfChange(o.target.value))}),l()()()}if(n&2){let e=v();m(6),C("value",e.filters.frequency_drop[0]),m(6),C("value",e.filters.packet_loss[0]),m(6),C("value",e.filters.corrupt[0]),m(7),C("value",e.filters.delay[0]),m(6),C("value",e.filters.delay[1]),m(6),C("value",e.filters.bpf[0])}}var Yw=(()=>{class n{dialogRef=f(Ie);linkService=f(Fi);dialog=f(nt);dialogConfig=f(fo);cdr=f(Q);toasterService=f(te);controller;project;link;filters;availableFilters;constructor(){}ngOnInit(){this.linkService.getLink(this.controller,this.link.project_id,this.link.link_id).subscribe({next:e=>{this.link=e,this.filters={bpf:[""],corrupt:[0],delay:[0,0],frequency_drop:[0],packet_loss:[0]},this.link.filters&&(this.filters.bpf=this.link.filters.bpf?this.link.filters.bpf:[""],this.filters.corrupt=this.link.filters.corrupt?this.link.filters.corrupt:[0],this.filters.delay=this.link.filters.delay?this.link.filters.delay:[0,0],this.filters.frequency_drop=this.link.filters.frequency_drop?this.link.filters.frequency_drop:[0],this.filters.packet_loss=this.link.filters.packet_loss?this.link.filters.packet_loss:[0]),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load link filters";this.toasterService.error(t),this.cdr.markForCheck()}}),this.linkService.getAvailableFilters(this.controller,this.link).subscribe({next:e=>{this.availableFilters=e,this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load available filters";this.toasterService.error(t),this.cdr.markForCheck()}})}onFrequencyDropChange(e){this.filters.frequency_drop[0]=e,this.cdr.markForCheck()}onPacketLossChange(e){this.filters.packet_loss[0]=e,this.cdr.markForCheck()}onDelayLatencyChange(e){this.filters.delay[0]=e,this.cdr.markForCheck()}onDelayJitterChange(e){this.filters.delay[1]=e,this.cdr.markForCheck()}onCorruptChange(e){this.filters.corrupt[0]=e,this.cdr.markForCheck()}onBpfChange(e){this.filters.bpf[0]=e,this.cdr.markForCheck()}onNoClick(){this.dialogRef.close()}onResetClick(){this.link.filters={bpf:[""],corrupt:[0],delay:[0,0],frequency_drop:[0],packet_loss:[0]},this.linkService.updateLink(this.controller,this.link).subscribe({next:e=>{this.dialogRef.close(),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to reset filters";this.toasterService.error(t),this.cdr.markForCheck()}})}onYesClick(){this.link.filters=this.filters,this.linkService.updateLink(this.controller,this.link).subscribe({next:e=>{this.dialogRef.close(),this.cdr.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to apply filters";this.toasterService.error(t),this.cdr.markForCheck()}})}onHelpClick(){let e=this.dialogConfig.openConfig("helpDialog",{autoFocus:!1,disableClose:!0}),o=this.dialog.open(Kw,e).componentInstance;o.title="Help for filters";let r=[];this.availableFilters.forEach(a=>{r.push({name:a.name,description:a.description})}),o.messages=r}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-packet-filters"]],decls:12,vars:1,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],[1,"form-grid"],[1,"form-grid-column"],["appearance","fill",1,"full-width-field"],["matInput","","type","number",3,"input","value"],["matSuffix",""],["matInput","","rows","4","placeholder",`Examples:
tcp port 80
host 192.168.1.1
tcp dst port 443 and src portrange 1024-65535`,3,"input","value"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Packet filters"),l(),A(2,cxe,38,6,"div",1),s(3,"div",2)(4,"button",3),g("click",function(){return o.onNoClick()}),d(5,"Cancel"),l(),s(6,"button",3),g("click",function(){return o.onResetClick()}),d(7,"Reset"),l(),s(8,"button",4),g("click",function(){return o.onYesClick()}),d(9,"Apply"),l(),s(10,"button",3),g("click",function(){return o.onHelpClick()}),d(11,"Help"),l()()),t&2&&(m(2),O(o.filters?2:-1))},dependencies:[ne,_e,Ne,Fe,bt,we,Me,et,Mi,Se,Ee,W,pe],styles:[".form-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px 16px;margin-bottom:16px}.form-grid-column[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{max-width:220px}mat-form-field[_ngcontent-%COMP%]{margin-bottom:12px}mat-form-field[_ngcontent-%COMP%]:last-child{margin-bottom:0}.full-width-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var Zw=(()=>{class n{dialog=f(nt);dialogConfig=f(fo);controller=le(void 0);project=le(void 0);link=le(void 0);openPacketFilters(){let e=this.dialogConfig.openConfig("packetFilters",{autoFocus:!1,disableClose:!1}),o=this.dialog.open(Yw,e).componentInstance;o.controller=this.controller(),o.project=this.project(),o.link=this.link()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-packet-filters-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],link:[1,"link"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.openPacketFilters()}),s(1,"mat-icon"),d(2,"filter_list"),l(),s(3,"span"),d(4,"Packet filters"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function dxe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.resumeLink())}),s(1,"mat-icon"),d(2,"play_arrow"),l(),s(3,"span"),d(4,"Resume"),l()()}}var Jw=(()=>{class n{linkService=f(Fi);toasterService=f(te);cdr=f(Q);controller=le(void 0);link=le(void 0);resumeLink(){let e=this.link();e.suspend=!1,this.linkService.updateLink(this.controller(),e).subscribe({next:()=>{},error:t=>{let o=t.error?.message||t.message||"Failed to resume link";this.toasterService.error(o),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-resume-link-action"]],inputs:{controller:[1,"controller"],link:[1,"link"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,dxe,5,0,"button",0),t&2){let r;O((r=o.link())!=null&&r.suspend?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function mxe(n,i){if(n&1){let e=z();s(0,"button",1),g("click",function(){k(e);let o=v();return T(o.suspendLink())}),s(1,"mat-icon"),d(2,"pause"),l(),s(3,"span"),d(4,"Suspend"),l()()}}var e2=(()=>{class n{linkService=f(Fi);toasterService=f(te);cdr=f(Q);controller=le(void 0);link=le(void 0);suspendLink(){let e=this.link();e.suspend=!0,this.linkService.updateLink(this.controller(),e).subscribe({next:()=>{},error:t=>{let o=t.error?.message||t.message||"Failed to suspend link";this.toasterService.error(o),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-suspend-link-action"]],inputs:{controller:[1,"controller"],link:[1,"link"]},decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&A(0,mxe,5,0,"button",0),t&2){let r;O(((r=o.link())==null?null:r.suspend)===!1?0:-1)}},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var t2=(()=>{class n{linkService=f(Fi);toasterService=f(te);linksDataSource=f(zo);mapLinksDataSource=f(jc);controller=le(void 0);link=le(void 0);get showFiltersIcon(){let e=this.link();return e?this.linksDataSource.get(e.link_id)?.show_filters_icon??!0:!0}toggleShowFiltersIcon(){let e=this.link();if(!e)return;let o=!this.showFiltersIcon;this.linkService.updateLink(this.controller(),it(K({},e),{show_filters_icon:o})).subscribe({next:r=>{this.linksDataSource.update(r);let a=this.mapLinksDataSource.get(r.link_id);a&&(a.show_filters_icon=r.show_filters_icon,this.mapLinksDataSource.update(a))},error:r=>{let a=r.error?.message||r.message||"Failed to toggle filter icon visibility";this.toasterService.error(a)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-toggle-show-filters-icon-action"]],inputs:{controller:[1,"controller"],link:[1,"link"]},decls:5,vars:2,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.toggleShowFiltersIcon()}),s(1,"mat-icon"),d(2),l(),s(3,"span"),d(4),l()()),t&2&&(m(2),j(o.showFiltersIcon===!1?"visibility_off":"visibility"),m(2),j(o.showFiltersIcon===!1?"Show filter icons":"Hide filter icons"))},dependencies:[ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var n2=(()=>{class n{linkService=f(Fi);toasterService=f(te);cdr=f(Q);controller=le(void 0);link=le(void 0);resetLink(){this.linkService.resetLink(this.controller(),this.link()).subscribe({next:()=>{},error:e=>{let t=e.error?.message||e.message||"Failed to reset link";this.toasterService.error(t),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-reset-link-action"]],inputs:{controller:[1,"controller"],link:[1,"link"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.resetLink()}),s(1,"mat-icon"),d(2,"settings_backup_restore"),l(),s(3,"span"),d(4,"Reset link"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function pxe(n,i){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function uxe(n,i){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function hxe(n,i){if(n&1&&(s(0,"mat-form-field",9)(1,"mat-label"),d(2,"Curviness"),l(),R(3,"input",14),l()),n&2){let e=v();m(3),C("min",e.curvinessMin)("max",e.curvinessMax)("step",e.curvinessStep)}}function fxe(n,i){if(n&1&&(s(0,"mat-form-field",10)(1,"mat-label"),d(2,"Roundness"),l(),R(3,"input",15),l()),n&2){let e=v();m(3),C("min",e.flowchartRoundnessMin)("max",e.flowchartRoundnessMax)("step",e.flowchartRoundnessStep)}}var i2=(()=>{class n{dialogRef=f(Ie);formBuilder=f(Vn);toasterService=f(te);linkService=f(Fi);linksDataSource=f(zo);linksEventSource=f(Da);linkToMapLink=f(Ef);nonNegativeValidator=f(up);cdr=f(Q);controller;project;link;formGroup;borderTypes=["Invisible","Solid","Dash","Dot","Dash Dot","Dash Dot Dot"];linkTypes=["Straight","Bezier","Flowchart","StateMachine","Freeform"];linkTypeValues=["straight","bezier","flowchart","statemachine","freeform"];bezierCurvinessMin=Yt.BEZIER_CURVINESS_MIN;bezierCurvinessMax=Yt.BEZIER_CURVINESS_MAX;bezierCurvinessStep=Yt.BEZIER_CURVINESS_STEP;bezierCurvinessDefault=Yt.BEZIER_CURVINESS_DEFAULT;stateMachineCurvinessMin=Yt.STATE_MACHINE_CURVINESS_MIN;stateMachineCurvinessMax=Yt.STATE_MACHINE_CURVINESS_MAX;stateMachineCurvinessStep=Yt.STATE_MACHINE_CURVINESS_STEP;stateMachineCurvinessDefault=Yt.STATE_MACHINE_CURVINESS_DEFAULT;flowchartRoundnessMin=Yt.FLOWCHART_ROUNDNESS_MIN;flowchartRoundnessMax=Yt.FLOWCHART_ROUNDNESS_MAX;flowchartRoundnessStep=Yt.FLOWCHART_ROUNDNESS_STEP;flowchartRoundnessDefault=Yt.FLOWCHART_ROUNDNESS_DEFAULT;curvinessLinkTypeContext=Yt.DEFAULT_LINK_TYPE;constructor(){this.formGroup=this.formBuilder.group({color:new Ye("",[Ue.required]),width:new Ye("",[Ue.required,this.nonNegativeValidator.get]),type:new Ye("",[Ue.required]),linkType:new Ye("",[Ue.required]),bezierCurviness:new Ye(this.bezierCurvinessDefault,[Ue.required]),flowchartRoundness:new Ye(this.flowchartRoundnessDefault,[Ue.required,Ue.min(this.flowchartRoundnessMin),Ue.max(this.flowchartRoundnessMax)])})}ngOnInit(){this.link.link_style||(this.link.link_style={});let e=this.link.link_type==="serial"?"#800000":"#000000";this.formGroup.controls.color.setValue(this.link.link_style?.color??e);let t=this.link.link_style?.width!==void 0?this.link.link_style.width:2;this.formGroup.controls.width.setValue(t);let o=this.borderTypes[1];this.link.link_style?.type!==void 0&&this.link.link_style.type>=0&&this.link.link_style.type<this.borderTypes.length&&(o=this.borderTypes[this.link.link_style.type]),this.formGroup.controls.type.setValue(o);let r=yl.get(this.link.project_id,this.link.link_id),a=this.link.link_style.link_type||r,c=this.normalizeLinkType(a);this.formGroup.controls.linkType.setValue(this.getLinkTypeLabel(a));let p=yl.getBezierCurviness(this.link.project_id,this.link.link_id),u=this.link.link_style?.bezier_curviness!==void 0?this.link.link_style.bezier_curviness:p;this.applyCurvinessValidators(c),this.formGroup.controls.bezierCurviness.setValue(this.normalizeCurvinessByLinkType(c,u)),this.curvinessLinkTypeContext=c;let h=yl.getFlowchartRoundness(this.link.project_id,this.link.link_id),_=this.link.link_style?.flowchart_roundness!==void 0?this.link.link_style.flowchart_roundness:h;this.formGroup.controls.flowchartRoundness.setValue(Yt.normalizeFlowchartRoundness(_)),this.formGroup.controls.linkType.valueChanges.subscribe({next:S=>{let x=this.normalizeLinkType(S),b=this.curvinessLinkTypeContext;this.applyCurvinessValidators(x);let M=this.formGroup.controls.bezierCurviness.value,w=this.normalizeCurvinessByLinkType(b,M),y=this.getCurvinessDefaultByLinkType(b),E=w===y,I=this.getCurvinessDefaultByLinkType(x),D=E?I:this.normalizeCurvinessByLinkType(x,M);this.formGroup.controls.bezierCurviness.setValue(D,{emitEvent:!1}),this.curvinessLinkTypeContext=x},error:S=>{let x=S.error?.message||S.message||"Failed to update link type";this.toasterService.error(x),this.cdr.markForCheck()}})}normalizeLinkType(e){return Yt.normalizeLinkType(e)}getLinkTypeLabel(e){let t=this.normalizeLinkType(e),o=this.linkTypeValues.indexOf(t);return this.linkTypes[o===-1?0:o]}isCurvinessSelected(){let e=this.normalizeLinkType(this.formGroup.controls.linkType.value);return e==="bezier"||e==="statemachine"}isFlowchartSelected(){return this.normalizeLinkType(this.formGroup.controls.linkType.value)==="flowchart"}get curvinessMin(){return this.getCurvinessMinByLinkType(this.normalizeLinkType(this.formGroup.controls.linkType.value))}get curvinessMax(){return this.getCurvinessMaxByLinkType(this.normalizeLinkType(this.formGroup.controls.linkType.value))}get curvinessStep(){return this.getCurvinessStepByLinkType(this.normalizeLinkType(this.formGroup.controls.linkType.value))}normalizeCurvinessByLinkType(e,t){return e==="statemachine"?Yt.normalizeStateMachineCurviness(t):Yt.normalizeBezierCurviness(t)}getCurvinessMinByLinkType(e){return e==="statemachine"?this.stateMachineCurvinessMin:this.bezierCurvinessMin}getCurvinessMaxByLinkType(e){return e==="statemachine"?this.stateMachineCurvinessMax:this.bezierCurvinessMax}getCurvinessStepByLinkType(e){return e==="statemachine"?this.stateMachineCurvinessStep:this.bezierCurvinessStep}getCurvinessDefaultByLinkType(e){return e==="statemachine"?this.stateMachineCurvinessDefault:this.bezierCurvinessDefault}applyCurvinessValidators(e){this.formGroup.controls.bezierCurviness.setValidators([Ue.required,Ue.min(this.getCurvinessMinByLinkType(e)),Ue.max(this.getCurvinessMaxByLinkType(e))]),this.formGroup.controls.bezierCurviness.updateValueAndValidity({emitEvent:!1})}onNoClick(){this.dialogRef.close()}onYesClick(){if(this.formGroup.valid){this.link.link_style||(this.link.link_style={});let e=this.normalizeLinkType(this.link.link_style.link_type||yl.get(this.link.project_id,this.link.link_id)),t=this.link.link_style.control_offset;this.link.link_style.color=this.formGroup.controls.color.value,this.link.link_style.width=this.formGroup.controls.width.value,this.link.link_style.type=this.borderTypes.indexOf(this.formGroup.controls.type.value),this.link.link_style.link_type=this.normalizeLinkType(this.formGroup.controls.linkType.value),this.link.link_style.bezier_curviness=this.normalizeCurvinessByLinkType(this.link.link_style.link_type,this.formGroup.controls.bezierCurviness.value),this.link.link_style.flowchart_roundness=Yt.normalizeFlowchartRoundness(this.formGroup.controls.flowchartRoundness.value),this.link.link_style.link_type==="freeform"?this.link.link_style.control_offset=t:this.link.link_style.control_offset=void 0;let o=this.link.link_style.link_type,r=this.link.link_style.bezier_curviness,a=this.link.link_style.flowchart_roundness,c=o!==e;this.linkService.updateLinkStyle(this.controller,this.link).subscribe({next:p=>{p.link_style||(p.link_style={});let u=p.link_style.link_type,_=typeof u=="string"&&u.trim().length>0&&this.normalizeLinkType(u)!==this.normalizeLinkType(o);!p.link_style.link_type&&o&&(p.link_style.link_type=o),p.link_style.bezier_curviness===void 0&&r!==void 0&&(p.link_style.bezier_curviness=r),p.link_style.flowchart_roundness===void 0&&a!==void 0&&(p.link_style.flowchart_roundness=a),p.link_style.control_offset===void 0&&t!==void 0&&p.link_style.link_type==="freeform"&&(p.link_style.control_offset=t),yl.set(p.project_id,p.link_id,p.link_style.link_type),yl.setBezierCurviness(p.project_id,p.link_id,this.normalizeCurvinessByLinkType(p.link_style.link_type,p.link_style.bezier_curviness)),yl.setFlowchartRoundness(p.project_id,p.link_id,Yt.normalizeFlowchartRoundness(p.link_style.flowchart_roundness)),this.linksDataSource.update(p),this.linksEventSource.edited.next(this.linkToMapLink.convert(p)),c&&o&&_?this.toasterService.warning("Link type was not persisted by the controller. Please update gns3-server."):this.toasterService.success("Link updated"),this.dialogRef.close()},error:p=>{let u=p.error?.message||p.message||"Failed to update link style";this.toasterService.error(u),this.cdr.markForCheck()}})}else this.toasterService.error("Entered data is incorrect")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-link-style-editor"]],decls:31,vars:3,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[3,"formGroup"],[1,"form-field"],["matInput","","formControlName","color","type","color"],["matInput","","formControlName","width","type","number"],["formControlName","type"],[3,"value"],["formControlName","linkType"],[1,"form-field","bezier-curviness-field"],[1,"form-field","flowchart-roundness-field"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],["matInput","","formControlName","bezierCurviness","type","number",3,"min","max","step"],["matInput","","formControlName","flowchartRoundness","type","number",3,"min","max","step"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Link Style Editor"),l(),s(2,"div",1)(3,"form",2)(4,"mat-form-field",3)(5,"mat-label"),d(6,"Color"),l(),R(7,"input",4),l(),s(8,"mat-form-field",3)(9,"mat-label"),d(10,"Width"),l(),R(11,"input",5),l(),s(12,"mat-form-field",3)(13,"mat-label"),d(14,"Line style"),l(),s(15,"mat-select",6),Y(16,pxe,2,2,"mat-option",7,Ae),l()(),s(18,"mat-form-field",3)(19,"mat-label"),d(20,"Link type"),l(),s(21,"mat-select",8),Y(22,uxe,2,2,"mat-option",7,Ae),l()(),A(24,hxe,4,3,"mat-form-field",9),A(25,fxe,4,3,"mat-form-field",10),l()(),s(26,"div",11)(27,"button",12),g("click",function(){return o.onNoClick()}),d(28,"Cancel"),l(),s(29,"button",13),g("click",function(){return o.onYesClick()}),d(30,"Apply"),l()()),t&2&&(m(3),C("formGroup",o.formGroup),m(13),Z(o.borderTypes),m(6),Z(o.linkTypes),m(2),O(o.isCurvinessSelected()?24:-1),m(),O(o.isFlowchartSelected()?25:-1))},dependencies:[ne,Xe,at,Ft,_r,Pt,rt,dc,Xu,Dt,Rt,zt,_e,Ne,Fe,we,Me,et,Se,Ee,vt,At,_t,Fo,W,pe],styles:[".modal-form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column}.modal-form-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%}.form-field[_ngcontent-%COMP%]{width:100%}.bezier-curviness-field[_ngcontent-%COMP%], .flowchart-roundness-field[_ngcontent-%COMP%]{margin-top:10px}"],changeDetection:0})}return n})();var o2=(()=>{class n{dialog=f(nt);dialogConfig=f(fo);controller=le(void 0);project=le(void 0);link=le(void 0);editStyle(){let e=this.dialogConfig.openConfig("linkStyleEditor",{autoFocus:!1,disableClose:!1}),o=this.dialog.open(i2,e).componentInstance;o.controller=this.controller(),o.project=this.project(),o.link=this.link()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-edit-link-style-action"]],inputs:{controller:[1,"controller"],project:[1,"project"],link:[1,"link"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.editStyle()}),s(1,"mat-icon"),d(2,"style"),l(),s(3,"span"),d(4,"Edit style"),l()())},dependencies:[_e,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var r2=(()=>{class n{nodesDataSource=f(di);drawingsDataSource=f(Ei);nodeService=f(ut);drawingService=f(Ri);projectService=f(ki);cdr=f(Q);dialog=f(nt);toasterService=f(te);controller=le(void 0);nodes=le(void 0);drawings=le(void 0);command;ngOnChanges(){let e=this.nodes(),t=this.drawings();e.length===1&&t.length===0?this.command=e[0].locked?"Unlock item":"Lock item":e.length===0&&t.length===1?this.command=t[0].locked?"Unlock item":"Lock item":this.command="Lock/unlock items"}lock(){let e=this.nodes(),t=this.drawings(),o=e.length+t.length;if(o>1){let a=!e.every(p=>p.locked)||!t.every(p=>p.locked)?"lock":"unlock";this.dialog.open(gxe,{panelClass:"simple-dialog-panel",data:{title:`Confirm ${a==="lock"?"Lock":"Unlock"} All`,message:`Are you sure you want to ${a} ${o} item${o>1?"s":""}?`,action:a}}).afterClosed().subscribe({next:p=>{p&&this.performLockUnlock()},error:p=>{let u=p.error?.message||p.message||"Failed to process lock confirmation";this.toasterService.error(u),this.cdr.markForCheck()}})}else this.performLockUnlock()}async performLockUnlock(){await this.nodes().forEach(e=>{e.locked=!e.locked,this.nodeService.updateNode(this.controller(),e).subscribe({next:t=>{this.nodesDataSource.update(t),this.cdr.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to update node lock status";this.toasterService.error(o),this.cdr.markForCheck()}})}),await this.drawings().forEach(e=>{e.locked=!e.locked,this.drawingService.update(this.controller(),e).subscribe({next:t=>{this.drawingsDataSource.update(t),this.cdr.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to update drawing lock status";this.toasterService.error(o),this.cdr.markForCheck()}})}),this.projectService.projectUpdateLockIcon()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-lock-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"],drawings:[1,"drawings"]},features:[bn],decls:5,vars:1,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.lock()}),s(1,"mat-icon"),d(2,"lock"),l(),s(3,"span"),d(4),l()()),t&2&&(m(4),j(o.command))},dependencies:[W,ie,de,Ge,Ze,_e],encapsulation:2,changeDetection:0})}return n})(),gxe=(()=>{class n{dialogRef;data;constructor(e,t){this.dialogRef=e,this.data=t}static \u0275fac=function(t){return new(t||n)(ot(Ie),ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-lock-confirm-dialog"]],decls:10,vars:3,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["mat-dialog-actions","","align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1)(3,"p"),d(4),l()(),s(5,"div",2)(6,"button",3),g("click",function(){return o.dialogRef.close(!1)}),d(7,"Cancel"),l(),s(8,"button",4),g("click",function(){return o.dialogRef.close(!0)}),d(9),l()()),t&2&&(m(),j(o.data.title),m(3),j(o.data.message),m(5),ee(" ",o.data.action==="lock"?"Lock":"Unlock"," "))},dependencies:[_e,Ne,Fe,bt,W,pe],encapsulation:2,changeDetection:0})}return n})();var a2=(()=>{class n{toasterService=f(te);nodesDataSource=f(di);drawingsDataSource=f(Ei);linksDataSource=f(zo);nodeService=f(ut);drawingService=f(Ri);linkService=f(Fi);bottomSheet=f(Gl);cdr=f(Q);controller=le(void 0);nodes=le([]);drawings=le([]);links=le([]);confirmDelete(){let t=this.bottomSheet.open(Wa,{data:{message:"Do you want to delete all selected objects?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(o=>{o&&(this.delete(),this.cdr.markForCheck())})}delete(){this.nodes().forEach(e=>{if(!e.locked)this.nodesDataSource.remove(e),this.nodeService.delete(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to delete node";this.toasterService.error(o),this.cdr.markForCheck()}});else{this.toasterService.error("Cannot delete locked node: "+e.name),this.cdr.markForCheck();return}}),this.drawings().forEach(e=>{if(!e.locked)this.drawingsDataSource.remove(e),this.drawingService.delete(this.controller(),e).subscribe({next:t=>{},error:t=>{let o=t.error?.message||t.message||"Failed to delete drawing";this.toasterService.error(o),this.cdr.markForCheck()}});else{this.toasterService.error("Cannot delete locked drawing"),this.cdr.markForCheck();return}}),this.nodes().length==0&&this.drawings().length==0&&this.links().forEach(e=>{this.linksDataSource.remove(e),this.linkService.deleteLink(this.controller(),e).subscribe({next:()=>{yl.remove(e.project_id,e.link_id)},error:t=>{let o=t.error?.message||t.message||"Failed to delete link";this.toasterService.error(o),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-delete-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"],drawings:[1,"drawings"],links:[1,"links"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.confirmDelete()}),s(1,"mat-icon"),d(2,"delete"),l(),s(3,"span"),d(4,"Delete"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var s2=(()=>{class n{nodesDataSource=f(di);nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller=le(void 0);nodes=le(void 0);alignHorizontally(){let e=0;this.nodes().forEach(t=>{e+=t.y}),e=e/this.nodes().length,this.nodes().forEach(t=>{t.y=e,this.nodesDataSource.update(t),this.nodeService.update(this.controller(),t).subscribe({next:()=>{this.cdr.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to align node";this.toasterService.error(r),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-align-horizontally-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.alignHorizontally()}),s(1,"mat-icon"),d(2,"more_horiz"),l(),s(3,"span"),d(4,"Align horizontally"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var l2=(()=>{class n{nodesDataSource=f(di);nodeService=f(ut);toasterService=f(te);cdr=f(Q);controller=le(void 0);nodes=le(void 0);alignVertically(){let e=0;this.nodes().forEach(t=>{e+=t.x}),e=e/this.nodes().length,this.nodes().forEach(t=>{t.x=e,this.nodesDataSource.update(t),this.nodeService.update(this.controller(),t).subscribe({next:()=>{this.cdr.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to align node";this.toasterService.error(r),this.cdr.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-align-vertically-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.alignVertically()}),s(1,"mat-icon"),d(2,"more_vert"),l(),s(3,"span"),d(4,"Align vertically"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var r9=(()=>{class n{openFileManagerInline=new ve;node=le(void 0);controller=le(void 0);showInFileManager(){let e=this.node(),t=this.controller();e&&t&&this.openFileManagerInline.emit({node:e,controller:t})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-show-in-file-manager-action"]],inputs:{node:[1,"node"],controller:[1,"controller"]},outputs:{openFileManagerInline:"openFileManagerInline"},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.showInFileManager()}),s(1,"mat-icon"),d(2,"folder_open"),l(),s(3,"span"),d(4,"Show in file manager"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();function _xe(n,i){if(n&1&&R(0,"app-show-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function vxe(n,i){if(n&1){let e=z();s(0,"app-show-in-file-manager-action",15),g("openFileManagerInline",function(o){k(e);let r=v();return T(r.onOpenFileManagerInline(o))}),l()}if(n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Cxe(n,i){if(n&1&&R(0,"app-config-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function bxe(n,i){if(n&1&&R(0,"app-start-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function xxe(n,i){if(n&1&&R(0,"app-suspend-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function yxe(n,i){if(n&1&&R(0,"app-stop-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function Sxe(n,i){if(n&1&&R(0,"app-reload-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function wxe(n,i){if(n&1){let e=z();s(0,"app-http-console-action",16),g("openWebConsoleInline",function(o){k(e);let r=v();return T(r.onOpenWebConsoleInline(o))}),l()}if(n&2){let e=v();C("controller",e.controller)("project",e.project)("nodes",e.nodes)}}function Mxe(n,i){if(n&1&&R(0,"app-http-console-new-tab-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function kxe(n,i){if(n&1&&R(0,"app-console-device-action-browser",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Txe(n,i){if(n&1&&R(0,"app-isolate-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Exe(n,i){if(n&1&&R(0,"app-unisolate-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Dxe(n,i){if(n&1&&R(0,"app-change-hostname-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Pxe(n,i){if(n&1&&R(0,"app-change-symbol-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Ixe(n,i){if(n&1&&R(0,"app-duplicate-action",7),n&2){let e=v();C("controller",e.controller)("project",e.project)("nodes",e.nodes)("drawings",e.drawings)}}function Axe(n,i){if(n&1&&R(0,"app-edit-style-action",8),n&2){let e=v();C("controller",e.controller)("project",e.project)("drawing",e.drawings[0])}}function Oxe(n,i){if(n&1&&R(0,"app-edit-text-action",9),n&2){let e=v();C("controller",e.controller)("project",e.project)("drawing",e.drawings[0])("node",e.nodes[0])("label",e.labels[0])("link",e.links[0])("linkNode",e.linkNodes[0])}}function Nxe(n,i){if(n&1&&R(0,"app-edit-config-action",10),n&2){let e=v();C("controller",e.controller)("project",e.project)("node",e.nodes[0])}}function Fxe(n,i){if(n&1&&R(0,"app-export-config-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Rxe(n,i){if(n&1&&R(0,"app-import-config-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Lxe(n,i){if(n&1&&R(0,"app-idle-pc-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Vxe(n,i){if(n&1&&R(0,"app-auto-idle-pc-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Bxe(n,i){if(n&1&&R(0,"app-move-layer-up-action",11),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)("drawings",e.drawings)}}function zxe(n,i){if(n&1&&R(0,"app-move-layer-down-action",11),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)("drawings",e.drawings)}}function jxe(n,i){if(n&1&&R(0,"app-bring-to-front-action",11),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)("drawings",e.drawings)}}function $xe(n,i){if(n&1&&R(0,"app-start-capture-action",12),n&2){let e=v();C("controller",e.controller)("project",e.project)("link",e.links[0])}}function Hxe(n,i){if(n&1&&R(0,"app-stop-capture-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function Uxe(n,i){if(n&1&&R(0,"app-start-capture-on-started-link-action",12),n&2){let e=v();C("controller",e.controller)("project",e.project)("link",e.links[0])}}function Gxe(n,i){if(n&1){let e=z();R(0,"app-start-web-wireshark-action",12),s(1,"app-start-web-wireshark-inline-action",17),g("openWebWiresharkInline",function(o){k(e);let r=v();return T(r.onOpenWebWiresharkInline(o))}),l()}if(n&2){let e=v();C("controller",e.controller)("project",e.project)("link",e.links[0]),m(),C("controller",e.controller)("project",e.project)("link",e.links[0])}}function Wxe(n,i){if(n&1&&R(0,"app-packet-filters-action",12),n&2){let e=v();C("controller",e.controller)("project",e.project)("link",e.links[0])}}function qxe(n,i){if(n&1&&R(0,"app-toggle-show-filters-icon-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function Qxe(n,i){if(n&1&&R(0,"app-resume-link-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function Xxe(n,i){if(n&1&&R(0,"app-suspend-link-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function Kxe(n,i){if(n&1&&R(0,"app-reset-link-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function Yxe(n,i){if(n&1&&R(0,"app-edit-link-style-action",12),n&2){let e=v();C("controller",e.controller)("project",e.project)("link",e.links[0])}}function Zxe(n,i){if(n&1&&R(0,"app-lock-action",11),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)("drawings",e.drawings)}}function Jxe(n,i){if(n&1&&R(0,"app-delete-action",14),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)("drawings",e.drawings)("links",e.links)}}function eye(n,i){if(n&1&&R(0,"app-align-horizontally-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function tye(n,i){if(n&1&&R(0,"app-align-vertically-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}var ag=(()=>{class n{sanitizer=f(fr);changeDetector=f(Q);projectService=f(ki);project;controller;openWebWiresharkInline=new ve;openWebConsoleInline=new ve;openFileManagerInline=new ve;contextMenu;topPosition;leftPosition;drawings=[];nodes=[];labels=[];links=[];linkNodes=[];hasTextCapabilities=!1;isBundledController=!1;constructor(){}ngOnInit(){this.setPosition(0,0),this.isBundledController=this.controller.location==="bundled"}setPosition(e,t){this.topPosition=this.sanitizer.bypassSecurityTrustStyle(e+"px"),this.leftPosition=this.sanitizer.bypassSecurityTrustStyle(t+"px"),this.changeDetector.detectChanges()}openMenuForDrawing(e,t,o){this.resetCapabilities(),this.hasTextCapabilities=e.element instanceof _s,this.drawings=[e],this.setPosition(t,o),this.contextMenu.openMenu()}openMenuForNode(e,t,o){this.resetCapabilities(),this.nodes=[e],this.setPosition(t,o),this.contextMenu.openMenu()}openMenuForLabel(e,t,o,r){this.resetCapabilities(),this.labels=[e],this.nodes=[t],this.setPosition(o,r),this.contextMenu.openMenu()}openMenuForInterfaceLabel(e,t,o,r){this.resetCapabilities(),this.linkNodes=[e],this.links=[t],this.setPosition(o,r),this.contextMenu.openMenu()}openMenuForListOfElements(e,t,o,r,a,c){this.resetCapabilities(),this.drawings=e,this.nodes=t,this.labels=o,this.links=r,this.setPosition(a,c),this.contextMenu.openMenu()}resetCapabilities(){this.drawings=[],this.nodes=[],this.labels=[],this.linkNodes=[],this.links=[],this.hasTextCapabilities=!1}onOpenWebWiresharkInline(e){this.openWebWiresharkInline.emit(e)}onOpenWebConsoleInline(e){this.openWebConsoleInline.emit(e)}onOpenFileManagerInline(e){this.openFileManagerInline.emit(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-context-menu"]],viewQuery:function(t,o){if(t&1&&xn(Fn,5),t&2){let r;mt(r=pt())&&(o.contextMenu=r.first)}},inputs:{project:"project",controller:"controller"},outputs:{openWebWiresharkInline:"openWebWiresharkInline",openWebConsoleInline:"openWebConsoleInline",openFileManagerInline:"openFileManagerInline"},decls:43,vars:44,consts:[["contextMenu","matMenu"],[1,"context-menu"],[3,"matMenuTriggerFor"],[1,"context-menu-items"],[3,"controller","node"],[3,"controller","nodes"],[3,"controller","project","nodes"],[3,"controller","project","nodes","drawings"],[3,"controller","project","drawing"],[3,"controller","project","drawing","node","label","link","linkNode"],[3,"controller","project","node"],[3,"controller","nodes","drawings"],[3,"controller","project","link"],[3,"controller","link"],[3,"controller","nodes","drawings","links"],[3,"openFileManagerInline","controller","node"],[3,"openWebConsoleInline","controller","project","nodes"],[3,"openWebWiresharkInline","controller","project","link"]],template:function(t,o){if(t&1&&(s(0,"div",1),R(1,"span",2),s(2,"mat-menu",3,0),A(4,_xe,1,2,"app-show-node-action",4),A(5,vxe,1,2,"app-show-in-file-manager-action",4),A(6,Cxe,1,2,"app-config-node-action",4),A(7,bxe,1,2,"app-start-node-action",5),A(8,xxe,1,2,"app-suspend-node-action",5),A(9,yxe,1,2,"app-stop-node-action",5),A(10,Sxe,1,2,"app-reload-node-action",5),A(11,wxe,1,3,"app-http-console-action",6),A(12,Mxe,1,2,"app-http-console-new-tab-action",5),A(13,kxe,1,2,"app-console-device-action-browser",4),A(14,Txe,1,2,"app-isolate-node-action",4),A(15,Exe,1,2,"app-unisolate-node-action",4),A(16,Dxe,1,2,"app-change-hostname-action",4),A(17,Pxe,1,2,"app-change-symbol-action",4),A(18,Ixe,1,4,"app-duplicate-action",7),A(19,Axe,1,3,"app-edit-style-action",8),A(20,Oxe,1,7,"app-edit-text-action",9),A(21,Nxe,1,3,"app-edit-config-action",10),A(22,Fxe,1,2,"app-export-config-action",4),A(23,Rxe,1,2,"app-import-config-action",4),A(24,Lxe,1,2,"app-idle-pc-action",4),A(25,Vxe,1,2,"app-auto-idle-pc-action",4),A(26,Bxe,1,3,"app-move-layer-up-action",11),A(27,zxe,1,3,"app-move-layer-down-action",11),A(28,jxe,1,3,"app-bring-to-front-action",11),A(29,$xe,1,3,"app-start-capture-action",12),A(30,Hxe,1,2,"app-stop-capture-action",13),A(31,Uxe,1,3,"app-start-capture-on-started-link-action",12),A(32,Gxe,2,6),A(33,Wxe,1,3,"app-packet-filters-action",12),A(34,qxe,1,2,"app-toggle-show-filters-icon-action",13),A(35,Qxe,1,2,"app-resume-link-action",13),A(36,Xxe,1,2,"app-suspend-link-action",13),A(37,Kxe,1,2,"app-reset-link-action",13),A(38,Yxe,1,3,"app-edit-link-style-action",12),A(39,Zxe,1,3,"app-lock-action",11),A(40,Jxe,1,4,"app-delete-action",14),A(41,eye,1,2,"app-align-horizontally-action",5),A(42,tye,1,2,"app-align-vertically-action",5),l()()),t&2){let r=Pe(3);nn("left",o.leftPosition)("top",o.topPosition),m(),C("matMenuTriggerFor",r),m(3),O(o.nodes.length===1?4:-1),m(),O(o.nodes.length===1?5:-1),m(),O(o.nodes.length===1?6:-1),m(),O(o.nodes.length?7:-1),m(),O(o.nodes.length?8:-1),m(),O(o.nodes.length?9:-1),m(),O(o.nodes.length?10:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.nodes.length>0?11:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.nodes.length>0?12:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.nodes.length===1?13:-1),m(),O(o.nodes.length===1?14:-1),m(),O(o.nodes.length===1?15:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.nodes.length===1?16:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.nodes.length===1?17:-1),m(),O(o.drawings.length>0||o.nodes.length>0?18:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===1&&!o.hasTextCapabilities?19:-1),m(),O(!o.projectService.isReadOnly(o.project)&&(o.drawings.length===1&&o.hasTextCapabilities&&o.labels.length===0&&o.linkNodes.length===0||o.labels.length===1&&o.linkNodes.length===0&&o.drawings.length===0||o.linkNodes.length===1&&o.labels.length===0&&o.drawings.length===0)?20:-1),m(),O(o.nodes.length===1&&o.nodes[0].node_type==="vpcs"?21:-1),m(),O(o.nodes.length===1&&(o.nodes[0].node_type==="vpcs"||o.nodes[0].node_type==="iou"||o.nodes[0].node_type==="dynamips")?22:-1),m(),O(o.nodes.length===1&&(o.nodes[0].node_type==="vpcs"||o.nodes[0].node_type==="iou"||o.nodes[0].node_type==="dynamips")?23:-1),m(),O(o.nodes.length===1&&o.nodes[0].node_type==="dynamips"?24:-1),m(),O(o.nodes.length===1&&o.nodes[0].node_type==="dynamips"?25:-1),m(),O(!o.projectService.isReadOnly(o.project)&&(o.drawings.length||o.nodes.length)?26:-1),m(),O(!o.projectService.isReadOnly(o.project)&&(o.drawings.length||o.nodes.length)?27:-1),m(),O(!o.projectService.isReadOnly(o.project)&&(o.drawings.length||o.nodes.length)?28:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1?29:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?30:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?31:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?32:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?33:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?34:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?35:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?36:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?37:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.drawings.length===0&&o.nodes.length===0&&o.links.length===1&&o.linkNodes.length===0?38:-1),m(),O(!o.projectService.isReadOnly(o.project)&&(o.drawings.length>0||o.nodes.length>0)?39:-1),m(),O(!o.projectService.isReadOnly(o.project)&&(o.drawings.length>0||o.nodes.length>0||o.links.length>0)&&o.linkNodes.length===0?40:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.nodes.length>1?41:-1),m(),O(!o.projectService.isReadOnly(o.project)&&o.nodes.length>1?42:-1)}},dependencies:[ne,Ge,Qn,Fn,JS,fw,gw,_w,vw,Cw,bw,xw,tg,Mw,kw,Ew,Pw,Iw,Ow,Fw,Lw,Vw,Bw,jw,$w,Hw,Uw,Gw,qw,Qw,Xw,i9,o9,Zw,Jw,e2,t2,n2,o2,r2,a2,s2,l2,r9],styles:[".context-menu[_ngcontent-%COMP%]{position:fixed;min-height:0}"],changeDetection:0})}return n})();var c2=(()=>{class n{fontBBCalculator;themeService=f(ci);MARGIN_BETWEEN_NODE_AND_LABEL=8;constructor(e){this.fontBBCalculator=e}fix(e){let t=this.themeService.getCanvasLabelColor();e.label.style=`font-family: TypeWriter;font-size: 10.0;font-weight: bold;fill: ${t};fill-opacity: 1.0;`;let o=this.fontBBCalculator.calculate(e.label.text,e.label.style);return e.label.x=e.width/2-o.width/2,e.label.y=-o.height-this.MARGIN_BETWEEN_NODE_AND_LABEL,e}static \u0275fac=function(t){return new(t||n)(ge($c))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function nye(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function iye(n,i){if(n&1){let e=z();s(0,"mat-form-field",14)(1,"mat-select",16,0),g("selectionChange",function(o){k(e);let r=v(2);return T(r._changePageSize(o.value))}),Y(3,nye,2,2,"mat-option",17,Ae),l(),s(5,"div",18),g("click",function(){k(e);let o=Pe(2);return T(o.open())}),l()()}if(n&2){let e=v(2);C("appearance",e._formFieldAppearance)("color",e.color),m(),C("value",e.pageSize)("disabled",e.disabled),EO("aria-labelledby",e._pageSizeLabelId),C("panelClass",e.selectConfig.panelClass||"")("disableOptionCentering",e.selectConfig.disableOptionCentering),m(2),Z(e._displayedPageSizeOptions)}}function oye(n,i){if(n&1&&(s(0,"div",15),d(1),l()),n&2){let e=v(2);m(),j(e.pageSize)}}function rye(n,i){if(n&1&&(s(0,"div",3)(1,"div",13),d(2),l(),A(3,iye,6,7,"mat-form-field",14),A(4,oye,2,1,"div",15),l()),n&2){let e=v();m(),qt("id",e._pageSizeLabelId),m(),ee(" ",e._intl.itemsPerPageLabel," "),m(),O(e._displayedPageSizeOptions.length>1?3:-1),m(),O(e._displayedPageSizeOptions.length<=1?4:-1)}}function aye(n,i){if(n&1){let e=z();s(0,"button",19),g("click",function(){k(e);let o=v();return T(o._buttonClicked(0,o._previousButtonsDisabled()))}),ei(),s(1,"svg",8),R(2,"path",20),l()()}if(n&2){let e=v();C("matTooltip",e._intl.firstPageLabel)("matTooltipDisabled",e._previousButtonsDisabled())("disabled",e._previousButtonsDisabled())("tabindex",e._previousButtonsDisabled()?-1:null),qt("aria-label",e._intl.firstPageLabel)}}function sye(n,i){if(n&1){let e=z();s(0,"button",21),g("click",function(){k(e);let o=v();return T(o._buttonClicked(o.getNumberOfPages()-1,o._nextButtonsDisabled()))}),ei(),s(1,"svg",8),R(2,"path",22),l()()}if(n&2){let e=v();C("matTooltip",e._intl.lastPageLabel)("matTooltipDisabled",e._nextButtonsDisabled())("disabled",e._nextButtonsDisabled())("tabindex",e._nextButtonsDisabled()?-1:null),qt("aria-label",e._intl.lastPageLabel)}}var lye=(()=>{class n{changes=new He;itemsPerPageLabel="Items per page:";nextPageLabel="Next page";previousPageLabel="Previous page";firstPageLabel="First page";lastPageLabel="Last page";getRangeLabel=(e,t,o)=>{if(o==0||t==0)return`0 of ${o}`;o=Math.max(o,0);let r=e*t,a=r<o?Math.min(r+t,o):r+t;return`${r+1} \u2013 ${a} of ${o}`};static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),cye=50;var dye=new cn("MAT_PAGINATOR_DEFAULT_OPTIONS"),hr=(()=>{class n{_intl=f(lye);_changeDetectorRef=f(Q);_formFieldAppearance;_pageSizeLabelId=f(Mo).getId("mat-paginator-page-size-label-");_intlChanges;_isInitialized=!1;_initializedStream=new Hd(1);color;get pageIndex(){return this._pageIndex}set pageIndex(e){this._pageIndex=Math.max(e||0,0),this._changeDetectorRef.markForCheck()}_pageIndex=0;get length(){return this._length}set length(e){this._length=e||0,this._changeDetectorRef.markForCheck()}_length=0;get pageSize(){return this._pageSize}set pageSize(e){this._pageSize=Math.max(e||0,0),this._updateDisplayedPageSizeOptions()}_pageSize;get pageSizeOptions(){return this._pageSizeOptions}set pageSizeOptions(e){this._pageSizeOptions=(e||[]).map(t=>No(t,0)),this._updateDisplayedPageSizeOptions()}_pageSizeOptions=[];hidePageSize=!1;showFirstLastButtons=!1;selectConfig={};disabled=!1;page=new ve;_displayedPageSizeOptions;initialized=this._initializedStream;constructor(){let e=this._intl,t=f(dye,{optional:!0});if(this._intlChanges=e.changes.subscribe(()=>this._changeDetectorRef.markForCheck()),t){let{pageSize:o,pageSizeOptions:r,hidePageSize:a,showFirstLastButtons:c}=t;o!=null&&(this._pageSize=o),r!=null&&(this._pageSizeOptions=r),a!=null&&(this.hidePageSize=a),c!=null&&(this.showFirstLastButtons=c)}this._formFieldAppearance=t?.formFieldAppearance||"outline"}ngOnInit(){this._isInitialized=!0,this._updateDisplayedPageSizeOptions(),this._initializedStream.next()}ngOnDestroy(){this._initializedStream.complete(),this._intlChanges.unsubscribe()}nextPage(){this.hasNextPage()&&this._navigate(this.pageIndex+1)}previousPage(){this.hasPreviousPage()&&this._navigate(this.pageIndex-1)}firstPage(){this.hasPreviousPage()&&this._navigate(0)}lastPage(){this.hasNextPage()&&this._navigate(this.getNumberOfPages()-1)}hasPreviousPage(){return this.pageIndex>=1&&this.pageSize!=0}hasNextPage(){let e=this.getNumberOfPages()-1;return this.pageIndex<e&&this.pageSize!=0}getNumberOfPages(){return this.pageSize?Math.ceil(this.length/this.pageSize):0}_changePageSize(e){let t=this.pageIndex*this.pageSize,o=this.pageIndex;this.pageIndex=Math.floor(t/e)||0,this.pageSize=e,this._emitPageEvent(o)}_nextButtonsDisabled(){return this.disabled||!this.hasNextPage()}_previousButtonsDisabled(){return this.disabled||!this.hasPreviousPage()}_updateDisplayedPageSizeOptions(){this._isInitialized&&(this.pageSize||(this._pageSize=this.pageSizeOptions.length!=0?this.pageSizeOptions[0]:cye),this._displayedPageSizeOptions=this.pageSizeOptions.slice(),this._displayedPageSizeOptions.indexOf(this.pageSize)===-1&&this._displayedPageSizeOptions.push(this.pageSize),this._displayedPageSizeOptions.sort((e,t)=>e-t),this._changeDetectorRef.markForCheck())}_emitPageEvent(e){this.page.emit({previousPageIndex:e,pageIndex:this.pageIndex,pageSize:this.pageSize,length:this.length})}_navigate(e){let t=this.pageIndex;e!==t&&(this.pageIndex=e,this._emitPageEvent(t))}_buttonClicked(e,t){t||this._navigate(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-paginator"]],hostAttrs:["role","group",1,"mat-mdc-paginator"],inputs:{color:"color",pageIndex:[2,"pageIndex","pageIndex",No],length:[2,"length","length",No],pageSize:[2,"pageSize","pageSize",No],pageSizeOptions:"pageSizeOptions",hidePageSize:[2,"hidePageSize","hidePageSize",Ct],showFirstLastButtons:[2,"showFirstLastButtons","showFirstLastButtons",Ct],selectConfig:"selectConfig",disabled:[2,"disabled","disabled",Ct]},outputs:{page:"page"},exportAs:["matPaginator"],decls:14,vars:14,consts:[["selectRef",""],[1,"mat-mdc-paginator-outer-container"],[1,"mat-mdc-paginator-container"],[1,"mat-mdc-paginator-page-size"],[1,"mat-mdc-paginator-range-actions"],["aria-atomic","true","aria-live","polite","role","status",1,"mat-mdc-paginator-range-label"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-previous",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["viewBox","0 0 24 24","focusable","false","aria-hidden","true",1,"mat-mdc-paginator-icon"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-next",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["aria-hidden","true",1,"mat-mdc-paginator-page-size-label"],[1,"mat-mdc-paginator-page-size-select",3,"appearance","color"],[1,"mat-mdc-paginator-page-size-value"],["hideSingleSelectionIndicator","",3,"selectionChange","value","disabled","aria-labelledby","panelClass","disableOptionCentering"],[3,"value"],[1,"mat-mdc-paginator-touch-target",3,"click"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"div",2),A(2,rye,5,4,"div",3),s(3,"div",4)(4,"div",5),d(5),l(),A(6,aye,3,5,"button",6),s(7,"button",7),g("click",function(){return o._buttonClicked(o.pageIndex-1,o._previousButtonsDisabled())}),ei(),s(8,"svg",8),R(9,"path",9),l()(),Ir(),s(10,"button",10),g("click",function(){return o._buttonClicked(o.pageIndex+1,o._nextButtonsDisabled())}),ei(),s(11,"svg",8),R(12,"path",11),l()(),A(13,sye,3,5,"button",12),l()()()),t&2&&(m(2),O(o.hidePageSize?-1:2),m(3),ee(" ",o._intl.getRangeLabel(o.pageIndex,o.pageSize,o.length)," "),m(),O(o.showFirstLastButtons?6:-1),m(),C("matTooltip",o._intl.previousPageLabel)("matTooltipDisabled",o._previousButtonsDisabled())("disabled",o._previousButtonsDisabled())("tabindex",o._previousButtonsDisabled()?-1:null),qt("aria-label",o._intl.previousPageLabel),m(3),C("matTooltip",o._intl.nextPageLabel)("matTooltipDisabled",o._nextButtonsDisabled())("disabled",o._nextButtonsDisabled())("tabindex",o._nextButtonsDisabled()?-1:null),qt("aria-label",o._intl.nextPageLabel),m(3),O(o.showFirstLastButtons?13:-1))},dependencies:[Me,At,_t,je,It],styles:[`.mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color, var(--mat-sys-on-surface));background-color:var(--mat-paginator-container-background-color, var(--mat-sys-surface));font-family:var(--mat-paginator-container-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-paginator-container-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-paginator-container-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-paginator-container-text-weight, var(--mat-sys-body-small-weight));letter-spacing:var(--mat-paginator-container-text-tracking, var(--mat-sys-body-small-tracking));--mat-form-field-container-height: var(--mat-paginator-form-field-container-height, 40px);--mat-form-field-container-vertical-padding: var(--mat-paginator-form-field-container-vertical-padding, 8px)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size, var(--mat-sys-body-small-size))}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap;width:100%;min-height:var(--mat-paginator-container-size, 56px)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:var(--mat-paginator-page-size-select-width, 84px)}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;fill:var(--mat-paginator-enabled-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}@media(forced-colors: active){.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon,.mat-mdc-paginator-icon{fill:currentColor}.mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}.mat-mdc-paginator-range-actions .mat-mdc-icon-button[aria-disabled]{color:GrayText}}.mat-mdc-paginator-touch-target{display:var(--mat-paginator-touch-target-display, block);position:absolute;top:50%;left:50%;width:var(--mat-paginator-page-size-select-width, 84px);height:var(--mat-paginator-page-size-select-touch-target-height, 48px);background-color:rgba(0,0,0,0);transform:translate(-50%, -50%);cursor:pointer}
`],encapsulation:2,changeDetection:0})}return n})(),sg=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[W,vt,wt,hr]})}return n})();var mye=["mat-sort-header",""],pye=["*",[["","matSortHeaderIcon",""]]],uye=["*","[matSortHeaderIcon]"];function hye(n,i){n&1&&(ei(),vo(0,"svg",3),bs(1,"path",4),wo())}function fye(n,i){n&1&&(vo(0,"div",2),on(1,1,null,hye,2,0),wo())}var s9=new cn("MAT_SORT_DEFAULT_OPTIONS"),mo=(()=>{class n{_defaultOptions;_initializedStream=new Hd(1);sortables=new Map;_stateChanges=new He;active;start="asc";get direction(){return this._direction}set direction(e){this._direction=e}_direction="";disableClear;disabled=!1;sortChange=new ve;initialized=this._initializedStream;constructor(e){this._defaultOptions=e}register(e){this.sortables.set(e.id,e)}deregister(e){this.sortables.delete(e.id)}sort(e){this.active!=e.id?(this.active=e.id,this.direction=e.start?e.start:this.start):this.direction=this.getNextSortDirection(e),this.sortChange.emit({active:this.active,direction:this.direction})}getNextSortDirection(e){if(!e)return"";let t=e?.disableClear??this.disableClear??!!this._defaultOptions?.disableClear,o=gye(e.start||this.start,t),r=o.indexOf(this.direction)+1;return r>=o.length&&(r=0),o[r]}ngOnInit(){this._initializedStream.next()}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete(),this._initializedStream.complete()}static \u0275fac=function(t){return new(t||n)(ot(s9,8))};static \u0275dir=ft({type:n,selectors:[["","matSort",""]],hostAttrs:[1,"mat-sort"],inputs:{active:[0,"matSortActive","active"],start:[0,"matSortStart","start"],direction:[0,"matSortDirection","direction"],disableClear:[2,"matSortDisableClear","disableClear",Ct],disabled:[2,"matSortDisabled","disabled",Ct]},outputs:{sortChange:"matSortChange"},exportAs:["matSort"],features:[bn]})}return n})();function gye(n,i){let e=["asc","desc"];return n=="desc"&&e.reverse(),i||e.push(""),e}var Tr=(()=>{class n{_sort=f(mo,{optional:!0});_columnDef=f(Cm,{optional:!0});_changeDetectorRef=f(Q);_focusMonitor=f(Aa);_elementRef=f(Zt);_ariaDescriber=f(u4,{optional:!0});_renderChanges;_animationsDisabled=qo();_recentlyCleared=ae(null);_sortButton;id;arrowPosition="after";start;disabled=!1;get sortActionDescription(){return this._sortActionDescription}set sortActionDescription(e){this._updateSortActionDescription(e)}_sortActionDescription="Sort";disableClear;constructor(){f(cr).load(ia);let e=f(s9,{optional:!0});this._sort,e?.arrowPosition&&(this.arrowPosition=e?.arrowPosition)}ngOnInit(){!this.id&&this._columnDef&&(this.id=this._columnDef.name),this._sort.register(this),this._renderChanges=Hn(this._sort._stateChanges,this._sort.sortChange).subscribe(()=>this._changeDetectorRef.markForCheck()),this._sortButton=this._elementRef.nativeElement.querySelector(".mat-sort-header-container"),this._updateSortActionDescription(this._sortActionDescription)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(()=>{Promise.resolve().then(()=>this._recentlyCleared.set(null))})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._sort.deregister(this),this._renderChanges?.unsubscribe(),this._sortButton&&this._ariaDescriber?.removeDescription(this._sortButton,this._sortActionDescription)}_toggleOnInteraction(){if(!this._isDisabled()){let e=this._isSorted(),t=this._sort.direction;this._sort.sort(this),this._recentlyCleared.set(e&&!this._isSorted()?t:null)}}_handleKeydown(e){(e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),this._toggleOnInteraction())}_isSorted(){return this._sort.active==this.id&&(this._sort.direction==="asc"||this._sort.direction==="desc")}_isDisabled(){return this._sort.disabled||this.disabled}_getAriaSortAttribute(){return this._isSorted()?this._sort.direction=="asc"?"ascending":"descending":"none"}_renderArrow(){return!this._isDisabled()||this._isSorted()}_updateSortActionDescription(e){this._sortButton&&(this._ariaDescriber?.removeDescription(this._sortButton,this._sortActionDescription),this._ariaDescriber?.describe(this._sortButton,e)),this._sortActionDescription=e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["","mat-sort-header",""]],hostAttrs:[1,"mat-sort-header"],hostVars:3,hostBindings:function(t,o){t&1&&g("click",function(){return o._toggleOnInteraction()})("keydown",function(a){return o._handleKeydown(a)})("mouseleave",function(){return o._recentlyCleared.set(null)}),t&2&&(qt("aria-sort",o._getAriaSortAttribute()),Be("mat-sort-header-disabled",o._isDisabled()))},inputs:{id:[0,"mat-sort-header","id"],arrowPosition:"arrowPosition",start:"start",disabled:[2,"disabled","disabled",Ct],sortActionDescription:"sortActionDescription",disableClear:[2,"disableClear","disableClear",Ct]},exportAs:["matSortHeader"],attrs:mye,ngContentSelectors:uye,decls:4,vars:17,consts:[[1,"mat-sort-header-container","mat-focus-indicator"],[1,"mat-sort-header-content"],[1,"mat-sort-header-arrow"],["viewBox","0 -960 960 960","focusable","false","aria-hidden","true"],["d","M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z"]],template:function(t,o){t&1&&(ii(pye),vo(0,"div",0)(1,"div",1),on(2),wo(),A(3,fye,3,0,"div",2),wo()),t&2&&(Be("mat-sort-header-sorted",o._isSorted())("mat-sort-header-position-before",o.arrowPosition==="before")("mat-sort-header-descending",o._sort.direction==="desc")("mat-sort-header-ascending",o._sort.direction==="asc")("mat-sort-header-recently-cleared-ascending",o._recentlyCleared()==="asc")("mat-sort-header-recently-cleared-descending",o._recentlyCleared()==="desc")("mat-sort-header-animations-disabled",o._animationsDisabled),qt("tabindex",o._isDisabled()?null:0)("role",o._isDisabled()?null:"button"),m(3),O(o._renderArrow()?3:-1))},styles:[`.mat-sort-header{cursor:pointer}.mat-sort-header-disabled{cursor:default}.mat-sort-header-container{display:flex;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-container::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-sort-header-content{display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}@keyframes _mat-sort-header-recently-cleared-ascending{from{transform:translateY(0);opacity:1}to{transform:translateY(-25%);opacity:0}}@keyframes _mat-sort-header-recently-cleared-descending{from{transform:translateY(0) rotate(180deg);opacity:1}to{transform:translateY(25%) rotate(180deg);opacity:0}}.mat-sort-header-arrow{height:12px;width:12px;position:relative;transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1),opacity 225ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0;overflow:visible;color:var(--mat-sort-arrow-color, var(--mat-sys-on-surface))}.mat-sort-header.cdk-keyboard-focused .mat-sort-header-arrow,.mat-sort-header.cdk-program-focused .mat-sort-header-arrow,.mat-sort-header:hover .mat-sort-header-arrow{opacity:.54}.mat-sort-header .mat-sort-header-sorted .mat-sort-header-arrow{opacity:1}.mat-sort-header-descending .mat-sort-header-arrow{transform:rotate(180deg)}.mat-sort-header-recently-cleared-ascending .mat-sort-header-arrow{transform:translateY(-25%)}.mat-sort-header-recently-cleared-ascending .mat-sort-header-arrow{transition:none;animation:_mat-sort-header-recently-cleared-ascending 225ms cubic-bezier(0.4, 0, 0.2, 1) forwards}.mat-sort-header-recently-cleared-descending .mat-sort-header-arrow{transition:none;animation:_mat-sort-header-recently-cleared-descending 225ms cubic-bezier(0.4, 0, 0.2, 1) forwards}.mat-sort-header-animations-disabled .mat-sort-header-arrow{transition-duration:0ms;animation-duration:0ms}.mat-sort-header-arrow>svg,.mat-sort-header-arrow [matSortHeaderIcon]{width:24px;height:24px;fill:currentColor;position:absolute;top:50%;left:50%;margin:-12px 0 0 -12px;transform:translateZ(0)}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}
`],encapsulation:2,changeDetection:0})}return n})(),ar=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[hi]})}return n})();var p9=Bs(d9());var Vv=(()=>{class n{dialogRef=f(Ie);confirmationMessage;onNoClick(){this.dialogRef.close(!1)}onYesClick(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-information-dialog"]],decls:8,vars:1,consts:[[1,"information-dialog__content"],[1,"information-dialog__message"],["mat-dialog-actions",""],["mat-button","",1,"cancel-button",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"confirm-button",3,"click"]],template:function(t,o){t&1&&(s(0,"mat-dialog-content",0)(1,"p",1),d(2),l()(),s(3,"div",2)(4,"button",3),g("click",function(){return o.onNoClick()}),d(5,"No"),l(),s(6,"button",4),g("click",function(){return o.onYesClick()}),d(7," Yes "),l()()),t&2&&(m(2),j(o.confirmationMessage))},dependencies:[_e,Fe,bt,W,pe],styles:[".information-dialog__content[_ngcontent-%COMP%]{padding:16px 24px 8px}.information-dialog__message[_ngcontent-%COMP%]{margin:0;color:var(--mat-sys-on-surface-variant);font-size:14px;line-height:1.6}"],changeDetection:0})}return n})();var lg=class{adapters;builtin;category;compute_id;console_auto_start;console_http_path;console_http_port;console_resolution;console_type;aux_type;mac_address;custom_adapters;default_name_format;environment;extra_hosts;extra_volumes;image;memory;cpus;name;start_command;symbol;template_id;template_type;usage;tags};var d2=(()=>{class n{httpController;constructor(e){this.httpController=e}getAppliances(e){return this.httpController.get(e,"/appliances")}getAppliance(e,t){return this.httpController.get(e,t)}getUploadPath(e,t){return`${e.protocol}//${e.host}:${e.port}/${wi.current_version}/images/upload/${t}`}updateAppliances(e){return this.httpController.get(e,"/appliances?update=yes")}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function _ye(n,i){if(n&1&&(s(0,"div"),d(1),l(),s(2,"div"),d(3),l()),n&2){let e=v();m(),ee("Adapters: ",e.appliance.qemu.adapters),m(2),ee("Console type: ",e.appliance.qemu.console_type)}}var m2=(()=>{class n{data;dialogRef=f(Ie);appliance;constructor(e){this.data=e}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-appliance-info-dialog"]],decls:14,vars:5,consts:[[1,"title-container"],["mat-dialog-title",""],["mat-dialog-content",""],["mat-dialog-actions",""],["mat-button","","tabindex","-1","color","accent",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"h1",1),d(2),l()(),s(3,"div",2)(4,"div"),d(5),l(),s(6,"div"),d(7),l(),s(8,"div"),d(9),l(),A(10,_ye,4,2),l(),s(11,"div",3)(12,"button",4),g("click",function(){return o.onNoClick()}),d(13,"Close"),l()()),t&2&&(m(2),j(o.appliance.name),m(3),ee("Vendor: ",o.appliance.vendor_name),m(2),ee("Status: ",o.appliance.status),m(2),ee("Maintainer: ",o.appliance.maintainer),m(),O(o.appliance.qemu?10:-1))},dependencies:[_e,Ne,Fe,bt,W,pe,pn],encapsulation:2,changeDetection:0})}return n})();var m9=(n,i)=>e=>Qa(500).pipe(Un(()=>i.list(n)),Lt(t=>t.find(o=>o.name===e.value)?{templateExist:!0}:null));var vye=n=>({"is-invalid":n});function Cye(n,i){n&1&&(s(0,"mat-error"),d(1,"Template name is required"),l())}function bye(n,i){n&1&&(s(0,"mat-error"),d(1,"Template name is incorrect"),l())}function xye(n,i){n&1&&(s(0,"mat-error"),d(1,"Template with this name exists"),l())}var Nu=(()=>{class n{templateNameValidator;data;dialogRef=f(Ie);router=f(ht);dialog=f(nt);toasterService=f(te);formBuilder=f(Vn);templateService=f(pl);cdr=f(Q);controller;templateNameForm;constructor(e,t){this.templateNameValidator=e,this.data=t}ngOnInit(){let e=this.data.name;this.templateNameForm=this.formBuilder.group({templateName:new Ye(e,[Ue.required,this.templateNameValidator.get],[m9(this.controller,this.templateService)])}),setTimeout(()=>{this.templateNameForm.controls.templateName.markAsTouched(),this.cdr.markForCheck()},100)}get form(){return this.templateNameForm.controls}onAddClick(){if(this.templateNameForm.invalid){this.toasterService.error("Please enter correct name for new template");return}this.templateService.list(this.controller).subscribe({next:e=>{let t=this.templateNameForm.controls.templateName.value;e.find(r=>r.name===t)?(this.toasterService.error("Template with this name exists"),this.cdr.markForCheck()):this.dialogRef.close(this.templateNameForm.controls.templateName.value)},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cdr.markForCheck()}})}onNoClick(){this.dialogRef.close()}onKeyDown(e){e.key==="Enter"&&this.onAddClick()}static \u0275fac=function(t){return new(t||n)(ot(Rs),ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-template-name-dialog"]],features:[fn([Rs])],decls:13,vars:7,consts:[["mat-dialog-title",""],[1,"file-name-form",3,"formGroup"],[1,"file-name-form-field"],["matInput","","type","text","formControlName","templateName","placeholder","Template name",3,"keydown","ngClass"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Please enter name for the new template"),l(),s(2,"form",1)(3,"mat-form-field",2)(4,"input",3),g("keydown",function(a){return o.onKeyDown(a)}),l(),A(5,Cye,2,0,"mat-error"),A(6,bye,2,0,"mat-error"),A(7,xye,2,0,"mat-error"),l(),s(8,"div",4)(9,"button",5),g("click",function(){return o.onNoClick()}),d(10,"Cancel"),l(),s(11,"button",6),g("click",function(){return o.onAddClick()}),d(12," Add template "),l()()()),t&2&&(m(2),C("formGroup",o.templateNameForm),m(2),C("ngClass",dn(5,vye,o.form.templateName==null?null:o.form.templateName.errors)),m(),O(o.form.templateName!=null&&o.form.templateName.touched&&(o.form.templateName!=null&&o.form.templateName.errors)&&(o.form.templateName!=null&&o.form.templateName.errors.required)?5:-1),m(),O(o.form.templateName!=null&&o.form.templateName.errors&&(o.form.templateName!=null&&o.form.templateName.errors.invalidName)?6:-1),m(),O(o.form.templateName!=null&&o.form.templateName.errors&&(o.form.templateName!=null&&o.form.templateName.errors.templateExist)?7:-1))},dependencies:[ne,Yi,Dt,at,Ft,Pt,rt,Rt,zt,_e,Ne,Fe,we,Me,fi,Se,Ee,W,pe],styles:[".file-name-form[_ngcontent-%COMP%]{padding:16px 24px 0}.file-name-form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:8px}.project-snackbar[_ngcontent-%COMP%]{background:var(--mat-app-primary-color)}.add-project-button[_ngcontent-%COMP%]{margin-left:auto}"],changeDetection:0})}return n})();var yye=["stepper"],Sye=()=>[5,10,20,50,100],wye=(n,i)=>i.name,u9=(n,i)=>i.filename;function Mye(n,i){n&1&&d(0,"Select creation method")}function kye(n,i){if(n&1&&d(0),n&2){let e=v();j(e.actionTitle)}}function Tye(n,i){if(n&1){let e=z();s(0,"button",60),g("click",function(){k(e);let o=v(2);return T(o.clearFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function Eye(n,i){if(n&1){let e=z();s(0,"button",60),g("click",function(){k(e);let o=v(2);return T(o.clearCategoryFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function Dye(n,i){if(n&1&&(s(0,"mat-option",44),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function Pye(n,i){if(n&1){let e=z();s(0,"button",60),g("click",function(){k(e);let o=v(2);return T(o.clearEmulatorFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function Iye(n,i){if(n&1&&(s(0,"mat-option",44),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function Aye(n,i){if(n&1){let e=z();s(0,"button",60),g("click",function(){k(e);let o=v(2);return T(o.clearVendorFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function Oye(n,i){if(n&1&&(s(0,"mat-option",44),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e)}}function Nye(n,i){n&1&&(s(0,"mat-header-cell",61),d(1,"Name"),l())}function Fye(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function Rye(n,i){n&1&&(s(0,"mat-header-cell",61),d(1,"Emulator"),l())}function Lye(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.emulator)}}function Vye(n,i){n&1&&(s(0,"mat-header-cell",61),d(1,"Vendor"),l())}function Bye(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.vendor_name)}}function zye(n,i){n&1&&(s(0,"mat-header-cell"),d(1,"Actions"),l())}function jye(n,i){if(n&1){let e=z();s(0,"mat-cell",62)(1,"button",63),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.install(o))}),s(2,"mat-icon"),d(3,"archive"),l()(),s(4,"button",64),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.showInfo(o))}),s(5,"mat-icon"),d(6,"info"),l()()()}}function $ye(n,i){n&1&&R(0,"mat-header-row")}function Hye(n,i){n&1&&R(0,"mat-row")}function Uye(n,i){if(n&1){let e=z();s(0,"div",35)(1,"div",36)(2,"mat-form-field",37)(3,"mat-label"),d(4,"Filter"),l(),s(5,"input",38),g("input",function(o){k(e);let r=v();return T(r.onSearchTextChange(o.target.value))}),l(),A(6,Tye,3,0,"button",39),l()(),s(7,"div",40)(8,"mat-form-field",41)(9,"mat-label"),d(10,"Category"),l(),R(11,"input",42),A(12,Eye,3,0,"button",39),s(13,"mat-autocomplete",43,1),g("optionSelected",function(o){k(e);let r=v();return T(r.onCategoryChange(o.option.value))}),Y(15,Dye,2,2,"mat-option",44,Ae),l()(),s(17,"mat-form-field",45)(18,"mat-label"),d(19,"Emulator"),l(),R(20,"input",42),A(21,Pye,3,0,"button",39),s(22,"mat-autocomplete",43,2),g("optionSelected",function(o){k(e);let r=v();return T(r.onEmulatorChange(o.option.value))}),Y(24,Iye,2,2,"mat-option",44,Ae),l()(),s(26,"mat-form-field",46)(27,"mat-label"),d(28,"Vendor"),l(),R(29,"input",42),A(30,Aye,3,0,"button",39),s(31,"mat-autocomplete",43,3),g("optionSelected",function(o){k(e);let r=v();return T(r.onVendorChange(o.option.value))}),Y(33,Oye,2,2,"mat-option",44,Ae),l()()()(),s(35,"div",47)(36,"mat-table",48),g("matSortChange",function(o){k(e);let r=v();return T(r.sortData(o))}),Le(37,49),xe(38,Nye,2,0,"mat-header-cell",50)(39,Fye,2,1,"mat-cell",51),Ve(),Le(40,52),xe(41,Rye,2,0,"mat-header-cell",50)(42,Lye,2,1,"mat-cell",51),Ve(),Le(43,53),xe(44,Vye,2,0,"mat-header-cell",50)(45,Bye,2,1,"mat-cell",51),Ve(),Le(46,54),xe(47,zye,2,0,"mat-header-cell",55)(48,jye,7,0,"mat-cell",56),Ve(),xe(49,$ye,1,0,"mat-header-row",57)(50,Hye,1,0,"mat-row",58),l(),R(51,"mat-paginator",59),l()}if(n&2){let e=Pe(14),t=Pe(23),o=Pe(32),r=v();m(5),C("value",r.searchText()),m(),O(r.searchText()?6:-1),m(5),C("formControl",r.categoryControl)("matAutocomplete",e),m(),O(r.categoryControl.value?12:-1),m(3),Z(r.filteredCategories),m(5),C("formControl",r.emulatorControl)("matAutocomplete",t),m(),O(r.emulatorControl.value?21:-1),m(3),Z(r.filteredEmulators),m(5),C("formControl",r.vendorControl)("matAutocomplete",o),m(),O(r.vendorControl.value?30:-1),m(3),Z(r.filteredVendors),m(3),C("dataSource",r.dataSource),m(13),C("matHeaderRowDef",r.displayedColumns),m(),C("matRowDefColumns",r.displayedColumns),m(),C("pageSizeOptions",Bt(15,Sye))}}function Gye(n,i){if(n&1){let e=z();s(0,"div",32)(1,"input",65,4),g("change",function(o){k(e);let r=v();return T(r.addAppliance(o))}),l(),s(3,"button",66),g("click",function(){k(e);let o=Pe(2);return T(o.click())}),d(4," Click to import appliance "),l()()}if(n&2){let e=v();m(),C("uploader",e.uploader)}}function Wye(n,i){n&1&&(R(0,"mat-spinner",68),s(1,"span"),d(2,"Updating..."),l())}function qye(n,i){n&1&&(s(0,"span"),d(1,"Update from online registry"),l())}function Qye(n,i){if(n&1){let e=z();s(0,"button",67),g("click",function(){k(e);let o=v();return T(o.updateAppliances())}),A(1,Wye,3,0)(2,qye,2,0,"span"),l()}if(n&2){let e=v();C("disabled",e.isUpdatingAppliances),m(),O(e.isUpdatingAppliances?1:2)}}function Xye(n,i){if(n&1&&d(0),n&2){let e=v(2);j(e.secondActionTitle)}}function Kye(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function Yye(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function Zye(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(5);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v(2).$implicit,t=v(3);m(6),ee("Importing ",e.images.bios_image,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function Jye(n,i){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),A(4,Kye,5,0,"div",83)(5,Yye,5,0,"div",84),s(6,"div",85)(7,"input",86,5),g("change",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(o,r.images.bios_image))}),l(),s(9,"button",87)(10,"mat-icon"),d(11,"more_horiz"),l(),s(12,"span"),d(13,"Actions"),l()(),s(14,"mat-menu",null,6)(16,"button",88),g("click",function(){k(e);let o=Pe(8);return T(o.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),g("click",function(){k(e);let o=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(o.images.bios_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),A(26,Zye,12,3,"div",89),l()}if(n&2){let e=Pe(15),t=v().$implicit,o=v(3);Be("new-template__image-item--installed",o.checkImageFromVersion(t.images.bios_image))("new-template__image-item--missing",!o.checkImageFromVersion(t.images.bios_image)),m(2),j(t.images.bios_image),m(2),O(o.checkImageFromVersion(t.images.bios_image)?4:5),m(3),C("uploader",o.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),O(o.isUploading&&o.uploadingImageName===t.images.bios_image?26:-1)}}function eSe(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function tSe(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function nSe(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(5);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v(2).$implicit,t=v(3);m(6),ee("Importing ",e.images.hda_disk_image,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function iSe(n,i){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),A(4,eSe,5,0,"div",83)(5,tSe,5,0,"div",84),s(6,"div",85)(7,"input",86,7),g("change",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(o,r.images.hda_disk_image))}),l(),s(9,"button",87)(10,"mat-icon"),d(11,"more_horiz"),l(),s(12,"span"),d(13,"Actions"),l()(),s(14,"mat-menu",null,8)(16,"button",88),g("click",function(){k(e);let o=Pe(8);return T(o.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),g("click",function(){k(e);let o=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(o.images.hda_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),A(26,nSe,12,3,"div",89),l()}if(n&2){let e=Pe(15),t=v().$implicit,o=v(3);Be("new-template__image-item--installed",o.checkImageFromVersion(t.images.hda_disk_image))("new-template__image-item--missing",!o.checkImageFromVersion(t.images.hda_disk_image)),m(2),j(t.images.hda_disk_image),m(2),O(o.checkImageFromVersion(t.images.hda_disk_image)?4:5),m(3),C("uploader",o.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),O(o.isUploading&&o.uploadingImageName===t.images.hda_disk_image?26:-1)}}function oSe(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function rSe(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function aSe(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(5);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v(2).$implicit,t=v(3);m(6),ee("Importing ",e.images.hdb_disk_image,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function sSe(n,i){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),A(4,oSe,5,0,"div",83)(5,rSe,5,0,"div",84),s(6,"div",85)(7,"input",86,9),g("change",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(o,r.images.hdb_disk_image))}),l(),s(9,"button",87)(10,"mat-icon"),d(11,"more_horiz"),l(),s(12,"span"),d(13,"Actions"),l()(),s(14,"mat-menu",null,10)(16,"button",88),g("click",function(){k(e);let o=Pe(8);return T(o.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),g("click",function(){k(e);let o=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(o.images.hdb_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),A(26,aSe,12,3,"div",89),l()}if(n&2){let e=Pe(15),t=v().$implicit,o=v(3);Be("new-template__image-item--installed",o.checkImageFromVersion(t.images.hdb_disk_image))("new-template__image-item--missing",!o.checkImageFromVersion(t.images.hdb_disk_image)),m(2),j(t.images.hdb_disk_image),m(2),O(o.checkImageFromVersion(t.images.hdb_disk_image)?4:5),m(3),C("uploader",o.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),O(o.isUploading&&o.uploadingImageName===t.images.hdb_disk_image?26:-1)}}function lSe(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function cSe(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function dSe(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(5);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v(2).$implicit,t=v(3);m(6),ee("Importing ",e.images.hdc_disk_image,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function mSe(n,i){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),A(4,lSe,5,0,"div",83)(5,cSe,5,0,"div",84),s(6,"div",85)(7,"input",86,11),g("change",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(o,r.images.hdc_disk_image))}),l(),s(9,"button",87)(10,"mat-icon"),d(11,"more_horiz"),l(),s(12,"span"),d(13,"Actions"),l()(),s(14,"mat-menu",null,12)(16,"button",88),g("click",function(){k(e);let o=Pe(8);return T(o.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),g("click",function(){k(e);let o=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(o.images.hdc_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),A(26,dSe,12,3,"div",89),l()}if(n&2){let e=Pe(15),t=v().$implicit,o=v(3);Be("new-template__image-item--installed",o.checkImageFromVersion(t.images.hdc_disk_image))("new-template__image-item--missing",!o.checkImageFromVersion(t.images.hdc_disk_image)),m(2),j(t.images.hdc_disk_image),m(2),O(o.checkImageFromVersion(t.images.hdc_disk_image)?4:5),m(3),C("uploader",o.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),O(o.isUploading&&o.uploadingImageName===t.images.hdc_disk_image?26:-1)}}function pSe(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function uSe(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function hSe(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(5);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v(2).$implicit,t=v(3);m(6),ee("Importing ",e.images.hdd_disk_image,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function fSe(n,i){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),A(4,pSe,5,0,"div",83)(5,uSe,5,0,"div",84),s(6,"div",85)(7,"input",86,13),g("change",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(o,r.images.hdd_disk_image))}),l(),s(9,"button",87)(10,"mat-icon"),d(11,"more_horiz"),l(),s(12,"span"),d(13,"Actions"),l()(),s(14,"mat-menu",null,14)(16,"button",88),g("click",function(){k(e);let o=Pe(8);return T(o.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),g("click",function(){k(e);let o=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(o.images.hdd_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),A(26,hSe,12,3,"div",89),l()}if(n&2){let e=Pe(15),t=v().$implicit,o=v(3);Be("new-template__image-item--installed",o.checkImageFromVersion(t.images.hdd_disk_image))("new-template__image-item--missing",!o.checkImageFromVersion(t.images.hdd_disk_image)),m(2),j(t.images.hdd_disk_image),m(2),O(o.checkImageFromVersion(t.images.hdd_disk_image)?4:5),m(3),C("uploader",o.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),O(o.isUploading&&o.uploadingImageName===t.images.hdd_disk_image?26:-1)}}function gSe(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function _Se(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function vSe(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(5);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v(2).$implicit,t=v(3);m(6),ee("Importing ",e.images.cdrom_image,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function CSe(n,i){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),A(4,gSe,5,0,"div",83)(5,_Se,5,0,"div",84),s(6,"div",85)(7,"input",86,15),g("change",function(o){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(o,r.images.cdrom_image))}),l(),s(9,"button",87)(10,"mat-icon"),d(11,"more_horiz"),l(),s(12,"span"),d(13,"Actions"),l()(),s(14,"mat-menu",null,16)(16,"button",88),g("click",function(){k(e);let o=Pe(8);return T(o.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),g("click",function(){k(e);let o=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(o.images.cdrom_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),A(26,vSe,12,3,"div",89),l()}if(n&2){let e=Pe(15),t=v().$implicit,o=v(3);Be("new-template__image-item--installed",o.checkImageFromVersion(t.images.cdrom_image))("new-template__image-item--missing",!o.checkImageFromVersion(t.images.cdrom_image)),m(2),j(t.images.cdrom_image),m(2),O(o.checkImageFromVersion(t.images.cdrom_image)?4:5),m(3),C("uploader",o.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),O(o.isUploading&&o.uploadingImageName===t.images.cdrom_image?26:-1)}}function bSe(n,i){if(n&1){let e=z();s(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"div",73)(4,"span",74),d(5),l(),s(6,"div",75)(7,"span",76),d(8),l(),s(9,"button",77),g("click",function(o){let r=k(e).$implicit,a=v(3);return o.stopPropagation(),T(a.createQemuTemplateFromVersion(r))}),d(10," Create "),l()()()()(),s(11,"div",78),A(12,Jye,27,9,"div",79),A(13,iSe,27,9,"div",79),A(14,sSe,27,9,"div",79),A(15,mSe,27,9,"div",79),A(16,fSe,27,9,"div",79),A(17,CSe,27,9,"div",79),l()()}if(n&2){let e=i.$implicit,t=v(3);m(5),ui("",t.applianceToInstall.name," version ",e.name),m(2),Be("new-template__version-count--complete",t.isVersionComplete(e))("new-template__version-count--partial",!t.isVersionComplete(e)&&t.getVersionReadyCount(e)>0),m(),ui(" ",t.getVersionReadyCount(e),"/",t.getVersionImageCount(e)," ready "),m(),C("disabled",!t.isVersionComplete(e)),m(3),O(e.images.bios_image?12:-1),m(),O(e.images.hda_disk_image?13:-1),m(),O(e.images.hdb_disk_image?14:-1),m(),O(e.images.hdc_disk_image?15:-1),m(),O(e.images.hdd_disk_image?16:-1),m(),O(e.images.cdrom_image?17:-1)}}function xSe(n,i){if(n&1){let e=z();s(0,"div",69)(1,"div",70)(2,"span"),d(3,"Install the required files"),l(),s(4,"button",71),g("click",function(){k(e);let o=v(2);return T(o.refreshImages())}),s(5,"mat-icon"),d(6,"refresh"),l()()(),s(7,"mat-accordion",72),Y(8,bSe,18,15,"mat-expansion-panel",null,wye),l()()}if(n&2){let e=v(2);m(8),Z(e.applianceToInstall.versions)}}function ySe(n,i){if(n&1){let e=z();s(0,"div",69)(1,"button",95),g("click",function(){k(e);let o=v(2);return T(o.createDockerTemplate())}),d(2," Create docker template "),l()()}}function SSe(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function wSe(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function MSe(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(4);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v().$implicit,t=v(3);m(6),ee("Importing ",e.filename,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function kSe(n,i){if(n&1){let e=z();s(0,"mat-list-item",97)(1,"div",80)(2,"span",81),d(3),l(),s(4,"div",82),A(5,SSe,5,0,"div",83)(6,wSe,5,0,"div",84),s(7,"div",85)(8,"input",86,7),g("change",function(o){let r=k(e).$implicit,a=v(3);return T(a.importImage(o,r.filename))}),l(),s(10,"button",98),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.createIosTemplate(o))}),d(11,"Create"),l(),s(12,"button",87)(13,"mat-icon"),d(14,"more_horiz"),l()(),s(15,"mat-menu",null,17)(17,"button",88),g("click",function(){k(e);let o=Pe(9);return T(o.click())}),s(18,"mat-icon"),d(19,"upload_file"),l(),s(20,"span"),d(21,"Import from file"),l()()()(),A(22,MSe,12,3,"div",89),l()()()}if(n&2){let e=i.$implicit,t=Pe(16),o=v(3);m(),Be("new-template__image-item--installed",o.checkImageFromVersion(e.filename))("new-template__image-item--missing",!o.checkImageFromVersion(e.filename)),m(2),j(e.filename),m(2),O(o.checkImageFromVersion(e.filename)?5:6),m(3),C("uploader",o.uploaderImage),m(4),C("matMenuTriggerFor",t),m(10),O(o.isUploading&&o.uploadingImageName===e.filename?22:-1)}}function TSe(n,i){if(n&1){let e=z();s(0,"div",69)(1,"div",70)(2,"span"),d(3,"Install the required images"),l(),s(4,"button",71),g("click",function(){k(e);let o=v(2);return T(o.refreshImages())}),s(5,"mat-icon"),d(6,"refresh"),l()()(),s(7,"mat-list",96),Y(8,kSe,23,9,"mat-list-item",97,u9),l()()}if(n&2){let e=v(2);m(8),Z(e.applianceToInstall.images)}}function ESe(n,i){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function DSe(n,i){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function PSe(n,i){if(n&1){let e=z();s(0,"div",89)(1,"div",90)(2,"div",91)(3,"mat-icon"),d(4,"sync"),l(),s(5,"span"),d(6),l()(),s(7,"span",92),d(8),l()(),R(9,"mat-progress-bar",93),s(10,"button",94),g("click",function(){k(e);let o=v(4);return T(o.cancelUploading())}),d(11,"Cancel"),l()()}if(n&2){let e=v().$implicit,t=v(3);m(6),ee("Importing ",e.filename,"..."),m(2),ee("",t.uploadProgress,"%"),m(),C("value",t.uploadProgress)}}function ISe(n,i){if(n&1){let e=z();s(0,"mat-list-item",97)(1,"div",80)(2,"span",81),d(3),l(),s(4,"div",82),A(5,ESe,5,0,"div",83)(6,DSe,5,0,"div",84),s(7,"div",85)(8,"input",86,18),g("change",function(o){let r=k(e).$implicit,a=v(3);return T(a.importImage(o,r.filename))}),l(),s(10,"button",98),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.createIouTemplate(o))}),d(11,"Create"),l(),s(12,"button",87)(13,"mat-icon"),d(14,"more_horiz"),l()(),s(15,"mat-menu",null,19)(17,"button",88),g("click",function(){k(e);let o=Pe(9);return T(o.click())}),s(18,"mat-icon"),d(19,"upload_file"),l(),s(20,"span"),d(21,"Import from file"),l()()()(),A(22,PSe,12,3,"div",89),l()()()}if(n&2){let e=i.$implicit,t=Pe(16),o=v(3);m(),Be("new-template__image-item--installed",o.checkImageFromVersion(e.filename))("new-template__image-item--missing",!o.checkImageFromVersion(e.filename)),m(2),j(e.filename),m(2),O(o.checkImageFromVersion(e.filename)?5:6),m(3),C("uploader",o.uploaderImage),m(4),C("matMenuTriggerFor",t),m(10),O(o.isUploading&&o.uploadingImageName===e.filename?22:-1)}}function ASe(n,i){if(n&1){let e=z();s(0,"div",69)(1,"div",70)(2,"span"),d(3,"Install the required images"),l(),s(4,"button",71),g("click",function(){k(e);let o=v(2);return T(o.refreshImages())}),s(5,"mat-icon"),d(6,"refresh"),l()()(),s(7,"mat-list",96),Y(8,ISe,23,9,"mat-list-item",97,u9),l()()}if(n&2){let e=v(2);m(8),Z(e.applianceToInstall.images)}}function OSe(n,i){if(n&1){let e=z();s(0,"mat-step",22),xe(1,Xye,1,1,"ng-template",23),s(2,"mat-dialog-content",24),A(3,xSe,10,0,"div",69),A(4,ySe,3,0,"div",69),A(5,TSe,10,0,"div",69),A(6,ASe,10,0,"div",69),l(),s(7,"mat-dialog-actions",29)(8,"button",33),d(9,"Back"),l(),s(10,"button",31),g("click",function(){k(e);let o=v();return T(o.onCloseClick())}),d(11,"Cancel"),l()()()}if(n&2){let e=v();m(3),O(e.applianceToInstall.qemu&&(!e.isLinuxPlatform||e.applianceToInstall.dynamips)?3:-1),m(),O(e.applianceToInstall.docker?4:-1),m(),O(e.applianceToInstall.dynamips?5:-1),m(),O(e.applianceToInstall.iou?6:-1)}}var cg=(()=>{class n{controller;project;uploader;uploaderImage;action="install";actionTitle="Install appliance from controller";secondActionTitle="Appliance settings";searchText=U("");allAppliances=[];appliances=[];applianceToInstall;selectedImages;isLinuxPlatform=!1;isLocalComputerChosen=!1;categories=["all categories","router","multilayer_switch","guest","firewall"];category=U("all categories");emulators=["all emulators"];emulator=U("all emulators");vendors=["all vendors"];vendor=U("all vendors");displayedColumns=["name","emulator","vendor","actions"];categoryControl=new cc("all categories");emulatorControl=new cc("all emulators");vendorControl=new cc("all vendors");filteredCategories=[];filteredEmulators=[];filteredVendors=[];dataSource;qemuImages=[];iosImages=[];iouImages=[];templates=[];uploadProgress=0;uploadingImageName="";isUploading=!1;isUpdatingAppliances=!1;paginator=Nt(hr);stepper=Nt("stepper");dialogRef=f(Ie);applianceService=f(d2);changeDetector=f(Q);toasterService=f(te);qemuService=f(Kr);dockerService=f(ds);iosService=f(ps);iouService=f(us);templateService=f(pl);dialog=f(nt);computeService=f(ko);changeDetectorRef=f(Q);progressService=f(no);snackBar=f(vr);uploadServiceService=f(hl);ngOnInit(){this.setupAutocompleteFilters(),this.applianceService.getAppliances(this.controller).subscribe({next:e=>{this.appliances=e,this.appliances.forEach(t=>{t.docker&&(t.emulator="Docker"),t.dynamips&&(t.emulator="Dynamips"),t.iou&&(t.emulator="Iou"),t.qemu&&(t.emulator="Qemu")}),this.allAppliances=e,this.extractFilterOptions(),this.dataSource=new pr(this.allAppliances),this.setupPaginator(),this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load appliances";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.templateService.list(this.controller).subscribe({next:e=>{this.templates=e,this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.computeService.getComputes(this.controller).subscribe({next:e=>{e.forEach(t=>{t.capabilities?.platform==="linux"&&(this.isLinuxPlatform=!0)}),this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load computes";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.qemuService.getImages(this.controller).subscribe({next:e=>{this.qemuImages=e,this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load QEMU images";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.iosService.getImages(this.controller).subscribe({next:e=>{this.iosImages=e,this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load IOS images";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.iouService.getImages(this.controller).subscribe({next:e=>{this.iouImages=e,this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load IOU images";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.applianceService.getAppliances(this.controller).subscribe(e=>{this.appliances=e,this.appliances.forEach(t=>{t.docker&&(t.emulator="Docker"),t.dynamips&&(t.emulator="Dynamips"),t.iou&&(t.emulator="Iou"),t.qemu&&(t.emulator="Qemu")}),this.allAppliances=e,this.extractFilterOptions(),this.dataSource=new pr(this.allAppliances),this.setupPaginator()}),this.applianceService.getAppliances(this.controller).subscribe({next:e=>{this.appliances=e,this.appliances.forEach(t=>{t.docker&&(t.emulator="Docker"),t.dynamips&&(t.emulator="Dynamips"),t.iou&&(t.emulator="Iou"),t.qemu&&(t.emulator="Qemu")}),this.allAppliances=e,this.extractFilterOptions(),this.dataSource=new pr(this.allAppliances),this.setupPaginator(),this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load appliances";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.uploader=new $a({url:""}),this.uploader.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploader.onErrorItem=(e,t,o,r)=>{this.toasterService.error("An error has occured")},this.uploader.onSuccessItem=(e,t,o,r)=>{this.toasterService.success("Appliance imported succesfully"),this.getAppliance(e.url)},this.uploaderImage=new $a({url:""}),this.uploaderImage.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploaderImage.onErrorItem=(e,t,o,r)=>{this.toasterService.error("An error has occurred because image already exists"),this.progressService.deactivate(),this.isUploading=!1,this.uploadingImageName="",this.uploaderImage.clearQueue(),this.changeDetectorRef.markForCheck()},this.uploaderImage.onSuccessItem=(e,t,o,r)=>{this.toasterService.success("Image successfully imported"),this.refreshImages(),this.progressService.deactivate(),this.isUploading=!1,this.uploadingImageName="",this.uploaderImage.clearQueue(),this.changeDetectorRef.markForCheck()},this.uploaderImage.onProgressItem=e=>{this.uploadProgress=e.progress,this.uploadServiceService.processBarCount(this.uploadProgress),this.changeDetectorRef.markForCheck()},this.uploadServiceService.currentCancelItemDetails.subscribe(e=>{e&&this.cancelUploading()})}ngAfterViewInit(){this.setupPaginator()}setupPaginator(){this.dataSource&&this.paginator()&&(this.dataSource.paginator=this.paginator(),this.changeDetectorRef.markForCheck())}updateAppliances(){this.isUpdatingAppliances=!0,this.progressService.activate(),this.applianceService.updateAppliances(this.controller).subscribe({next:e=>{this.appliances=e,this.progressService.deactivate(),this.isUpdatingAppliances=!1,this.toasterService.success("Appliances are up-to-date."),this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to update appliances";this.progressService.deactivate(),this.isUpdatingAppliances=!1,this.toasterService.error(t),this.changeDetectorRef.markForCheck()}})}refreshImages(){this.qemuService.getImages(this.controller).subscribe({next:e=>{this.qemuImages=e,this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load QEMU images";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.iosService.getImages(this.controller).subscribe({next:e=>{this.iosImages=e,this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load IOS images";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}}),this.iouService.getImages(this.controller).subscribe({next:e=>{this.iouImages=e,this.changeDetectorRef.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load IOU images";this.toasterService.error(t),this.changeDetectorRef.markForCheck()}})}getAppliance(e){let t=e.split(`/${wi.current_version}`),o=t[t.length-1];this.applianceService.getAppliance(this.controller,o).subscribe({next:r=>{this.applianceToInstall=r,setTimeout(()=>{this.stepper().next()},100),this.changeDetectorRef.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load appliance";this.toasterService.error(a),this.changeDetectorRef.markForCheck()}})}addAppliance(e){let t=e.target.files[0].name.split("-")[0],o=e.target.files[0].name,r=e.target.files[0],a=new FileReader,c;a.onloadend=()=>{let p=JSON.parse(a.result);p.docker&&(c="docker"),p.dynamips&&(c="dynamips"),p.iou&&(c="iou"),p.qemu&&(c="qemu");let u=this.applianceService.getUploadPath(this.controller,o);this.uploader.queue.forEach(_=>_.url=u);let h=this.uploader.queue[0];h.options&&(h.options.disableMultipart=!0),h.options.headers=[{name:"Authorization",value:"Bearer "+this.controller.authToken}],this.uploader.uploadItem(h)},a.readAsText(r)}extractFilterOptions(){let e=new Set,t=new Set,o=new Set;this.allAppliances.forEach(r=>{r.emulator&&e.add(r.emulator),r.vendor_name&&t.add(r.vendor_name),r.category&&o.add(r.category)}),this.categories=["all categories","router","multilayer_switch","guest","firewall"],this.emulators=["all emulators",...Array.from(e).sort()],this.vendors=["all vendors",...Array.from(t).sort()],this.updateFilterOptions()}updateFilterOptions(){let e=this.allAppliances;this.category()!=="all categories"&&this.category()&&(e=e.filter(a=>a.category===this.category())),this.emulator()!=="all emulators"&&this.emulator()&&(e=e.filter(a=>a.emulator===this.emulator())),this.vendor()!=="all vendors"&&this.vendor()&&(e=e.filter(a=>a.vendor_name===this.vendor()));let t=new Set,o=new Set,r=new Set;e.forEach(a=>{a.emulator&&t.add(a.emulator),a.vendor_name&&o.add(a.vendor_name),a.category&&r.add(a.category)}),this.emulators=["all emulators",...Array.from(t).sort()],this.vendors=["all vendors",...Array.from(o).sort()],this.filteredCategories=this._filter(this.categoryControl.value||"",this.categories),this.filteredEmulators=this._filter(this.emulatorControl.value||"",this.emulators),this.filteredVendors=this._filter(this.vendorControl.value||"",this.vendors)}setupAutocompleteFilters(){this.categoryControl.valueChanges.subscribe(e=>{this.filteredCategories=this._filter(e||"",this.categories)}),this.emulatorControl.valueChanges.subscribe(e=>{this.filteredEmulators=this._filter(e||"",this.emulators)}),this.vendorControl.valueChanges.subscribe(e=>{this.filteredVendors=this._filter(e||"",this.vendors)})}_filter(e,t){let o=e.toLowerCase();return t.filter(r=>r.toLowerCase().includes(o))}filterAppliances(){let e=this.allAppliances.filter(t=>t.name.toLowerCase().includes(this.searchText().toLowerCase()));this.category()!=="all categories"&&this.category()&&(e=e.filter(t=>t.category===this.category())),this.emulator()!=="all emulators"&&this.emulator()&&(e=e.filter(t=>t.emulator===this.emulator())),this.vendor()!=="all vendors"&&this.vendor()&&(e=e.filter(t=>t.vendor_name===this.vendor())),this.appliances=e,this.dataSource=new pr(this.appliances),this.setupPaginator(),this.updateFilterOptions()}onSearchTextChange(e){this.searchText.set(e),this.updateFilterOptions(),this.filterAppliances()}onCategoryChange(e){this.category.set(e),this.categoryControl.setValue(e),this.updateFilterOptions(),this.filterAppliances()}onEmulatorChange(e){this.emulator.set(e),this.emulatorControl.setValue(e),this.updateFilterOptions(),this.filterAppliances()}onVendorChange(e){this.vendor.set(e),this.vendorControl.setValue(e),this.updateFilterOptions(),this.filterAppliances()}clearFilter(){this.searchText.set(""),this.filterAppliances()}clearCategoryFilter(){this.category.set("all categories"),this.categoryControl.setValue(""),this.updateFilterOptions(),this.filterAppliances()}clearEmulatorFilter(){this.emulator.set("all emulators"),this.emulatorControl.setValue(""),this.updateFilterOptions(),this.filterAppliances()}clearVendorFilter(){this.vendor.set("all vendors"),this.vendorControl.setValue(""),this.updateFilterOptions(),this.filterAppliances()}setAction(e){this.action=e,e==="install"?this.actionTitle="Install appliance from controller":e==="import"&&(this.actionTitle="Import an appliance file")}setControllerType(e){this.isLocalComputerChosen=!0}sortData(e){if(!e.active||e.direction==="")return;let t=this.appliances.slice();this.appliances=t.sort((o,r)=>{let a=e.direction==="asc";return e.active==="name"?qA(o.name,r.name,a):e.active==="emulator"?qA(o.emulator,r.emulator,a):e.active==="vendor"?qA(o.vendor_name,r.vendor_name,a):0})}onCloseClick(){this.dialogRef.close()}install(e){this.applianceToInstall=e,setTimeout(()=>{this.stepper().next()},100)}showInfo(e){let t=this.dialog.open(m2,{width:"250px",data:{appliance:e}});t.componentInstance.appliance=e}importImage(e,t){this.uploadingImageName=t,this.computeChecksumMd5(e.target.files[0],!1).then(o=>{let r=this.applianceToInstall.images.filter(a=>a.filename===t)[0];if(r.md5sum!==o){this.progressService.deactivate();let a=this.dialog.open(Vv,{autoFocus:!1,disableClose:!0,panelClass:["base-confirmation-dialog-panel","information-dialog-panel"]});a.componentInstance.confirmationMessage=`This is not the correct file.
The MD5 sum is ${o} and should be ${r.md5sum}. Do you want to accept it at your own risks?`,a.afterClosed().subscribe(c=>{c?(this.importImageFile(e,t),this.openSnackBar()):(this.isUploading=!1,this.uploadingImageName="",this.uploaderImage.clearQueue(),this.changeDetectorRef.markForCheck())})}else this.importImageFile(e,t),this.openSnackBar()})}importImageFile(e,t){let o=e.target.files[0].name.split("-")[0],r=e.target.files[0],a=new FileReader,c;a.onloadend=()=>{this.applianceToInstall.qemu&&(c="qemu"),this.applianceToInstall.dynamips&&(c="dynamips"),this.applianceToInstall.iou&&(c="iou");let p=this.applianceService.getUploadPath(this.controller,t);this.uploaderImage.queue.forEach(h=>h.url=p);let u=this.uploaderImage.queue[0];u.options&&(u.options.disableMultipart=!0),u.options.headers=[{name:"Authorization",value:"Bearer "+this.controller.authToken}],this.isUploading=!0,this.uploadProgress=0,this.uploaderImage.uploadItem(u),this.changeDetectorRef.markForCheck()},a.onloadend(void 0)}cancelUploading(){this.uploaderImage.clearQueue(),this.uploadServiceService.processBarCount(null),this.toasterService.warning("File upload cancelled"),this.uploadServiceService.cancelFileUploading(!1)}checkImageFromVersion(e){let t=this.applianceToInstall.images.filter(o=>o.filename===e)[0];if(this.applianceToInstall.qemu){if(this.qemuImages.filter(o=>o.checksum===t.md5sum).length>0)return!0}else if(this.applianceToInstall.dynamips){if(this.iosImages.filter(o=>o.checksum===t.md5sum).length>0)return!0}else if(this.applianceToInstall.iou&&this.iouImages.filter(o=>o.checksum===t.md5sum).length>0)return!0;return!1}getVersionImageCount(e){let t=e.images,o=0;return t.bios_image&&o++,t.hda_disk_image&&o++,t.hdb_disk_image&&o++,t.hdc_disk_image&&o++,t.hdd_disk_image&&o++,t.cdrom_image&&o++,o}getVersionReadyCount(e){let t=e.images,o=0;return t.bios_image&&this.checkImageFromVersion(t.bios_image)&&o++,t.hda_disk_image&&this.checkImageFromVersion(t.hda_disk_image)&&o++,t.hdb_disk_image&&this.checkImageFromVersion(t.hdb_disk_image)&&o++,t.hdc_disk_image&&this.checkImageFromVersion(t.hdc_disk_image)&&o++,t.hdd_disk_image&&this.checkImageFromVersion(t.hdd_disk_image)&&o++,t.cdrom_image&&this.checkImageFromVersion(t.cdrom_image)&&o++,o}isVersionComplete(e){return this.getVersionReadyCount(e)===this.getVersionImageCount(e)}openConfirmationDialog(e,t){let o=this.dialog.open(Vv,{autoFocus:!1,disableClose:!0,panelClass:["base-confirmation-dialog-panel","information-dialog-panel"]});o.componentInstance.confirmationMessage=e,o.afterClosed().subscribe(r=>{r&&window.open(t)})}downloadImage(e){let t="Download will redirect you where the required file can be downloaded, you may have to be registered with the vendor in order to download the file.",o=`The file is compressed with ${e.compression}, it must be uncompressed first.`;e.direct_download_url?e.compression?this.openConfirmationDialog(o,e.direct_download_url):window.open(e.direct_download_url):this.openConfirmationDialog(t,e.download_url)}downloadImageFromVersion(e){this.applianceToInstall.images.forEach(t=>{t.filename===e&&this.downloadImage(t)})}getCategory(){return this.applianceToInstall.category==="multilayer_switch"?"switch":this.applianceToInstall.category}createIouTemplate(e){let t=e.filename,o=this.applianceToInstall.images.filter(p=>p.filename===t)[0],r=this.iouImages.filter(p=>p.checksum===o.md5sum);r.length>0&&(t=r[0].filename);let a=new Im;a.nvram=this.applianceToInstall.iou.nvram,a.ram=this.applianceToInstall.iou.ram,a.ethernet_adapters=this.applianceToInstall.iou.ethernet_adapters,a.serial_adapters=this.applianceToInstall.iou.serial_adapters,a.startup_config=this.applianceToInstall.iou.startup_config,a.category=this.getCategory(),a.default_name_format=this.applianceToInstall.default_name_format,a.symbol=this.applianceToInstall.symbol,a.tags=this.applianceToInstall.tags||[],a.compute_id="local",a.template_id=Ai(),a.path=t,a.template_type="iou";let c=this.dialog.open(Nu,{width:"400px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","simple-dialog-panel","template-name-dialog-panel"],data:{name:this.applianceToInstall.name}});c.componentInstance.controller=this.controller,c.afterClosed().subscribe(p=>{if(p)a.name=p,this.iouService.addTemplate(this.controller,a).subscribe({next:u=>{this.templateService.newTemplateCreated.next(u),this.toasterService.success("Template added"),this.dialogRef.close()},error:u=>{let h=u.error?.message||u.message||"Failed to add template";this.toasterService.error(h),this.changeDetector.markForCheck()}});else return!1})}createIosTemplate(e){let t=e.filename,o=this.applianceToInstall.images.filter(p=>p.filename===t)[0],r=this.iosImages.filter(p=>p.checksum===o.md5sum);r.length>0&&(t=r[0].filename);let a=new Dm;a.chassis=this.applianceToInstall.dynamips.chassis,a.nvram=this.applianceToInstall.dynamips.nvram,a.platform=this.applianceToInstall.dynamips.platform,a.ram=this.applianceToInstall.dynamips.ram,a.startup_config=this.applianceToInstall.dynamips.startup_config,a.slot0=this.applianceToInstall.dynamips.slot0,a.slot1=this.applianceToInstall.dynamips.slot1,a.slot2=this.applianceToInstall.dynamips.slot2,a.slot3=this.applianceToInstall.dynamips.slot3,a.slot4=this.applianceToInstall.dynamips.slot4,a.slot5=this.applianceToInstall.dynamips.slot5,a.slot6=this.applianceToInstall.dynamips.slot6,a.slot7=this.applianceToInstall.dynamips.slot7,a.category=this.getCategory(),a.default_name_format=this.applianceToInstall.default_name_format,a.symbol=this.applianceToInstall.symbol,a.tags=this.applianceToInstall.tags||[],a.compute_id="local",a.template_id=Ai(),a.image=t,a.template_type="dynamips";let c=this.dialog.open(Nu,{width:"400px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","simple-dialog-panel","template-name-dialog-panel"],data:{name:this.applianceToInstall.name}});c.componentInstance.controller=this.controller,c.afterClosed().subscribe(p=>{if(p)a.name=p,this.iosService.addTemplate(this.controller,a).subscribe({next:u=>{this.templateService.newTemplateCreated.next(u),this.toasterService.success("Template added"),this.dialogRef.close()},error:u=>{let h=u.error?.message||u.message||"Failed to add template";this.toasterService.error(h),this.changeDetector.markForCheck()}});else return!1})}createDockerTemplate(){let e=new lg;e.adapters=this.applianceToInstall.docker.adapters,e.console_type=this.applianceToInstall.docker.console_type,e.category=this.getCategory(),e.default_name_format=this.applianceToInstall.default_name_format,e.symbol=this.applianceToInstall.symbol,e.tags=this.applianceToInstall.tags||[],e.compute_id="local",e.template_id=Ai(),e.image=this.applianceToInstall.docker.image,e.template_type="docker";let t=this.dialog.open(Nu,{width:"400px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","simple-dialog-panel","template-name-dialog-panel"],data:{name:this.applianceToInstall.name}});t.componentInstance.controller=this.controller,t.afterClosed().subscribe(o=>{if(o)e.name=o,this.dockerService.addTemplate(this.controller,e).subscribe({next:r=>{this.templateService.newTemplateCreated.next(r),this.toasterService.success("Template added"),this.dialogRef.close()},error:r=>{let a=r.error?.message||r.message||"Failed to add template";this.toasterService.error(a),this.changeDetector.markForCheck()}});else return!1})}findControllerImageName(e){if(e){let t=this.applianceToInstall.images.filter(r=>r.filename===e)[0],o=this.qemuImages.filter(r=>r.checksum===t.md5sum);o.length>0&&(e=o[0].filename)}return e}createQemuTemplateFromVersion(e){let t=new Am;t.ram=this.applianceToInstall.qemu.ram,t.adapters=this.applianceToInstall.qemu.adapters,t.adapter_type=this.applianceToInstall.qemu.adapter_type,t.boot_priority=this.applianceToInstall.qemu.boot_priority,t.console_type=this.applianceToInstall.qemu.console_type,t.hda_disk_interface=this.applianceToInstall.qemu.hda_disk_interface,t.hdb_disk_interface=this.applianceToInstall.qemu.hdb_disk_interface,t.hdc_disk_interface=this.applianceToInstall.qemu.hdc_disk_interface,t.hdd_disk_interface=this.applianceToInstall.qemu.hdd_disk_interface,t.category=this.getCategory(),t.first_port_name=this.applianceToInstall.first_port_name,t.port_name_format=this.applianceToInstall.port_name_format,t.port_segment_size=this.applianceToInstall.port_segment_size,t.default_name_format=this.applianceToInstall.default_name_format,t.symbol=this.applianceToInstall.symbol,t.tags=this.applianceToInstall.tags||[],t.compute_id="local",t.template_id=Ai(),t.hda_disk_image=this.findControllerImageName(e.images.hda_disk_image),t.hdb_disk_image=this.findControllerImageName(e.images.hdb_disk_image),t.hdc_disk_image=this.findControllerImageName(e.images.hdc_disk_image),t.hdd_disk_image=this.findControllerImageName(e.images.hdd_disk_image),t.cdrom_image=this.findControllerImageName(e.images.cdrom_image),t.template_type="qemu",t.usage=this.applianceToInstall.usage,t.platform=this.applianceToInstall.qemu.arch;let o=this.dialog.open(Nu,{width:"400px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","simple-dialog-panel","template-name-dialog-panel"],data:{name:this.applianceToInstall.name}});o.componentInstance.controller=this.controller,o.afterClosed().subscribe(r=>{if(r)t.name=r,this.qemuService.addTemplate(this.controller,t).subscribe({next:a=>{this.templateService.newTemplateCreated.next(a),this.toasterService.success("Template added"),this.dialogRef.close()},error:a=>{let c=a.error?.message||a.message||"Failed to add template";this.toasterService.error(c),this.changeDetector.markForCheck()}});else return!1})}computeChecksumMd5(e,t=!1){return new Promise((o,r)=>{let c=new p9.ArrayBuffer,p=new FileReader,u=0;p.onerror=function(){r("MD5 computation failed - error reading the file")};function h(_){let S=Math.min(e.size,_+2097152);p.readAsArrayBuffer(e.slice(_,S))}p.onload=function(_){c.append(_.target.result),u+=2097152,u<e.size?h(u):o(c.end(t))},h(0)})}openSnackBar(){this.snackBar.openFromComponent(fl,{panelClass:"uplaoding-file-snackabar",data:{upload_file_type:"Image"}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-new-template-dialog"]],viewQuery:function(t,o){t&1&&Xt(o.paginator,hr,5)(o.stepper,yye,5),t&2&&Kt(2)},inputs:{controller:"controller",project:"project",searchText:[1,"searchText"],category:[1,"category"],emulator:[1,"emulator"],vendor:[1,"vendor"]},outputs:{searchText:"searchTextChange",category:"categoryChange",emulator:"emulatorChange",vendor:"vendorChange"},decls:31,vars:6,consts:[["stepper",""],["categoryAuto","matAutocomplete"],["emulatorAuto","matAutocomplete"],["vendorAuto","matAutocomplete"],["file",""],["fileBios",""],["menuBios","matMenu"],["file2",""],["menuHda","matMenu"],["file3",""],["menuHdb","matMenu"],["file4",""],["menuHdc","matMenu"],["file5",""],["menuHdd","matMenu"],["file6",""],["menuCdrom","matMenu"],["menuIos","matMenu"],["fileiou",""],["menuIou","matMenu"],["mat-dialog-title","",1,"new-template__title"],[1,"new-template__stepper",3,"linear"],[1,"new-template__step"],["matStepLabel","",1,"new-template__step-label"],[1,"new-template__content"],[1,"new-template__radio-group",3,"change","value"],["value","install",1,"new-template__radio-button"],["value","import","disabled","",1,"new-template__radio-button"],[1,"new-template__feature-unavailable"],[1,"new-template__actions"],["mat-button","","matStepperNext",""],["mat-button","",3,"click"],[1,"new-template__import-area"],["mat-button","","matStepperPrevious",""],["mat-button","",1,"new-template__update-button",3,"disabled"],[1,"new-template__table-header"],[1,"new-template__filter-row"],["appearance","fill",1,"new-template__filter-field"],["matInput","",3,"input","value"],["mat-icon-button","","matSuffix",""],[1,"new-template__filter-controls-row"],["appearance","fill",1,"new-template__category-field"],["matInput","",3,"formControl","matAutocomplete"],[3,"optionSelected"],[3,"value"],["appearance","fill",1,"new-template__emulator-field"],["appearance","fill",1,"new-template__vendor-field"],[1,"new-template__table-container"],["matSort","",1,"new-template__table",3,"matSortChange","dataSource"],["matColumnDef","name"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","emulator"],["matColumnDef","vendor"],["matColumnDef","actions"],[4,"matHeaderCellDef"],["class","new-template__actions-cell",4,"matCellDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["mat-icon-button","","matSuffix","",3,"click"],["mat-sort-header",""],[1,"new-template__actions-cell"],["mat-icon-button","","matTooltip","Install","matTooltipClass","custom-tooltip",3,"click"],["mat-icon-button","","matTooltip","Show info","matTooltipClass","custom-tooltip",3,"click"],["type","file","accept",".gns3appliance, .gns3a","ng2FileSelect","",1,"new-template__file-input",3,"change","uploader"],["mat-raised-button","","color","primary",1,"new-template__import-button",3,"click"],["mat-button","",1,"new-template__update-button",3,"click","disabled"],["diameter","20"],[1,"new-template__install-section"],[1,"new-template__section-header"],["mat-icon-button","","matTooltip","Refresh list of images","matTooltipClass","custom-tooltip",3,"click"],["multi","true",1,"new-template__version-accordion"],[2,"display","flex","align-items","center","justify-content","space-between","width","100%","padding-right","16px"],[2,"font-weight","500"],[1,"new-template__version-summary"],[1,"new-template__version-count"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"new-template__version-content"],[1,"new-template__image-item",3,"new-template__image-item--installed","new-template__image-item--missing"],[1,"new-template__image-item"],[1,"new-template__image-name"],[1,"new-template__image-status"],[1,"new-template__status-badge","new-template__status-badge--ready"],[1,"new-template__status-badge","new-template__status-badge--missing"],[1,"new-template__action-group"],["type","file","ng2FileSelect","",1,"new-template__file-input",3,"change","uploader"],["mat-stroked-button","",1,"new-template__more-menu",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],[1,"new-template__upload-progress"],[1,"new-template__progress-info"],[1,"new-template__progress-text"],[1,"new-template__progress-percentage"],["mode","determinate",3,"value"],["mat-button","",1,"new-template__cancel-button",3,"click"],["mat-raised-button","","color","primary",1,"new-template__create-button",3,"click"],[1,"new-template__image-list"],[1,"new-template__list-item"],["mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",20),d(1,"Add new template"),l(),s(2,"mat-horizontal-stepper",21,0)(4,"mat-step",22),xe(5,Mye,1,0,"ng-template",23),s(6,"mat-dialog-content",24)(7,"mat-radio-group",25),g("change",function(a){return o.setAction(a.value)}),s(8,"mat-radio-button",26),d(9," Install new appliance from the GNS controller "),l(),s(10,"mat-radio-button",27),d(11," Import an appliance file "),s(12,"span",28),d(13,"(Feature not complete)"),l()()()(),s(14,"mat-dialog-actions",29)(15,"button",30),d(16,"Next"),l(),s(17,"button",31),g("click",function(){return o.onCloseClick()}),d(18,"Cancel"),l()()(),s(19,"mat-step",22),xe(20,kye,1,1,"ng-template",23),s(21,"mat-dialog-content",24),A(22,Uye,52,16),A(23,Gye,5,1,"div",32),l(),s(24,"mat-dialog-actions",29)(25,"button",33),d(26,"Back"),l(),A(27,Qye,3,2,"button",34),s(28,"button",31),g("click",function(){return o.onCloseClick()}),d(29,"Cancel"),l()()(),A(30,OSe,12,4,"mat-step",22),l()),t&2&&(m(2),C("linear",!1),m(5),C("value",o.action),m(15),O(o.action==="install"?22:-1),m(),O(o.action==="import"?23:-1),m(4),O(o.action==="install"?27:-1),m(3),O(o.applianceToInstall?30:-1))},dependencies:[ne,_e,Ne,Fe,bt,io,xo,ho,W,pe,je,ul,Hl,A0,Ul,I8,A8,Mt,we,Me,et,Mi,vt,_t,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,sg,hr,ar,mo,Tr,Se,Ee,ms,Rc,pn,li,Ot,cl,km,kd,Td,Mm,ie,de,Ge,Qn,Ze,Fn,Yr,Sa,Ko,sl,Ac,Xe,Ft,Pt,Dt,Hs],styles:[".new-template__title[_ngcontent-%COMP%]{margin:0;padding:24px 24px 16px;font-size:18px;font-weight:500;color:var(--mat-sys-on-surface)}.new-template__stepper[_ngcontent-%COMP%], .new-template__step[_ngcontent-%COMP%]{background:transparent}.new-template__step-label[_ngcontent-%COMP%]{font-size:14px}.new-template__content[_ngcontent-%COMP%]{padding:16px 24px;max-height:60vh;overflow-y:auto}.new-template__radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.new-template__radio-button[_ngcontent-%COMP%]{font-size:14px}.new-template__feature-unavailable[_ngcontent-%COMP%]{margin-left:8px;font-size:13px;font-style:italic;color:var(--mat-sys-on-surface-variant);opacity:.8}.new-template__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;padding:16px 24px 24px;gap:12px}.new-template__table-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.new-template__filter-row[_ngcontent-%COMP%]{display:flex;width:100%}.new-template__filter-controls-row[_ngcontent-%COMP%]{display:flex;gap:16px;flex-wrap:wrap}.new-template__filter-field[_ngcontent-%COMP%]{flex:1;width:100%}.new-template__filter-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;height:18px;width:18px}.new-template__category-field[_ngcontent-%COMP%], .new-template__emulator-field[_ngcontent-%COMP%], .new-template__vendor-field[_ngcontent-%COMP%]{flex:1;min-width:160px}.new-template__category-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .new-template__emulator-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .new-template__vendor-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;height:18px;width:18px}.new-template__table-container[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:12px;overflow:hidden}.new-template__table[_ngcontent-%COMP%]{width:100%}.new-template__actions-cell[_ngcontent-%COMP%]{text-align:right;justify-content:flex-end}.new-template__import-area[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;background:var(--mat-sys-surface);border-radius:12px;border:2px dashed var(--mat-sys-outline-variant)}.new-template__import-button[_ngcontent-%COMP%]{margin-top:16px}.new-template__file-input[_ngcontent-%COMP%]{display:none}.new-template__install-section[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:12px;padding:16px}.new-template__section-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface)}.new-template__create-button[_ngcontent-%COMP%]{width:100%}.new-template__version-accordion[_ngcontent-%COMP%]{margin-bottom:12px}.new-template__version-accordion[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{border-radius:12px;margin-bottom:8px;box-shadow:0 1px 3px color-mix(in srgb,var(--mat-sys-shadow) 8%,transparent);transition:all .2s cubic-bezier(.4,0,.2,1)}.new-template__version-accordion[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]:hover{box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 12%,transparent)}.new-template__version-accordion[_ngcontent-%COMP%] mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{margin-bottom:16px}.new-template__version-accordion[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 16px;height:56px}.new-template__version-accordion[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container-low)}.new-template__version-accordion[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .mat-content[_ngcontent-%COMP%]{display:flex;align-items:center}.new-template__version-summary[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin-left:12px;font-size:13px;color:var(--mat-sys-on-surface-variant)}.new-template__version-count[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:2px 8px;border-radius:12px;background:var(--mat-sys-surface-container-highest);font-size:12px;font-weight:500}.new-template__version-count--complete[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}.new-template__version-count--partial[_ngcontent-%COMP%]{background:var(--mat-sys-tertiary-container);color:var(--mat-sys-on-tertiary-container)}.new-template__version-content[_ngcontent-%COMP%]{padding:0 16px 16px}.new-template__version-summary[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.new-template__version-item[_ngcontent-%COMP%]{margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--mat-sys-outline-variant)}.new-template__version-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.new-template__version-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.new-template__version-name[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface)}.new-template__image-list[_ngcontent-%COMP%]{padding:0}.new-template__list-item[_ngcontent-%COMP%]{height:auto;min-height:48px;padding:8px 0}.new-template__image-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;width:100%;background:var(--mat-sys-surface-container-low);border:1px solid var(--mat-sys-outline-variant);border-radius:12px;padding:12px 16px;transition:all .2s cubic-bezier(.4,0,.2,1)}.new-template__image-item[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container);box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.new-template__image-item--installed[_ngcontent-%COMP%]{border-left:4px solid var(--mat-sys-primary)}.new-template__image-item--missing[_ngcontent-%COMP%]{border-left:4px solid var(--mat-sys-tertiary)}.new-template__image-name[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface);word-break:break-word}.new-template__image-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.new-template__status-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:16px;font-size:13px;font-weight:500}.new-template__status-badge[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;height:18px;width:18px}.new-template__status-badge--ready[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}.new-template__status-badge--missing[_ngcontent-%COMP%]{background:var(--mat-sys-error-container);color:var(--mat-sys-on-error-container)}.new-template__action-group[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.new-template__action-buttons[_ngcontent-%COMP%]{display:flex;gap:8px}.new-template__more-menu[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;height:20px;width:20px}.new-template__upload-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:12px 16px;background:var(--mat-sys-primary-container);border-radius:8px;margin-top:12px}.new-template__upload-progress[_ngcontent-%COMP%] mat-progress-bar[_ngcontent-%COMP%]{height:4px;border-radius:2px}.new-template__progress-info[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--mat-sys-on-primary-container)}.new-template__progress-text[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.new-template__progress-text[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;height:18px;width:18px;animation:_ngcontent-%COMP%_spin 1s linear infinite}.new-template__progress-percentage[_ngcontent-%COMP%]{font-weight:500}.new-template__cancel-button[_ngcontent-%COMP%]{min-width:auto;padding:4px 8px;font-size:12px}.new-template__update-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;min-width:200px;justify-content:center}.new-template__update-button[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media(max-width:640px){.new-template__title[_ngcontent-%COMP%]{padding:16px 16px 12px;font-size:18px}.new-template__content[_ngcontent-%COMP%]{padding:12px 16px;max-height:50vh}.new-template__filter-controls-row[_ngcontent-%COMP%]{flex-direction:column;gap:12px}.new-template__category-field[_ngcontent-%COMP%], .new-template__emulator-field[_ngcontent-%COMP%], .new-template__vendor-field[_ngcontent-%COMP%]{width:100%}.new-template__actions[_ngcontent-%COMP%]{padding:12px 16px 16px;flex-direction:column}.new-template__version-header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:8px}}"],data:{animation:[eD("detailExpand",[vb("collapsed",ou({height:"0px",minHeight:"0",visibility:"hidden"})),vb("expanded",ou({height:"*",visibility:"visible"})),nD("expanded <=> collapsed",tD("225ms cubic-bezier(0.4, 0.0, 0.2, 1)"))])]},changeDetection:0})}return n})();function qA(n,i,e){return n=n.toLowerCase(),i=i.toLowerCase(),(n<i?-1:1)*(e?1:-1)}var p2=(()=>{class n{getDrawingElement(){let e=new _s;return e.height=100,e.width=100,e.fill="#000000",e.fill_opacity=0,e.font_family="Noto Sans",e.font_size=11,e.font_weight="bold",e}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var u2=(()=>{class n{getDrawingElement(){let e=new xi;return e.fill="#ffffff",e.fill_opacity=1,e.stroke="#000000",e.stroke_width=2,e.cx=100,e.cy=100,e.rx=100,e.ry=100,e.width=200,e.height=200,e}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var h2=(()=>{class n{getDrawingElement(){let e=new kr;return e.fill="#ffffff",e.fill_opacity=1,e.stroke="#000000",e.stroke_width=2,e.width=200,e.height=100,e.rx=0,e.ry=0,e}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var f2=(()=>{class n{getDrawingElement(){let e=new Pa;return e.stroke="#000000",e.stroke_width=2,e.x1=0,e.x2=200,e.y1=0,e.y2=0,e.width=100,e.height=0,e.arrow_start=!1,e.arrow_end=!1,e.drawing_type="straight",e.control_offset=[0,0],e}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var g2=(()=>{class n{getDrawingElement(){let e=new ua;return e.stroke="var(--gns3-canvas-link-color)",e.stroke_width=2,e.stroke_dasharray="none",e.points=[{x:0,y:0},{x:100,y:50},{x:200,y:0}],e.curve_type="catmullrom",e.arrow_start=!1,e.arrow_end=!0,e.width=200,e.height=50,e}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var dg=(()=>{class n{textElementFactory;ellipseElementFactory;rectangleElementFactory;lineElementFactory;curveElementFactory;factory;availableFactories;constructor(e,t,o,r,a){this.textElementFactory=e,this.ellipseElementFactory=t,this.rectangleElementFactory=o,this.lineElementFactory=r,this.curveElementFactory=a,this.availableFactories={text:this.textElementFactory,ellipse:this.ellipseElementFactory,rectangle:this.rectangleElementFactory,line:this.lineElementFactory,curve:this.curveElementFactory}}getDrawingMock(e){this.factory=this.availableFactories[e];let t=new Ea;return t.element=this.factory.getDrawingElement(),t}static \u0275fac=function(t){return new(t||n)(ge(p2),ge(u2),ge(h2),ge(f2),ge(g2))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var h9=(()=>{class n{controller=le(void 0);project;selectedDrawing;drawingSaved=new ve;pointToAddSelected;drawingService=f(Ri);drawingsDataSource=f(Ei);drawingsEventSource=f(Uo);drawingsFactory=f(dg);mapDrawingToSvgConverter=f(vs);toasterService=f(te);cdr=f(Q);ngOnInit(){this.pointToAddSelected=this.drawingsEventSource.pointToAddSelected.subscribe(e=>this.onDrawingSaved(e))}ngOnChanges(e){e.selectedDrawing&&!e.selectedDrawing.isFirstChange()&&(this.selectedDrawing=e.selectedDrawing.currentValue,this.selectedDrawing!=="text"&&this.drawingsEventSource.selected.emit(this.selectedDrawing))}onDrawingSaved(e){if(this.selectedDrawing==="curve")return;let t=this.drawingsFactory.getDrawingMock(this.selectedDrawing),o=this.mapDrawingToSvgConverter.convert(t);this.drawingService.add(this.controller(),this.project.project_id,e.x,e.y,o).subscribe({next:r=>{this.drawingsDataSource.add(r),this.drawingSaved.emit(!0)},error:r=>{let a=r.error?.message||r.message||"Failed to create drawing";this.toasterService.error(a),this.cdr.markForCheck()}})}ngOnDestroy(){this.pointToAddSelected.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-drawing-added"]],inputs:{controller:[1,"controller"],project:"project",selectedDrawing:"selectedDrawing"},outputs:{drawingSaved:"drawingSaved"},features:[bn],decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var g9=Bs(f9());function BSe(n,i){n&1&&(s(0,"mat-error"),d(1,"Name for screenshot is required"),l())}var _2=(()=>{class n{dialogRef=f(Ie);toasterService=f(te);formBuilder=f(Vn);cd=f(Q);nameForm;isPngAvailable;filetype="svg";constructor(){this.nameForm=this.formBuilder.group({screenshotName:new Ye(`screenshot-${Date.now()}`,[Ue.required])}),this.isPngAvailable=!0}ngOnInit(){this.cd.markForCheck()}get form(){return this.nameForm.controls}onAddClick(){if(this.nameForm.invalid)return;let e={name:this.nameForm.get("screenshotName").value,filetype:this.filetype};this.dialogRef.close(e)}onNoClick(){this.dialogRef.close()}onKeyDown(e){e.key==="Enter"&&this.onAddClick()}setFiletype(e){this.isPngAvailable&&(this.filetype=e,this.cd.markForCheck())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-screenshot-dialog"]],decls:17,vars:3,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["aria-label","Select file type",1,"radio-group"],["value","1","checked","",3,"click"],["value","2",3,"click","disabled"],[1,"name-form",3,"formGroup"],[1,"name-form"],["matInput","","type","text","formControlName","screenshotName","placeholder","Please enter name",3,"keydown"],["mat-dialog-actions",""],["mat-button","",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Take a screenshot"),l(),s(2,"div",1)(3,"mat-radio-group",2)(4,"mat-radio-button",3),g("click",function(){return o.setFiletype("svg")}),d(5,"SVG"),l(),s(6,"mat-radio-button",4),g("click",function(){return o.setFiletype("png")}),d(7,"PNG"),l()(),s(8,"form",5)(9,"mat-form-field",6)(10,"input",7),g("keydown",function(a){return o.onKeyDown(a)}),l(),A(11,BSe,2,0,"mat-error"),l()()(),s(12,"div",8)(13,"button",9),g("click",function(){return o.onNoClick()}),d(14,"Cancel"),l(),s(15,"button",10),g("click",function(){return o.onAddClick()}),d(16,"Take a screenshot"),l()()),t&2&&(m(6),C("disabled",!o.isPngAvailable),m(2),C("formGroup",o.nameForm),m(3),O(o.form.screenshotName!=null&&o.form.screenshotName.touched&&(o.form.screenshotName!=null&&o.form.screenshotName.errors)&&(o.form.screenshotName!=null&&o.form.screenshotName.errors.required)?11:-1))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,Se,Ee,Me,fi,Mt,io,xo,ho,Dt,at,Ft,Pt,rt,Rt,zt],styles:[".name-form[_ngcontent-%COMP%]{width:100%;margin-top:16px}.radio-group[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;gap:24px}"],changeDetection:0})}return n})();var v2=(()=>{class n{data;dialogRef=f(Ie);confirmActionData={actionType:"Unlock",isAction:!1};constructor(e){this.data=e}ngOnInit(){this.confirmActionData.actionType=this.data.actionType}confirmAction(){this.confirmActionData.isAction=this.data.actionType=="Lock",this.dialogRef.close(this.confirmActionData)}onNoClick(){this.dialogRef.close(!1)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-project-map-lock-confirmation-dialog"]],decls:10,vars:2,consts:[["mat-dialog-title",""],[2,"display","flex","justify-content","flex-end","gap","8px","padding","16px"],["mat-button","",3,"click"],["mat-button","","cdkFocusInitial","",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content")(3,"p"),d(4),l()(),s(5,"div",1)(6,"button",2),g("click",function(){return o.onNoClick()}),d(7,"No"),l(),s(8,"button",3),g("click",function(){return o.confirmAction()}),d(9,"Yes"),l()()),t&2&&(m(),ee("Confirm ",o.confirmActionData.actionType," All"),m(3),ee("Are you sure you want to ",o.confirmActionData.actionType," all devices?"))},dependencies:[_e,Ne,bt,W,pe],encapsulation:2,changeDetection:0})}return n})();var mg=(()=>{class n{currentProjectId$=new an(null);currentSessionId$=new an(null);sessions$=new an([]);messagesMap=new Map;messages$=new an(new Map);isStreaming$=new an(!1);currentToolCalls$=new an(new Map);error$=new an(null);panelState$=new an({isOpen:!1,width:800,height:900,isMaximized:!1,isMinimized:!1,position:{top:80,right:20}});sessionUIStateMap=new Map;sessionUIStates$=new an(new Map);constructor(){this.loadPanelState()}setCurrentProjectId(e){this.currentProjectId$.next(e),e&&(this.messagesMap.clear(),this.messages$.next(new Map),this.sessions$.next([]))}getCurrentProjectId(){return this.currentProjectId$.asObservable()}getCurrentProjectIdValue(){return this.currentProjectId$.value}setCurrentSessionId(e){this.currentSessionId$.next(e)}getCurrentSessionId(){return this.currentSessionId$.asObservable()}getCurrentSessionIdValue(){return this.currentSessionId$.value}setSessions(e){this.sessions$.next(e)}getSessions(){return this.sessions$.asObservable()}getSessionsValue(){return this.sessions$.value}addSession(e){let t=this.sessions$.value;this.sessions$.next([e,...t])}updateSession(e){let t=this.sessions$.value,o=t.findIndex(r=>r.thread_id===e.thread_id);if(o!==-1){let r=[...t];r[o]=e,this.sessions$.next(r)}}deleteSession(e){let t=this.sessions$.value;this.sessions$.next(t.filter(o=>o.thread_id!==e)),this.messagesMap.delete(e),this.messages$.next(new Map(this.messagesMap)),this.currentSessionId$.value===e&&this.currentSessionId$.next(null)}getMessages(e){return new Dr(t=>{let o=e||this.currentSessionId$.value;if(!o){t.next([]);return}let r=this.messagesMap.get(o)||[];t.next(r)})}getMessagesValue(e){let t=e||this.currentSessionId$.value;return t?this.messagesMap.get(t)||[]:[]}setMessages(e,t){this.messagesMap.set(e,t),this.messages$.next(new Map(this.messagesMap))}addMessage(e,t){let o=this.messagesMap.get(e)||[];this.messagesMap.set(e,[...o,t]),this.messages$.next(new Map(this.messagesMap))}updateLastMessage(e,t){let o=this.messagesMap.get(e);if(o&&o.length>0){let r=o[o.length-1],a=[...o];a[a.length-1]=it(K({},r),{content:r.content+t}),this.messagesMap.set(e,a),this.messages$.next(new Map(this.messagesMap))}}clearMessages(e){this.messagesMap.delete(e),this.messages$.next(new Map(this.messagesMap))}setStreamingState(e){this.isStreaming$.next(e)}getStreamingState(){return this.isStreaming$.asObservable()}getStreamingStateValue(){return this.isStreaming$.value}setCurrentToolCalls(e){this.currentToolCalls$.next(new Map(e))}addOrUpdateToolCall(e){let t=new Map(this.currentToolCalls$.value);t.set(e.id,e),this.currentToolCalls$.next(t)}removeToolCall(e){let t=new Map(this.currentToolCalls$.value);t.delete(e),this.currentToolCalls$.next(t)}clearToolCalls(){this.currentToolCalls$.next(new Map)}getCurrentToolCalls(){return this.currentToolCalls$.asObservable()}getCurrentToolCallsValue(){return this.currentToolCalls$.value}setError(e){this.error$.next(e)}getError(){return this.error$.asObservable()}clearError(){this.error$.next(null)}setPanelState(e){let t=this.panelState$.value,o=K(K({},t),e);this.panelState$.next(o),this.savePanelState(o)}getPanelState(){return this.panelState$.asObservable()}getPanelStateValue(){return this.panelState$.value}openPanel(){let e=this.panelState$.value;this.panelState$.next(it(K({},e),{isOpen:!0})),this.savePanelState(this.panelState$.value)}closePanel(){let e=this.panelState$.value;this.panelState$.next(it(K({},e),{isOpen:!1})),this.savePanelState(this.panelState$.value)}maximizePanel(){let e=this.panelState$.value;this.panelState$.next(it(K({},e),{isMaximized:!0,isMinimized:!1})),this.savePanelState(this.panelState$.value)}minimizePanel(){let e=this.panelState$.value;this.panelState$.next(it(K({},e),{isMaximized:!1,isMinimized:!0})),this.savePanelState(this.panelState$.value)}restorePanel(){let e=this.panelState$.value;this.panelState$.next(it(K({},e),{isMaximized:!1,isMinimized:!1})),this.savePanelState(this.panelState$.value)}updatePanelPosition(e){let t=this.panelState$.value,o=K(K({},t.position),e);this.panelState$.next(it(K({},t),{position:o})),this.savePanelState(this.panelState$.value)}updatePanelSize(e,t){let o=this.panelState$.value;this.panelState$.next(it(K({},o),{width:e,height:t})),this.savePanelState(this.panelState$.value)}savePanelState(e){try{localStorage.setItem("ai-chat-panel-state",JSON.stringify(e))}catch(t){console.error("Failed to save panel state:",t)}}loadPanelState(){try{let e=localStorage.getItem("ai-chat-panel-state");if(e){let t=JSON.parse(e);t.isOpen=!1,t.isMaximized=!1,t.isMinimized=!1,this.panelState$.next(t)}}catch(e){console.error("Failed to load panel state:",e)}}setSessionUIState(e,t){let o=new Map(this.sessionUIStateMap),r=o.get(e)||{isEditing:!1,isExpanded:!0},a=K(K({},r),t);o.set(e,a),this.sessionUIStateMap=o,this.sessionUIStates$.next(new Map(o))}getSessionUIState(e){return new Dr(t=>{t.next(this.sessionUIStateMap.get(e))})}getSessionUIStateValue(e){return this.sessionUIStateMap.get(e)}resetAll(){this.currentProjectId$.next(null),this.currentSessionId$.next(null),this.sessions$.next([]),this.messagesMap.clear(),this.messages$.next(new Map),this.isStreaming$.next(!1),this.currentToolCalls$.next(new Map),this.error$.next(null),this.sessionUIStateMap.clear(),this.sessionUIStates$.next(new Map)}resetSessionState(){this.currentSessionId$.next(null),this.messagesMap.clear(),this.messages$.next(new Map),this.isStreaming$.next(!1),this.currentToolCalls$.next(new Map),this.error$.next(null)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var XA=n=>({selected:n}),zSe=(n,i)=>({unmarkedLight:n,marked:i}),jSe=n=>({unmarkedLight:n});function $Se(n,i){if(n&1){let e=z();s(0,"button",19),g("click",function(){k(e);let o=v();return T(o.addDrawing("line"))}),ei(),s(1,"svg",20),R(2,"line",21),l()()}if(n&2){let e=v();m(2),C("ngClass",dn(1,XA,e.drawTools.isLineChosen))}}function HSe(n,i){if(n&1){let e=z();s(0,"button",19),g("click",function(){k(e);let o=v();return T(o.addDrawing("line"))}),ei(),s(1,"svg",20),R(2,"line",21),l()()}if(n&2){let e=v();m(2),C("ngClass",dn(1,XA,e.drawTools.isLineChosen))}}var pg=(()=>{class n{toolsService=f(gl);mapSettingsService=f(go);drawingService=f(Ri);symbolService=f(ml);dialog=f(nt);themeService=f(ci);projectServices=f(ki);nodeService=f(ut);nodesDataSource=f(di);drawingsDataSource=f(Ei);drawingsEventSource=f(Uo);aiChatStore=f(mg);cdr=f(Q);toaster=f(te);project=le(void 0);controller=le(void 0);aiChatOpened=new ve;nodes=[];drawing=[];selectedDrawing;lock="lock_open";drawTools={isRectangleChosen:!1,isEllipseChosen:!1,isLineChosen:!1,isCurveChosen:!1,isTextChosen:!1};isLocked=!1;isLightThemeEnabled=!1;isAIChatOpen=!1;isAIMinimized=!1;projectSubscriptions=[];aiChatStateSubscription;ngOnInit(){this.themeService.getActualTheme()==="light"?this.isLightThemeEnabled=!0:this.isLightThemeEnabled=!1,this.projectSubscriptions.push(this.projectServices.projectLockIconSubject.subscribe(e=>{e&&this.getAllNodesAndDrawingStatus()})),this.getAllNodesAndDrawingStatus(),this.projectSubscriptions.push(this.drawingsEventSource.drawingCompleted.subscribe(e=>{e==="curve"&&this.resetDrawToolChoice()})),this.aiChatStateSubscription=this.aiChatStore.getPanelState().subscribe(e=>{this.isAIChatOpen=e.isOpen,this.isAIMinimized=e.isMinimized,this.cdr.markForCheck()})}getCssClassForIcon(e){return e==="text"?{unmarkedLight:!this.drawTools.isTextChosen&&this.isLightThemeEnabled,marked:this.drawTools.isTextChosen}:e==="rectangle"?{unmarkedLight:!this.drawTools.isRectangleChosen&&this.isLightThemeEnabled,marked:this.drawTools.isRectangleChosen}:{unmarkedLight:!this.drawTools.isEllipseChosen&&this.isLightThemeEnabled,marked:this.drawTools.isEllipseChosen}}takeScreenshot(){this.dialog.open(_2,{panelClass:["base-dialog-panel","simple-dialog-panel"],autoFocus:!1,disableClose:!0}).afterClosed().subscribe(t=>{t&&this.saveImage(t)})}async saveImage(e){let o=document.getElementById("map").cloneNode(!0),r=document.querySelector(".project-map");if(r){let a=this.resolveBackground(r);a&&(o.style.background=a);let c=this.getCanvasColors(r);this.applyCanvasColors(o,c.label,c.link)}if(await this.processEmbeddedImages(o),e.filetype==="svg"&&this.resolveAllCssVariables(o,r),e.filetype==="png")try{g9.saveSvgAsPng(o,`${e.name}.png`)}catch(a){throw console.error("Failed to save PNG:",a),this.toaster.error("Failed to save screenshot as PNG"),a}else{let c=new XMLSerializer().serializeToString(o),p=new Blob([c],{type:"image/svg+xml"}),u=URL.createObjectURL(p),h=document.createElement("a"),_=!1;try{h.href=u,h.download=`${e.name}.svg`,document.body.appendChild(h),_=!0,h.click()}catch(S){throw console.error("Failed to save SVG:",S),this.toaster.error("Failed to save screenshot as SVG"),S}finally{_&&document.body.removeChild(h),URL.revokeObjectURL(u)}}}resolveBackground(e){let t=window.getComputedStyle(e),o=t.background;if(o&&o!=="none")return o;let r=e.style.getPropertyValue("--gns3-map-bg");if(r&&r.startsWith("var(--")){let a=r.slice(4,-1),c=t.getPropertyValue(a).trim();if(c)return c}return null}getCanvasColors(e){let t=window.getComputedStyle(e),o=t.getPropertyValue("--gns3-canvas-label-color").trim(),r=t.getPropertyValue("--gns3-canvas-link-color").trim();return{label:o,link:r}}applyCanvasColors(e,t,o){e.querySelectorAll("text.label").forEach(c=>{c.style.setProperty("fill",t)}),e.querySelectorAll("path.ethernet_link").forEach(c=>{let p=c,u=p.getAttribute("stroke");(!u||u.startsWith("var(--"))&&p.style.setProperty("stroke",o)})}resolveAllCssVariables(e,t){if(!t)return;let o=window.getComputedStyle(t);e.querySelectorAll("*[style]").forEach(c=>{let p=c,u=p.getAttribute("style");if(!u)return;let h=u.replace(/var\(([^)]+)\)/g,(_,S)=>o.getPropertyValue(S).trim()||_);h!==u&&p.setAttribute("style",h)}),e.querySelectorAll("*").forEach(c=>{let p=c;["stroke","fill","color","background","background-color"].forEach(u=>{let h=p.getAttribute(u);if(h&&h.startsWith("var(")){let _=h.match(/var\(([^)]+)\)/)?.[1];if(_){let S=o.getPropertyValue(_).trim();S&&p.setAttribute(u,S)}}})})}async processEmbeddedImages(e){let t=Array.from(e.getElementsByTagName("image"));for(let o=0;o<t.length;o++){let r=t[o],a=r.getAttribute("href")||r.getAttribute("xlink:href");if(a)try{let c;if(a.startsWith("blob:"))c=await(await(await fetch(a)).blob()).text();else{let p=a.split("/symbols/");if(p.length>1){let u=p[p.length-1].replace("/raw",""),h=await this.symbolService.raw(this.controller(),u).toPromise();h&&(c=h.includes("-->")?h.split("-->")[1].trim():h.trim())}}if(c){let h=new DOMParser().parseFromString(c,"image/svg+xml").documentElement,_=e.ownerDocument.importNode(h,!0);if(_.nodeName!=="svg"){let b=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","svg");for(b.setAttribute("xmlns","http://www.w3.org/2000/svg");_.firstChild;)b.appendChild(_.firstChild);_=b}let S=r.getAttribute("width"),x=r.getAttribute("height");_.setAttribute("width",S||"60"),_.setAttribute("height",x||"60"),_.setAttribute("x",r.getAttribute("x")||"0"),_.setAttribute("y",r.getAttribute("y")||"0"),r.parentNode.replaceChild(_,r)}}catch(c){console.warn(`Failed to process embedded image: ${a}`,c)}}}addDrawing(e){let t=document.getElementById("map");switch(e==="rectangle"&&this.drawTools.isRectangleChosen||e==="ellipse"&&this.drawTools.isEllipseChosen||e==="line"&&this.drawTools.isLineChosen||e==="curve"&&this.drawTools.isCurveChosen||e==="text"&&this.drawTools.isTextChosen?(document.documentElement.style.cursor="default",t&&(t.style.cursor="default")):(document.documentElement.style.cursor="crosshair",t&&(t.style.cursor="crosshair")),e){case"rectangle":this.drawTools.isTextChosen=!1,this.drawTools.isEllipseChosen=!1,this.drawTools.isRectangleChosen=!this.drawTools.isRectangleChosen,this.drawTools.isLineChosen=!1;break;case"ellipse":this.drawTools.isTextChosen=!1,this.drawTools.isEllipseChosen=!this.drawTools.isEllipseChosen,this.drawTools.isRectangleChosen=!1,this.drawTools.isLineChosen=!1;break;case"line":this.drawTools.isTextChosen=!1,this.drawTools.isEllipseChosen=!1,this.drawTools.isRectangleChosen=!1,this.drawTools.isLineChosen=!this.drawTools.isLineChosen;break;case"curve":this.drawTools.isTextChosen=!1,this.drawTools.isEllipseChosen=!1,this.drawTools.isRectangleChosen=!1,this.drawTools.isLineChosen=!1,this.drawTools.isCurveChosen=!this.drawTools.isCurveChosen;break;case"text":this.drawTools.isTextChosen=!this.drawTools.isTextChosen,this.drawTools.isEllipseChosen=!1,this.drawTools.isRectangleChosen=!1,this.drawTools.isLineChosen=!1,this.toolsService.textAddingToolActivation(this.drawTools.isTextChosen);break}this.selectedDrawing=this.selectedDrawing===e?"":e}onDrawingSaved(){this.resetDrawToolChoice()}resetDrawToolChoice(){let e=document.getElementById("map");document.documentElement.style.cursor="default",e&&(e.style.cursor="default"),this.drawTools.isRectangleChosen=!1,this.drawTools.isEllipseChosen=!1,this.drawTools.isLineChosen=!1,this.drawTools.isCurveChosen=!1,this.drawTools.isTextChosen=!1,this.selectedDrawing="",this.toolsService.textAddingToolActivation(this.drawTools.isTextChosen)}getAllNodesAndDrawingStatus(){let e=this.controller(),t=this.project();!e||!t||!t.project_id||(this.projectServices.getProjectStatus(e,t.project_id).subscribe({next:o=>{o?(this.isLocked=!0,this.lock="lock"):(this.isLocked=!1,this.lock="lock_open"),this.cdr.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to get project status";this.toaster.error(r),this.cdr.markForCheck()}}),this.projectServices.nodes(e,t.project_id).subscribe({next:o=>{this.nodes=o,this.nodes.forEach(r=>{this.nodeService.updateNode(e,r).subscribe({next:a=>{this.nodesDataSource.update(a)},error:a=>{let c=a.error?.message||a.message||"Failed to update node";this.toaster.error(c),this.cdr.markForCheck()}})})},error:o=>{let r=o.error?.message||o.message||"Failed to load nodes";this.toaster.error(r),this.cdr.markForCheck()}}),this.projectServices.drawings(this.controller(),this.project().project_id).subscribe({next:o=>{this.drawing=o,this.drawing.forEach(r=>{this.drawingService.update(this.controller(),r).subscribe({next:a=>{this.drawingsDataSource.update(a)},error:a=>{let c=a.error?.message||a.message||"Failed to update drawing";this.toaster.error(c),this.cdr.markForCheck()}})})},error:o=>{let r=o.error?.message||o.message||"Failed to load drawings";this.toaster.error(r),this.cdr.markForCheck()}}))}changeLockValue(){this.dialog.open(v2,{panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],autoFocus:!1,disableClose:!0,data:{actionType:this.isLocked?"Unlock":"Lock"}}).afterClosed().subscribe(t=>{t&&t!=""&&(t.actionType=="Lock"&&t.isAction?(this.isLocked=!0,this.mapSettingsService.changeMapLockValue(this.isLocked),this.cdr.markForCheck(),this.lockAllNode()):(this.isLocked=!1,this.mapSettingsService.changeMapLockValue(this.isLocked),this.cdr.markForCheck(),this.unlockAllNode()))})}lockAllNode(){this.lock="lock",this.isLocked=!0,this.cdr.markForCheck(),this.drawingService.lockAllNodes(this.controller(),this.project()).subscribe({next:e=>{setTimeout(()=>{this.lock="lock",this.isLocked=!0,this.cdr.markForCheck()})},error:e=>{let t=e.error?.message||e.message||"Failed to lock nodes";this.toaster.error(t),this.cdr.markForCheck()}})}unlockAllNode(){this.lock="lock_open",this.isLocked=!1,this.cdr.markForCheck(),this.drawingService.unLockAllNodes(this.controller(),this.project()).subscribe({next:e=>{setTimeout(()=>{this.lock="lock_open",this.isLocked=!1,this.cdr.markForCheck()})},error:e=>{let t=e.error?.message||e.message||"Failed to unlock nodes";this.toaster.error(t),this.cdr.markForCheck()}})}uploadImageFile(e){this.readImageFile(e.target)}readImageFile(e){let t=e.files[0];if(!t)return;if(t.name.split(".").pop()?.toLowerCase()==="svg"){this.toaster.error("SVG images are not supported. Please use PNG, JPG, GIF or BMP format."),this.cdr.markForCheck();return}let r=new FileReader,a=new Image;r.onloadend=()=>{let c=r.result,p=this.createSvgFileForImage(c,a);this.drawingService.add(this.controller(),this.project().project_id,-(a.width/2),-(a.height/2),p).subscribe({next:()=>{},error:u=>{let h=u.error?.message||u.message||"Failed to add image";this.toaster.error(h),this.cdr.markForCheck()}})},a.onload=()=>{r.readAsDataURL(t)},a.src=window.URL.createObjectURL(t)}createSvgFileForImage(e,t){return`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="${t.height}"
width="${t.width}">
<image height="${t.height}" width="${t.width}" xlink:href="${e}"/>
</svg>`}ngOnDestroy(){this.projectSubscriptions.forEach(e=>e.unsubscribe()),this.aiChatStateSubscription&&this.aiChatStateSubscription.unsubscribe()}openAIChat(){!this.project()||!this.controller()||(this.isAIChatOpen?this.isAIMinimized?this.aiChatStore.restorePanel():this.aiChatStore.minimizePanel():this.aiChatOpened.emit())}openFaultInjection(){!this.project()||!this.controller()||import("./chunk-DIOHTFPG.js").then(({FaultInjectionDialogComponent:e})=>{this.dialog.open(e,{panelClass:["base-dialog-panel","fault-injection-dialog-panel"],backdropClass:"fault-injection-backdrop",autoFocus:!1,disableClose:!0,data:{controller:this.controller(),project:this.project()}}).afterClosed().subscribe(o=>{o&&(console.log("Fault injection completed:",o),o.openAIChat&&this.openAIChat())})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-project-map-menu"]],inputs:{project:[1,"project"],controller:[1,"controller"]},outputs:{aiChatOpened:"aiChatOpened"},decls:34,vars:23,consts:[["file",""],["matTooltip","Add a note","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],[3,"ngClass"],["type","file","accept",".bmp, .jpeg, .jpg, .gif, .png",1,"non-visible",3,"change"],["matTooltip","Insert a picture","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Draw a rectangle","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Draw an ellipse","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Draw a line","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button"],["matTooltip","Draw a curve","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],["height","20","width","20","viewBox","0 0 20 20"],["transform","rotate(20, 10, 10)"],["d","M 6 3 C 12 3, 12 6, 10 6 C 8 6, 6 8, 6 10 C 6 12, 8 14, 10 14 C 12 14, 14 17, 14 17","fill","none","stroke-width","2","stroke","currentColor",1,"draw-line-icon",3,"ngClass"],["matTooltip","Lock or unlock all items","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Take a screenshot","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","AI Assistant","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button","ai-chat-button",3,"click"],[1,"ai-icon"],["matTooltip","Inject Fault","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button","fault-inject-button",3,"click"],[3,"drawingSaved","controller","project","selectedDrawing"],["id","crowbar-workspace"],["matTooltip","Draw a line","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click"],["height","20","width","20"],["x1","15","y1","5","x2","5","y2","15",1,"draw-line-icon",2,"stroke-width","2",3,"ngClass"]],template:function(t,o){if(t&1){let r=z();s(0,"button",1),g("click",function(){return o.addDrawing("text")}),s(1,"mat-icon",2),d(2,"create"),l()(),s(3,"input",3,0),g("change",function(c){return o.uploadImageFile(c)}),l(),s(5,"button",4),g("click",function(){k(r);let c=Pe(4);return T(c.click())}),s(6,"mat-icon"),d(7,"image"),l()(),s(8,"button",5),g("click",function(){return o.addDrawing("rectangle")}),s(9,"mat-icon",2),d(10,"crop_3_2"),l()(),s(11,"button",6),g("click",function(){return o.addDrawing("ellipse")}),s(12,"mat-icon",2),d(13,"panorama_fish_eye"),l()(),A(14,$Se,3,3,"button",7),A(15,HSe,3,3,"button",7),s(16,"button",8),g("click",function(){return o.addDrawing("curve")}),ei(),s(17,"svg",9)(18,"g",10),R(19,"path",11),l()()(),Ir(),s(20,"button",12),g("click",function(){return o.changeLockValue()}),s(21,"mat-icon",2),d(22),l()(),s(23,"button",13),g("click",function(){return o.takeScreenshot()}),s(24,"mat-icon",2),d(25,"photo_camera"),l()(),s(26,"button",14),g("click",function(){return o.openAIChat()}),s(27,"span",15),d(28,"AI"),l()(),s(29,"button",16),g("click",function(){return o.openFaultInjection()}),s(30,"mat-icon"),d(31,"bug_report"),l()(),s(32,"app-drawing-added",17),g("drawingSaved",function(){return o.onDrawingSaved()}),l(),R(33,"div",18)}t&2&&(m(),C("ngClass",o.getCssClassForIcon("text")),m(8),C("ngClass",o.getCssClassForIcon("rectangle")),m(3),C("ngClass",o.getCssClassForIcon("ellipse")),m(2),O(o.isLightThemeEnabled?-1:14),m(),O(o.isLightThemeEnabled?15:-1),m(4),C("ngClass",dn(16,XA,o.drawTools.isCurveChosen)),m(2),C("ngClass",zs(18,zSe,!o.isLocked&&o.isLightThemeEnabled,o.isLocked)),m(),j(o.lock),m(2),C("ngClass",dn(21,jSe,!o.isLocked&&o.isLightThemeEnabled)),m(2),Be("ai-active",o.isAIChatOpen&&!o.isAIMinimized)("ai-minimized",o.isAIChatOpen&&o.isAIMinimized),m(6),C("controller",o.controller())("project",o.project())("selectedDrawing",o.selectedDrawing))},dependencies:[ne,Yi,_e,W,je,ie,de,wt,It,jr,Ge,h9],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center}button.mat-mdc-icon-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;--mdc-icon-button-icon-size: 20px;--mat-icon-button-icon-size: 20px;--mat-icon-button-state-layer-size: 40px;--mdc-icon-button-state-layer-size: 40px}button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;font-size:20px;margin:0}button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:20px;height:20px}.unmarked[_ngcontent-%COMP%], .unmarkedLight[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface)}.marked[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.draw-line-icon.selected[_ngcontent-%COMP%]{stroke:var(--mat-sys-primary)}.non-visible[_ngcontent-%COMP%]{display:none}.draw-line-icon[_ngcontent-%COMP%]{stroke:var(--mat-sys-on-surface)}.ai-chat-button[_ngcontent-%COMP%] .ai-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;font-family:Roboto,sans-serif;letter-spacing:-.5px}.ai-chat-button.ai-active[_ngcontent-%COMP%]{position:relative}.ai-chat-button.ai-active[_ngcontent-%COMP%]:after{content:"";position:absolute;top:4px;right:4px;width:4px;height:4px;background-color:var(--mat-sys-primary-container);border-radius:50%;box-shadow:0 0 8px var(--mat-sys-primary-container)}.ai-chat-button.ai-minimized[_ngcontent-%COMP%]{position:relative;background-color:var(--mat-sys-primary-container)}.ai-chat-button.ai-minimized[_ngcontent-%COMP%] .ai-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary-container);font-weight:900}.fault-inject-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.fault-inject-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-error);filter:drop-shadow(0 0 8px var(--mat-sys-error))}.menu-button[_ngcontent-%COMP%]{transition:transform .1s ease}.menu-button[_ngcontent-%COMP%]:hover{transform:scale(1.3)}'],changeDetection:0})}return n})();var USe=["text"],C2=(()=>{class n{text=Nt("text");dialogRef=f(Ie);projectService=f(ki);sanitizer=f(fr);cdr=f(Q);controller;project;readmeHtml="";ngAfterViewInit(){let e="";this.projectService.getReadmeFile(this.controller,this.project.project_id).subscribe({next:t=>{if(t){e=t;let o=Di(e);this.readmeHtml=this.sanitizer.bypassSecurityTrustHtml(o),this.cdr.markForCheck()}},error:t=>{console.error("Failed to load project readme:",t),this.cdr.markForCheck()}})}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-project-readme"]],viewQuery:function(t,o){t&1&&Xt(o.text,USe,5),t&2&&Kt()},decls:6,vars:1,consts:[["mat-dialog-title",""],[1,"textWrapper","markdown-body",3,"innerHTML"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Project README"),l(),R(2,"div",1),s(3,"div",2)(4,"button",3),g("click",function(){return o.onNoClick()}),d(5,"Close"),l()()),t&2&&(m(2),C("innerHTML",o.readmeHtml,vp))},dependencies:[ne,_e,Ne,Fe,W,pe],styles:[".textWrapper[_ngcontent-%COMP%]{height:500px;overflow-y:scroll}"],changeDetection:0})}return n})();var Fu=typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;function GSe(n){let i=n.cloneNode(!0),e=i.querySelectorAll("[id]"),t=n.nodeName.toLowerCase();return i.removeAttribute("id"),e.forEach(o=>{o.removeAttribute("id")}),t==="canvas"?C9(n,i):(t==="input"||t==="select"||t==="textarea")&&v9(n,i),_9("canvas",n,i,C9),_9("input, textarea, select",n,i,v9),i}function _9(n,i,e,t){let o=i.querySelectorAll(n);if(o.length){let r=e.querySelectorAll(n);for(let a=0;a<o.length;a++)t(o[a],r[a])}}var WSe=0;function v9(n,i){i.type!=="file"&&(i.value=n.value),i.type==="radio"&&i.name&&(i.name=`mat-clone-${i.name}-${WSe++}`)}function C9(n,i){let e=i.getContext("2d");if(e)try{e.drawImage(n,0,0)}catch{}}function w9(n){return n.type.startsWith("touch")}function b9(n,i,e,t){let o={top:n.top,bottom:n.bottom,left:n.left,right:n.right};return i.top&&(o.top+=t),i.bottom&&(o.bottom+=t),i.left&&(o.left+=e),i.right&&(o.right+=e),o.height=o.bottom-o.top,o.width=o.right-o.left,o}function qSe(n,i){let e=0,t=0,o=n.nativeElement.style,a=["transform","-ms-transform","-moz-transform","-o-transform"].map(c=>o[c]).find(c=>!!c);if(a&&a.includes("translate")&&(e=a.replace(/.*translate3?d?\((-?[0-9]*)px, (-?[0-9]*)px.*/,"$1"),t=a.replace(/.*translate3?d?\((-?[0-9]*)px, (-?[0-9]*)px.*/,"$2")),i==="absolute")return{height:n.nativeElement.offsetHeight,width:n.nativeElement.offsetWidth,top:n.nativeElement.offsetTop-t,bottom:n.nativeElement.offsetHeight+n.nativeElement.offsetTop-t,left:n.nativeElement.offsetLeft-e,right:n.nativeElement.offsetWidth+n.nativeElement.offsetLeft-e};{let c=n.nativeElement.getBoundingClientRect();return{height:c.height,width:c.width,top:c.top-t,bottom:c.bottom-t,left:c.left-e,right:c.right-e,scrollTop:n.nativeElement.scrollTop,scrollLeft:n.nativeElement.scrollLeft}}}var x9=Object.freeze({topLeft:"nw-resize",topRight:"ne-resize",bottomLeft:"sw-resize",bottomRight:"se-resize",leftOrRight:"col-resize",topOrBottom:"row-resize"});function y9(n,i){return n.left&&n.top?i.topLeft:n.right&&n.top?i.topRight:n.left&&n.bottom?i.bottomLeft:n.right&&n.bottom?i.bottomRight:n.left||n.right?i.leftOrRight:n.top||n.bottom?i.topOrBottom:""}function b2({edges:n,initialRectangle:i,newRectangle:e}){let t={};return Object.keys(n).forEach(o=>{t[o]=(e[o]||0)-(i[o]||0)}),t}var S9="resize-active",QSe="resize-ghost-element",XSe=50,ec=(()=>{class n{constructor(){this.enableGhostResize=!1,this.resizeSnapGrid={},this.resizeCursors=x9,this.ghostElementPositioning="fixed",this.allowNegativeResizes=!1,this.mouseMoveThrottleMS=XSe,this.resizeStart=new ve,this.resizing=new ve,this.resizeEnd=new ve,this.mouseup=new He,this.mousedown=new He,this.mousemove=new He,this.destroy$=new He,this.platformId=f(Bu),this.renderer=f(Si),this.elm=f(Zt),this.zone=f(Vi),this.rendererFactory=f(sd),this.document=f(Xi),this.pointerEventListeners=KA.getInstance(this.rendererFactory.createRenderer(this.document,null),this.zone)}ngOnInit(){let e=Hn(this.pointerEventListeners.pointerDown,this.mousedown),t=Hn(this.pointerEventListeners.pointerMove,this.mousemove).pipe(Qi(({event:u})=>{r&&u.cancelable&&!w9(u)&&u.preventDefault()}),Dl()),o=Hn(this.pointerEventListeners.pointerUp,this.mouseup),r,a=()=>{r&&r.clonedNode&&(this.elm.nativeElement.parentElement.removeChild(r.clonedNode),this.renderer.setStyle(this.elm.nativeElement,"visibility","inherit"))},c=()=>K(K({},x9),this.resizeCursors);e.pipe(ic(u=>{function h(x){return{clientX:x.clientX-u.clientX,clientY:x.clientY-u.clientY}}let _=()=>{let x={x:1,y:1};return r&&(this.resizeSnapGrid.left&&r.edges.left?x.x=+this.resizeSnapGrid.left:this.resizeSnapGrid.right&&r.edges.right&&(x.x=+this.resizeSnapGrid.right),this.resizeSnapGrid.top&&r.edges.top?x.y=+this.resizeSnapGrid.top:this.resizeSnapGrid.bottom&&r.edges.bottom&&(x.y=+this.resizeSnapGrid.bottom)),x};function S(x,b){return{x:Math.ceil(x.clientX/b.x),y:Math.ceil(x.clientY/b.y)}}return Hn(t.pipe(Ao(1)).pipe(Lt(x=>[,x])),t.pipe(Yv())).pipe(Lt(([x,b])=>[x&&h(x),h(b)])).pipe(ai(([x,b])=>{if(!x)return!0;let M=_(),w=S(x,M),y=S(b,M);return w.x!==y.x||w.y!==y.y})).pipe(Lt(([,x])=>{let b=_();return{clientX:Math.round(x.clientX/b.x)*b.x,clientY:Math.round(x.clientY/b.y)*b.y}})).pipe(tt(Hn(o,e)))})).pipe(ai(()=>!!r)).pipe(Lt(({clientX:u,clientY:h})=>b9(r.startingRect,r.edges,u,h))).pipe(ai(u=>this.allowNegativeResizes||!!(u.height&&u.width&&u.height>0&&u.width>0))).pipe(ai(u=>this.validateResize?this.validateResize({rectangle:u,edges:b2({edges:r.edges,initialRectangle:r.startingRect,newRectangle:u})}):!0),tt(this.destroy$)).subscribe(u=>{r&&r.clonedNode&&(this.renderer.setStyle(r.clonedNode,"height",`${u.height}px`),this.renderer.setStyle(r.clonedNode,"width",`${u.width}px`),this.renderer.setStyle(r.clonedNode,"top",`${u.top}px`),this.renderer.setStyle(r.clonedNode,"left",`${u.left}px`)),this.resizing.observers.length>0&&this.zone.run(()=>{this.resizing.emit({edges:b2({edges:r.edges,initialRectangle:r.startingRect,newRectangle:u}),rectangle:u})}),r.currentRect=u}),e.pipe(Lt(({edges:u})=>u||{}),ai(u=>Object.keys(u).length>0),tt(this.destroy$)).subscribe(u=>{r&&a();let h=qSe(this.elm,this.ghostElementPositioning);r={edges:u,startingRect:h,currentRect:h};let _=c(),S=y9(r.edges,_);this.renderer.setStyle(document.body,"cursor",S),this.setElementClass(this.elm,S9,!0),this.enableGhostResize&&(r.clonedNode=GSe(this.elm.nativeElement),this.elm.nativeElement.parentElement.appendChild(r.clonedNode),this.renderer.setStyle(this.elm.nativeElement,"visibility","hidden"),this.renderer.setStyle(r.clonedNode,"position",this.ghostElementPositioning),this.renderer.setStyle(r.clonedNode,"left",`${r.startingRect.left}px`),this.renderer.setStyle(r.clonedNode,"top",`${r.startingRect.top}px`),this.renderer.setStyle(r.clonedNode,"height",`${r.startingRect.height}px`),this.renderer.setStyle(r.clonedNode,"width",`${r.startingRect.width}px`),this.renderer.setStyle(r.clonedNode,"cursor",y9(r.edges,_)),this.renderer.addClass(r.clonedNode,QSe),r.clonedNode.scrollTop=r.startingRect.scrollTop,r.clonedNode.scrollLeft=r.startingRect.scrollLeft),this.resizeStart.observers.length>0&&this.zone.run(()=>{this.resizeStart.emit({edges:b2({edges:u,initialRectangle:h,newRectangle:h}),rectangle:b9(h,{},0,0)})})}),o.pipe(tt(this.destroy$)).subscribe(()=>{r&&(this.renderer.removeClass(this.elm.nativeElement,S9),this.renderer.setStyle(document.body,"cursor",""),this.renderer.setStyle(this.elm.nativeElement,"cursor",""),this.resizeEnd.observers.length>0&&this.zone.run(()=>{this.resizeEnd.emit({edges:b2({edges:r.edges,initialRectangle:r.startingRect,newRectangle:r.currentRect}),rectangle:r.currentRect})}),a(),r=null)})}ngOnDestroy(){xs(this.platformId)&&this.renderer.setStyle(document.body,"cursor",""),this.mousedown.complete(),this.mouseup.complete(),this.mousemove.complete(),this.destroy$.next()}setElementClass(e,t,o){o?this.renderer.addClass(e.nativeElement,t):this.renderer.removeClass(e.nativeElement,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=ft({type:n,selectors:[["","mwlResizable",""]],inputs:{validateResize:"validateResize",enableGhostResize:"enableGhostResize",resizeSnapGrid:"resizeSnapGrid",resizeCursors:"resizeCursors",ghostElementPositioning:"ghostElementPositioning",allowNegativeResizes:"allowNegativeResizes",mouseMoveThrottleMS:"mouseMoveThrottleMS"},outputs:{resizeStart:"resizeStart",resizing:"resizing",resizeEnd:"resizeEnd"},exportAs:["mwlResizable"]})}}return n})(),KA=class n{static getInstance(i,e){return n.instance||(n.instance=new n(i,e)),n.instance}constructor(i,e){this.pointerDown=new Dr(t=>{let o,r;return e.runOutsideAngular(()=>{o=i.listen("document","mousedown",a=>{t.next({clientX:a.clientX,clientY:a.clientY,event:a})}),Fu&&(r=i.listen("document","touchstart",a=>{t.next({clientX:a.touches[0].clientX,clientY:a.touches[0].clientY,event:a})}))}),()=>{o(),Fu&&r()}}).pipe(Dl()),this.pointerMove=new Dr(t=>{let o,r;return e.runOutsideAngular(()=>{o=i.listen("document","mousemove",a=>{t.next({clientX:a.clientX,clientY:a.clientY,event:a})}),Fu&&(r=i.listen("document","touchmove",a=>{t.next({clientX:a.targetTouches[0].clientX,clientY:a.targetTouches[0].clientY,event:a})}))}),()=>{o(),Fu&&r()}}).pipe(Dl()),this.pointerUp=new Dr(t=>{let o,r,a;return e.runOutsideAngular(()=>{o=i.listen("document","mouseup",c=>{t.next({clientX:c.clientX,clientY:c.clientY,event:c})}),Fu&&(r=i.listen("document","touchend",c=>{t.next({clientX:c.changedTouches[0].clientX,clientY:c.changedTouches[0].clientY,event:c})}),a=i.listen("document","touchcancel",c=>{t.next({clientX:c.changedTouches[0].clientX,clientY:c.changedTouches[0].clientY,event:c})}))}),()=>{o(),Fu&&(r(),a())}}).pipe(Dl())}},od=(()=>{class n{constructor(){this.renderer=f(Si),this.element=f(Zt),this.zone=f(Vi),this.resizableDirective=f(ec,{optional:!0}),this.resizeEdges={},this.eventListeners={},this.destroy$=new He}ngOnInit(){this.zone.runOutsideAngular(()=>{this.listenOnTheHost("mousedown").subscribe(e=>{this.onMousedown(e,e.clientX,e.clientY)}),this.listenOnTheHost("mouseup").subscribe(e=>{this.onMouseup(e.clientX,e.clientY)}),Fu&&(this.listenOnTheHost("touchstart").subscribe(e=>{this.onMousedown(e,e.touches[0].clientX,e.touches[0].clientY)}),Hn(this.listenOnTheHost("touchend"),this.listenOnTheHost("touchcancel")).subscribe(e=>{this.onMouseup(e.changedTouches[0].clientX,e.changedTouches[0].clientY)}))})}ngOnDestroy(){this.destroy$.next(),this.unsubscribeEventListeners()}onMousedown(e,t,o){e.cancelable&&!w9(e)&&e.preventDefault(),this.eventListeners.touchmove||(this.eventListeners.touchmove=this.renderer.listen(this.element.nativeElement,"touchmove",r=>{this.onMousemove(r,r.targetTouches[0].clientX,r.targetTouches[0].clientY)})),this.eventListeners.mousemove||(this.eventListeners.mousemove=this.renderer.listen(this.element.nativeElement,"mousemove",r=>{this.onMousemove(r,r.clientX,r.clientY)})),this.resizable.mousedown.next({clientX:t,clientY:o,edges:this.resizeEdges})}onMouseup(e,t){this.unsubscribeEventListeners(),this.resizable.mouseup.next({clientX:e,clientY:t,edges:this.resizeEdges})}get resizable(){return this.resizableDirective||this.resizableContainer}onMousemove(e,t,o){this.resizable.mousemove.next({clientX:t,clientY:o,edges:this.resizeEdges,event:e})}unsubscribeEventListeners(){Object.keys(this.eventListeners).forEach(e=>{this.eventListeners[e](),delete this.eventListeners[e]})}listenOnTheHost(e){return sr(this.element.nativeElement,e).pipe(tt(this.destroy$))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=ft({type:n,selectors:[["","mwlResizeHandle",""]],inputs:{resizeEdges:"resizeEdges",resizableContainer:"resizableContainer"}})}}return n})();var ug=(()=>{class n{httpController;constructor(e){this.httpController=e}getConfigs(e,t){return this.httpController.get(e,`/access/users/${t}/llm-model-configs`).pipe(po(o=>(console.error("Failed to get user configs:",o),Bo(()=>o))))}getOwnConfigs(e,t){return this.httpController.get(e,`/access/users/${t}/llm-model-configs/own`).pipe(po(o=>(console.error("Failed to get user own configs:",o),Bo(()=>o))))}getDefaultConfig(e,t){return this.httpController.get(e,`/access/users/${t}/llm-model-configs/default`).pipe(po(o=>(console.error("Failed to get default config:",o),Bo(()=>o))))}createConfig(e,t,o){return this.httpController.post(e,`/access/users/${t}/llm-model-configs`,o).pipe(po(r=>(console.error("Failed to create config:",r),Bo(()=>r))))}updateConfig(e,t,o,r){return this.httpController.put(e,`/access/users/${t}/llm-model-configs/${o}`,r).pipe(po(a=>(console.error("Failed to update config:",a),Bo(()=>a))))}deleteConfig(e,t,o){return this.httpController.delete(e,`/access/users/${t}/llm-model-configs/${o}`).pipe(po(r=>(console.error("Failed to delete config:",r),Bo(()=>r))))}setDefaultConfig(e,t,o){return this.httpController.put(e,`/access/users/${t}/llm-model-configs/default/${o}`,{}).pipe(po(r=>(console.error("Failed to set default config:",r),Bo(()=>r))))}unsetDefaultConfig(e,t,o){return this.httpController.put(e,`/access/users/${t}/llm-model-configs/${o}`,{is_default:!1}).pipe(po(r=>(console.error("Failed to unset default config:",r),Bo(()=>r))))}getGroupConfigs(e,t){return this.httpController.get(e,`/access/groups/${t}/llm-model-configs`).pipe(po(o=>(console.error("Failed to get group configs:",o),Bo(()=>o))))}getDefaultGroupConfig(e,t){return this.httpController.get(e,`/access/groups/${t}/llm-model-configs/default`).pipe(po(o=>(console.error("Failed to get default group config:",o),Bo(()=>o))))}createGroupConfig(e,t,o){return this.httpController.post(e,`/access/groups/${t}/llm-model-configs`,o).pipe(po(r=>(console.error("Failed to create group config:",r),Bo(()=>r))))}updateGroupConfig(e,t,o,r){return this.httpController.put(e,`/access/groups/${t}/llm-model-configs/${o}`,r).pipe(po(a=>(console.error("Failed to update group config:",a),Bo(()=>a))))}deleteGroupConfig(e,t,o){return this.httpController.delete(e,`/access/groups/${t}/llm-model-configs/${o}`).pipe(po(r=>(console.error("Failed to delete group config:",r),Bo(()=>r))))}setDefaultGroupConfig(e,t,o){return this.httpController.put(e,`/access/groups/${t}/llm-model-configs/default/${o}`,{}).pipe(po(r=>(console.error("Failed to set default group config:",r),Bo(()=>r))))}unsetDefaultGroupConfig(e,t,o){return this.httpController.put(e,`/access/groups/${t}/llm-model-configs/${o}`,{is_default:!1}).pipe(po(r=>(console.error("Failed to unset default group config:",r),Bo(()=>r))))}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var rd=(()=>{class n{defaultConfig={minVisibleSize:100,minWidth:500,minHeight:400};config$=new an(this.defaultConfig);constructor(){}getConfig(){return this.config$.asObservable()}getConfigValue(){return this.config$.value}setConfig(e){let t=this.config$.value;this.config$.next(K(K({},t),e))}resetConfig(){this.config$.next(this.defaultConfig)}constrainDragPosition(e,t,o){let r=this.config$.value,a=this.parsePx(e.width),c=this.parsePx(e.height),p={position:"fixed"};if(e.right!==void 0){let u=this.parsePx(e.right)-t,h=0,_=window.innerWidth-a;u=Math.max(h,Math.min(_,u)),p.right=`${u}px`}else if(e.left!==void 0){let u=this.parsePx(e.left)+t,h=window.innerWidth-a;u=Math.max(0,Math.min(h,u)),p.left=`${u}px`}if(e.top!==void 0){let u=this.parsePx(e.top)+o,h=r.topOffset||0,_=window.innerHeight-c;u=Math.max(h,Math.min(_,u)),p.top=`${u}px`}else if(e.bottom!==void 0){let u=this.parsePx(e.bottom)-o,h=0,_=window.innerHeight-c-(r.topOffset||0);u=Math.max(h,Math.min(_,u)),p.bottom=`${u}px`}return p.width=e.width,p.height=e.height,p}parsePx(e){if(!e)return 0;let t=this.parsePxCache.get(e);if(t!==void 0)return t;let o=Number(e.split("px")[0])||0;return this.parsePxCache.set(e,o),o}parsePxCache=new Map;constrainResizeSize(e,t,o,r){let a=this.config$.value,c=Math.max(a.minWidth,e),p=Math.max(a.minHeight,t);a.maxWidth&&(c=Math.min(a.maxWidth,c)),a.maxHeight&&(p=Math.min(a.maxHeight,p));let u=window.innerWidth-(o||0),h=window.innerHeight-(r||0);return c=Math.min(c,u),p=Math.min(p,h),{width:c,height:p,left:o,top:r}}constrainWindowPosition(e){let t=this.config$.value,o=Number(e.width?.split("px")[0])||0,r=Number(e.height?.split("px")[0])||0,a=K({},e);if(e.right!==void 0){let c=Number(e.right.split("px")[0]),p=0,u=window.innerWidth-o;a.right=`${Math.max(p,Math.min(u,c))}px`,delete a.left}else if(e.left!==void 0){let c=Number(e.left.split("px")[0]),p=window.innerWidth-o,u=0;a.left=`${Math.max(u,Math.min(p,c))}px`,delete a.right}if(e.top!==void 0){let c=Number(e.top.split("px")[0]),p=t.topOffset||0,u=window.innerHeight-r;a.top=`${Math.max(p,Math.min(u,c))}px`,delete a.bottom}else if(e.bottom!==void 0){let c=Number(e.bottom.split("px")[0]),p=0,u=window.innerHeight-r-(t.topOffset||0);a.bottom=`${Math.max(p,Math.min(u,c))}px`,delete a.top}return a}isValidSize(e,t){let o=typeof e=="number"?e:typeof e=="string"?parseFloat(e):0,r=typeof t=="number"?t:typeof t=="string"?parseFloat(t):0,a=this.config$.value,c=o>=a.minWidth,p=r>=a.minHeight;return a.maxWidth&&o>a.maxWidth||a.maxHeight&&r>a.maxHeight?!1:c&&p}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function x2(n){let i=n.config.model,e=n.config.base_url,t=n.config.provider,o=t;if(e)try{o=new URL(e).hostname.replace(/^www\./,""),o=o.replace(/:\d+$/,"")}catch{o=t}return`${i} (${o})`}function Bv(n){let i=n.split("/");return i[i.length-1].replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}var KSe=(n,i)=>i.thread_id;function YSe(n,i){n&1&&(s(0,"mat-icon",12),d(1,"bug_report"),l())}function ZSe(n,i){n&1&&(ei(),s(0,"svg",13),R(1,"path",27),l())}function JSe(n,i){if(n&1&&(s(0,"span",15),d(1),l()),n&2){let e=v().$implicit;m(),j(e.title||"New chat")}}function ewe(n,i){if(n&1){let e=z();s(0,"mat-form-field",31),g("click",function(o){return o.stopPropagation()}),s(1,"input",32,1),g("keydown.enter",function(){k(e);let o=Pe(2),r=v().$implicit,a=v(2);return T(a.finishRename(r,o.value))})("keydown.escape",function(){k(e);let o=v().$implicit,r=v(2);return T(r.cancelRename(o))})("blur",function(){k(e);let o=Pe(2),r=v().$implicit,a=v(2);return T(a.finishRename(r,o.value))}),l()()}if(n&2){let e=v().$implicit;m(),C("value",e.title)}}function twe(n,i){if(n&1){let e=z();s(0,"div",10),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.selectSession(o.thread_id))}),s(1,"div",11),A(2,YSe,2,0,"mat-icon",12),A(3,ZSe,2,0,":svg:svg",13),l(),s(4,"div",14),A(5,JSe,2,1,"span",15),A(6,ewe,3,1,"mat-form-field",16),s(7,"span",17)(8,"span",18),d(9),l(),s(10,"span",19),d(11),l()()(),s(12,"button",20),g("click",function(o){return o.stopPropagation()}),ei(),s(13,"svg",21),R(14,"path",22),l()(),Ir(),s(15,"mat-menu",23,0),g("opened",function(){k(e);let o=v(2);return T(o.onMenuOpened())})("closed",function(){k(e);let o=v(2);return T(o.onMenuClosed())}),s(17,"button",24),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.renameSession(o))}),ei(),s(18,"svg",25),R(19,"path",26),l(),Ir(),s(20,"span"),d(21,"Rename"),l()(),s(22,"button",24),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.togglePinSession(o))}),ei(),s(23,"svg",25),R(24,"path",27),l(),Ir(),s(25,"span"),d(26),l()(),R(27,"mat-divider"),s(28,"button",28),g("click",function(o){let r=k(e).$implicit,a=v(2);return T(a.deleteSession(r,o))}),ei(),s(29,"svg",29),R(30,"path",30),l(),Ir(),s(31,"span"),d(32,"Delete"),l()()()()}if(n&2){let e=i.$implicit,t=Pe(16),o=v(2);Be("gns3-chat-session-list__session--active",e.thread_id===o.currentSessionId()),m(2),O(o.isFaultInjectionSession(e)?2:-1),m(),O(e.pinned?3:-1),m(2),O(e.editing?-1:5),m(),O(e.editing?6:-1),m(3),ee("",e.message_count," messages"),m(2),j(o.formatTime(e.updated_at)),m(),C("matMenuTriggerFor",t),m(14),j(e.pinned?"Unpin":"Pin")}}function nwe(n,i){if(n&1&&Y(0,twe,33,10,"div",9,KSe),n&2){let e=v();Z(e.sortedSessions)}}function iwe(n,i){n&1&&(s(0,"div",8),ei(),s(1,"svg",33),R(2,"path",34),l(),Ir(),s(3,"p",35),d(4,"No sessions"),l(),s(5,"p",36),d(6,"Click button above to create new session"),l()())}var y2=(()=>{class n{dialog=f(nt);aiChatService=f(eh);snackBar=f(vr);sessions=le([]);currentSessionId=le(null);controller=le(void 0);projectId=le(void 0);sessionSelected=new ve;sessionCreated=new ve;sessionRenamed=new ve;sessionDeleted=new ve;sessionPinned=new ve;sessionUnpinned=new ve;constructor(){}onMenuOpened(){}onMenuClosed(){}get sortedSessions(){let e=this.sessions().filter(r=>r.pinned),t=this.sessions().filter(r=>!r.pinned),o=(r,a)=>{let c=new Date(r.updated_at).getTime();return new Date(a.updated_at).getTime()-c};return[...e.sort(o),...t.sort(o)]}selectSession(e){this.sessionSelected.emit(e)}createNewSession(){this.sessionCreated.emit()}renameSession(e){e.editing=!0}finishRename(e,t){let o=t.trim();o&&this.sessionRenamed.emit({sessionId:e.thread_id,title:o}),e.editing=!1}cancelRename(e){e.editing=!1}togglePinSession(e){e.pinned?this.sessionUnpinned.emit(e.thread_id):this.sessionPinned.emit(e.thread_id)}deleteSession(e,t){let o=`Are you sure you want to delete "${e.title||"New chat"}"?`,r={};if(t){let c=t.clientX,p=t.clientY,u=360,h=180,_=c-u/2,S=p-h/2,x=window.innerWidth,b=window.innerHeight;_<10&&(_=10),_+u>x-10&&(_=x-u-10),S<10&&(S=10),S+h>b-10&&(S=b-h-10),r={top:`${S}px`,left:`${_}px`}}this.dialog.open(Ns,{data:{message:o},position:r,autoFocus:!1,restoreFocus:!1,backdropClass:"delete-dialog-backdrop",panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"]}).afterClosed().subscribe(c=>{c&&this.delete(e)})}delete(e){this.aiChatService.deleteSession(this.controller(),this.projectId(),e.thread_id).subscribe({next:()=>{this.sessionDeleted.emit(e.thread_id)},error:t=>{let o=t?.error?.message||t?.message||"Failed to delete session";this.snackBar.open(o,"Close",{duration:6e3,panelClass:["ai-chat-snack-error"],horizontalPosition:"center",verticalPosition:"bottom"})}})}formatTime(e){if(!e)return"";let o=/[Z+-]\d{2}:?\d{2}$/.test(e)?e:e+"Z",r=new Date(o),c=new Date().getTime()-r.getTime(),p=Math.floor(c/6e4),u=Math.floor(p/60),h=Math.floor(u/24);return p<1?"Just now":p<60?`${p} minutes ago`:u<24?`${u} hours ago`:h<7?`${h} days ago`:r.toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}trackBySessionId(e,t){return t.thread_id}isFaultInjectionSession(e){return U4(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-chat-session-list"]],inputs:{sessions:[1,"sessions"],currentSessionId:[1,"currentSessionId"],controller:[1,"controller"],projectId:[1,"projectId"]},outputs:{sessionSelected:"sessionSelected",sessionCreated:"sessionCreated",sessionRenamed:"sessionRenamed",sessionDeleted:"sessionDeleted",sessionPinned:"sessionPinned",sessionUnpinned:"sessionUnpinned"},decls:10,vars:1,consts:[["sessionMenu","matMenu"],["titleInput",""],[1,"gns3-chat-session-list"],[1,"gns3-chat-session-list__header"],["mat-button","",1,"gns3-chat-session-list__new-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","20","width","20","viewBox","0 0 24 24",1,"gns3-chat-session-list__icon"],["d","M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"],[1,"gns3-chat-session-list__container"],[1,"gns3-chat-session-list__no-sessions"],[1,"gns3-chat-session-list__session",3,"gns3-chat-session-list__session--active"],[1,"gns3-chat-session-list__session",3,"click"],[1,"gns3-chat-session-list__type-icons"],["title","Fault Injection Session",1,"gns3-chat-session-list__fault-icon"],["xmlns","http://www.w3.org/2000/svg","height","16","width","16","viewBox","0 0 24 24",1,"gns3-chat-session-list__pin-icon","gns3-chat-session-list__pin-animation"],[1,"gns3-chat-session-list__text"],[1,"gns3-chat-session-list__title"],[1,"gns3-chat-session-list__edit-field"],[1,"gns3-chat-session-list__preview"],[1,"gns3-chat-session-list__stats"],[1,"gns3-chat-session-list__time"],["mat-icon-button","",1,"gns3-chat-session-list__menu-button",3,"click","matMenuTriggerFor"],["xmlns","http://www.w3.org/2000/svg","height","20","width","20","viewBox","0 0 24 24",1,"gns3-chat-session-list__menu-icon"],["d","M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"],["xPosition","before","panelClass","gns3-chat-session-list__action-menu",3,"opened","closed"],["mat-menu-item","",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","20","width","20","viewBox","0 0 24 24",1,"gns3-chat-session-list__menu-item-icon"],["d","M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"],["d","M16 12V4H17V2H7V4H8V12L6 14V16H11V22H13V16H18V14L16 12Z"],["mat-menu-item","",1,"gns3-chat-session-list__delete-action",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","20","width","20","viewBox","0 0 24 24",1,"gns3-chat-session-list__menu-item-icon","gns3-chat-session-list__delete-icon"],["d","M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"],[1,"gns3-chat-session-list__edit-field",3,"click"],["matInput","",3,"keydown.enter","keydown.escape","blur","value"],["xmlns","http://www.w3.org/2000/svg","height","48","width","48","viewBox","0 0 24 24",1,"gns3-chat-session-list__no-sessions-icon"],["d","M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"],[1,"gns3-chat-session-list__no-sessions-text"],[1,"gns3-chat-session-list__no-sessions-hint"]],template:function(t,o){t&1&&(s(0,"div",2)(1,"div",3)(2,"button",4),g("click",function(){return o.createNewSession()}),ei(),s(3,"svg",5),R(4,"path",6),l(),Ir(),s(5,"span"),d(6,"New Chat"),l()()(),s(7,"div",7),A(8,nwe,2,0)(9,iwe,7,0,"div",8),l()()),t&2&&(m(8),O(o.sessions().length>0?8:9))},dependencies:[ne,ie,de,Se,Ee,Me,we,Ge,Qn,Ze,Fn,W,pe,je,_e,Ya,jr,ga],styles:[".gns3-chat-session-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background-color:var(--mat-sys-surface-container);border-right:1px solid var(--mat-sys-outline-variant)}.gns3-chat-session-list__header[_ngcontent-%COMP%]{padding:12px;border-bottom:1px solid var(--mat-sys-outline-variant)}.gns3-chat-session-list__new-button[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:center;gap:8px}.gns3-chat-session-list__icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;fill:var(--mat-sys-on-surface);transition:fill .2s ease}.gns3-chat-session-list__new-button[_ngcontent-%COMP%]:hover .gns3-chat-session-list__icon[_ngcontent-%COMP%]{fill:var(--mat-sys-primary)}.gns3-chat-session-list__container[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:8px}.gns3-chat-session-list__session[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;padding:10px;border-radius:8px;cursor:pointer;transition:background-color .2s;position:relative}.gns3-chat-session-list__session[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-container-high)}.gns3-chat-session-list__session--active[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary-container);border-left:4px solid var(--mat-sys-primary);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent),inset 0 0 0 1px color-mix(in srgb,var(--mat-sys-primary) 10%,transparent);transform:translate(2px)}.gns3-chat-session-list__session--active[_ngcontent-%COMP%] .gns3-chat-session-list__title[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary-container);font-weight:700}.gns3-chat-session-list__session--active[_ngcontent-%COMP%] .gns3-chat-session-list__stats[_ngcontent-%COMP%], .gns3-chat-session-list__session--active[_ngcontent-%COMP%] .gns3-chat-session-list__time[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary-container);opacity:.9}.gns3-chat-session-list__session--active[_ngcontent-%COMP%] .gns3-chat-session-list__menu-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-on-primary-container)}.gns3-chat-session-list__type-icons[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-shrink:0}.gns3-chat-session-list__fault-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--mat-sys-error);flex-shrink:0}.gns3-chat-session-list__pin-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-primary);filter:drop-shadow(0 2px 4px color-mix(in srgb,var(--mat-sys-primary) 40%,transparent))}.gns3-chat-session-list__pin-animation[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pinBounce .5s cubic-bezier(.68,-.55,.265,1.55)}@keyframes _ngcontent-%COMP%_pinBounce{0%{transform:scale(0);opacity:0}50%{transform:scale(1.35)}to{transform:scale(1);opacity:1}}.gns3-chat-session-list__text[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}.gns3-chat-session-list__title[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gns3-chat-session-list__preview[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.gns3-chat-session-list__stats[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant)}.gns3-chat-session-list__time[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant);opacity:.7}.gns3-chat-session-list__edit-field[_ngcontent-%COMP%]{width:100%;margin:0}.gns3-chat-session-list__edit-field[_ngcontent-%COMP%] .mat-mdc-form-field-infix[_ngcontent-%COMP%]{padding:0}.gns3-chat-session-list__edit-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:14px}.gns3-chat-session-list__menu-button[_ngcontent-%COMP%]{width:32px;height:32px;padding:0;opacity:0;transition:opacity .2s}.gns3-chat-session-list__session[_ngcontent-%COMP%]:hover .gns3-chat-session-list__menu-button[_ngcontent-%COMP%]{opacity:1}.gns3-chat-session-list__menu-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-on-surface-variant);transition:fill .2s ease}.gns3-chat-session-list__menu-button[_ngcontent-%COMP%]:hover .gns3-chat-session-list__menu-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-on-surface)}.gns3-chat-session-list__no-sessions[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;text-align:center}.gns3-chat-session-list__no-sessions-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-outline-variant);margin-bottom:12px}.gns3-chat-session-list__no-sessions-text[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface);margin:0 0 4px}.gns3-chat-session-list__no-sessions-hint[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);margin:0}.gns3-chat-session-list__delete-action[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.gns3-chat-session-list__delete-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-error)}.gns3-chat-session-list__menu-item-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;margin-right:12px;flex-shrink:0;fill:var(--mat-sys-on-surface)}"],changeDetection:0})}return n})();var owe=n=>["segment",n],rwe=(n,i)=>({"segment-main":!0,expandable:n,expanded:i});function awe(n,i){n&1&&R(0,"div",9)}function swe(n,i){if(n&1&&(s(0,"span",10),d(1),l()),n&2){let e=v().$implicit;m(),j(e.description)}}function lwe(n,i){if(n&1&&(s(0,"section",11),R(1,"ngx-json-viewer",12),l()),n&2){let e=v().$implicit,t=v();m(),C("json",e.value)("expanded",t.expanded)("depth",t.depth)("_currentDepth",t._currentDepth+1)}}function cwe(n,i){if(n&1){let e=z();s(0,"section",2)(1,"section",3),g("click",function(){let o=k(e).$implicit,r=v();return T(r.toggle(o))}),xe(2,awe,1,0,"div",4),s(3,"span",5),d(4),l(),s(5,"span",6),d(6,": "),l(),xe(7,swe,2,1,"span",7),l(),xe(8,lwe,2,4,"section",8),l()}if(n&2){let e=i.$implicit,t=v();C("ngClass",dn(6,owe,"segment-type-"+e.type)),m(),C("ngClass",zs(8,rwe,t.isExpandable(e),e.expanded)),m(),C("ngIf",t.isExpandable(e)),m(2),j(e.key),m(3),C("ngIf",!e.expanded||!t.isExpandable(e)),m(),C("ngIf",e.expanded&&t.isExpandable(e))}}var M9=(()=>{class n{constructor(){this.expanded=!0,this.depth=-1,this._currentDepth=0,this.segments=[]}ngOnChanges(){this.segments=[],this.json=this.decycle(this.json),typeof this.json=="object"?Object.keys(this.json).forEach(e=>{this.segments.push(this.parseKeyValue(e,this.json[e]))}):this.segments.push(this.parseKeyValue(`(${typeof this.json})`,this.json))}isExpandable(e){return e.type==="object"||e.type==="array"}toggle(e){this.isExpandable(e)&&(e.expanded=!e.expanded)}parseKeyValue(e,t){let o={key:e,value:t,type:void 0,description:""+t,expanded:this.isExpanded()};switch(typeof o.value){case"number":{o.type="number";break}case"boolean":{o.type="boolean";break}case"function":{o.type="function";break}case"string":{o.type="string",o.description='"'+o.value+'"';break}case"undefined":{o.type="undefined",o.description="undefined";break}case"object":{o.value===null?(o.type="null",o.description="null"):Array.isArray(o.value)?(o.type="array",o.description="Array["+o.value.length+"] "+JSON.stringify(o.value)):o.value instanceof Date?o.type="date":(o.type="object",o.description="Object "+JSON.stringify(o.value));break}}return o}isExpanded(){return this.expanded&&!(this.depth>-1&&this._currentDepth>=this.depth)}decycle(e){let t=new WeakMap;return(function o(r,a){let c,p;return typeof r=="object"&&r!==null&&!(r instanceof Boolean)&&!(r instanceof Date)&&!(r instanceof Number)&&!(r instanceof RegExp)&&!(r instanceof String)?(c=t.get(r),c!==void 0?{$ref:c}:(t.set(r,a),Array.isArray(r)?(p=[],r.forEach(function(u,h){p[h]=o(u,a+"["+h+"]")})):(p={},Object.keys(r).forEach(function(u){p[u]=o(r[u],a+"["+JSON.stringify(u)+"]")})),p)):r})(e,"$")}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=F({type:n,selectors:[["ngx-json-viewer"]],inputs:{json:"json",expanded:"expanded",depth:"depth",_currentDepth:"_currentDepth"},standalone:!1,features:[bn],decls:2,vars:1,consts:[[1,"ngx-json-viewer"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[3,"click","ngClass"],["class","toggler",4,"ngIf"],[1,"segment-key"],[1,"segment-separator"],["class","segment-value",4,"ngIf"],["class","children",4,"ngIf"],[1,"toggler"],[1,"segment-value"],[1,"children"],[3,"json","expanded","depth","_currentDepth"]],template:function(e,t){e&1&&(s(0,"section",0),xe(1,cwe,9,11,"section",1),l()),e&2&&(m(),C("ngForOf",t.segments))},dependencies:[Yi,FO,RO,n],styles:['@charset "UTF-8";.ngx-json-viewer[_ngcontent-%COMP%]{font-family:var(--ngx-json-font-family, monospace);font-size:var(--ngx-json-font-size, 1em);width:100%;height:100%;overflow:hidden;position:relative}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%]{padding:2px;margin:1px 1px 1px 12px}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%] .segment-main[_ngcontent-%COMP%]{word-wrap:break-word}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%] .segment-main[_ngcontent-%COMP%] .toggler[_ngcontent-%COMP%]{position:absolute;margin-left:-14px;margin-top:3px;font-size:.8em;line-height:1.2em;vertical-align:middle;color:var(--ngx-json-toggler, #787878)}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%] .segment-main[_ngcontent-%COMP%] .toggler[_ngcontent-%COMP%]:after{display:inline-block;content:"\\25ba";transition:transform .1s ease-in}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%] .segment-main[_ngcontent-%COMP%] .segment-key[_ngcontent-%COMP%]{color:var(--ngx-json-key, #4E187C)}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%] .segment-main[_ngcontent-%COMP%] .segment-separator[_ngcontent-%COMP%]{color:var(--ngx-json-separator, #999)}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%] .segment-main[_ngcontent-%COMP%] .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-value, #000)}.ngx-json-viewer[_ngcontent-%COMP%] .segment[_ngcontent-%COMP%] .children[_ngcontent-%COMP%]{margin-left:12px}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-string[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-string, #FF6B6B)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-number[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-number, #009688)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-boolean[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-boolean, #B938A4)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-date[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-date, #05668D)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-array[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-array, #999)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-object[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-object, #999)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-function[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-function, #999)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-null[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-null, #fff)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-undefined[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{color:var(--ngx-json-undefined, #fff)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-null[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{background-color:var(--ngx-json-null-bg, red)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-undefined[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-key[_ngcontent-%COMP%]{color:var(--ngx-json-undefined-key, #999)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-undefined[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%] > .segment-value[_ngcontent-%COMP%]{background-color:var(--ngx-json-undefined-key, #999)}.ngx-json-viewer[_ngcontent-%COMP%] .segment-type-object[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%], .ngx-json-viewer[_ngcontent-%COMP%] .segment-type-array[_ngcontent-%COMP%] > .segment-main[_ngcontent-%COMP%]{white-space:nowrap}.ngx-json-viewer[_ngcontent-%COMP%] .expanded[_ngcontent-%COMP%] > .toggler[_ngcontent-%COMP%]:after{transform:rotate(90deg)}.ngx-json-viewer[_ngcontent-%COMP%] .expandable[_ngcontent-%COMP%], .ngx-json-viewer[_ngcontent-%COMP%] .expandable[_ngcontent-%COMP%] > .toggler[_ngcontent-%COMP%]{cursor:pointer}']}),n})(),k9=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=Ht({type:n}),n.\u0275inj=$t({imports:[ne]}),n})();function mwe(n,i){if(n&1&&(s(0,"div",4)(1,"div",5),d(2,"Function:"),l(),s(3,"div",6),d(4),l()(),s(5,"div",4)(6,"div",5),d(7,"Arguments:"),l(),s(8,"div",7),R(9,"ngx-json-viewer",8),l()()),n&2){let e=v();m(4),j(e.toolCall().function.name),m(5),C("json",e.parsedArguments())("expanded",!0)}}function pwe(n,i){if(n&1&&(s(0,"div",4)(1,"div",5),d(2,"Tool:"),l(),s(3,"div",6),d(4),l()(),s(5,"div",4)(6,"div",5),d(7,"Output:"),l(),s(8,"div",7),R(9,"ngx-json-viewer",8),l()()),n&2){let e=v();m(4),j(e.toolName()),m(5),C("json",e.parsedOutput())("expanded",!1)}}var zv=(()=>{class n{dialogRef;data;type=ae("tool_call");toolCall=ae(void 0);toolName=ae(void 0);toolOutput=ae(void 0);parsedArguments=ae(null);parsedOutput=ae(null);constructor(e,t){this.dialogRef=e,this.data=t,this.type.set(t.type),this.toolCall.set(t.toolCall),this.toolName.set(t.toolName),this.toolOutput.set(t.toolOutput),this.parseJsonData()}get title(){return this.type()==="tool_call"?"Tool Call Details":"Execution Result Details"}parseJsonData(){let e=this.toolCall(),t=this.toolOutput();if(e?.function?.arguments)try{let o=e.function.arguments;typeof o=="string"?this.parsedArguments.set(JSON.parse(o)):o.tool_input&&typeof o.tool_input=="string"?this.parsedArguments.set(JSON.parse(o.tool_input)):this.parsedArguments.set(o)}catch{this.parsedArguments.set(e.function.arguments)}if(t)if(typeof t=="string")try{this.parsedOutput.set(JSON.parse(t))}catch{this.parsedOutput.set(t)}else this.parsedOutput.set(t)}closeDialog(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(Ie),ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-tool-details-dialog"]],decls:8,vars:3,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["mat-dialog-actions","","align","end"],["mat-button","",3,"click"],[1,"info-section"],[1,"info-label"],[1,"info-value"],[1,"json-container"],[3,"json","expanded"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1),A(3,mwe,10,3),A(4,pwe,10,3),l(),s(5,"div",2)(6,"button",3),g("click",function(){return o.closeDialog()}),d(7,"Close"),l()()),t&2&&(m(),j(o.title),m(2),O(o.type()==="tool_call"&&o.toolCall()?3:-1),m(),O(o.type()==="tool_result"?4:-1))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,k9,M9],styles:[".info-section[_ngcontent-%COMP%]{margin-bottom:16px}.info-section[_ngcontent-%COMP%]:last-child{margin-bottom:0}.info-label[_ngcontent-%COMP%]{font-size:11px;font-weight:500;color:var(--mat-sys-on-surface-variant);margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px}.info-value[_ngcontent-%COMP%]{font-family:Monaco,Menlo,Consolas,monospace;font-size:13px;color:var(--mat-sys-on-surface);background:var(--mat-sys-surface-container-low);padding:8px 12px;border-radius:6px;word-break:break-all}.json-container[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-low);border-radius:6px;padding:12px;max-height:500px;overflow-y:auto;border:1px solid var(--mat-sys-outline-variant);white-space:pre-wrap;font-size:13px;font-family:Monaco,Menlo,Consolas,monospace}"],changeDetection:0})}return n})();function uwe(n,i){if(n&1&&(s(0,"span",3),d(1),l()),n&2){let e=v();m(),j(e.data.language)}}var T9=(()=>{class n{dialogRef;data;constructor(e,t){this.dialogRef=e,this.data=t}close(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(Ie),ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-code-block-dialog"]],decls:15,vars:2,consts:[["mat-dialog-title","",1,"code-block-dialog__title"],[1,"code-block-dialog__icon"],[1,"code-block-dialog__title-text"],[1,"code-block-dialog__language"],[1,"code-block-dialog__content"],[1,"code-block-dialog__code"],[3,"innerHTML"],["align","end"],["mat-button","",1,"code-block-dialog__close-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0)(1,"mat-icon",1),d(2,"code"),l(),s(3,"span",2),d(4,"Code Block"),l(),A(5,uwe,2,1,"span",3),l(),s(6,"mat-dialog-content",4)(7,"pre",5),R(8,"code",6),l()(),s(9,"mat-dialog-actions",7)(10,"button",8),g("click",function(){return o.close()}),s(11,"mat-icon"),d(12,"close"),l(),s(13,"span"),d(14,"Close"),l()()()),t&2&&(m(5),O(o.data.language?5:-1),m(3),C("innerHTML",o.data.code,vp))},dependencies:[Ne,bt,Fe,W,pe,ie,de],styles:[".code-block-dialog__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.code-block-dialog__icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);font-size:24px;width:24px;height:24px;flex-shrink:0}.code-block-dialog__title-text[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:var(--mat-sys-on-surface)}.code-block-dialog__language[_ngcontent-%COMP%]{margin-left:auto;font-size:11px;color:var(--mat-sys-primary);background:var(--mat-sys-primary-container);padding:4px 10px;border-radius:12px;font-weight:500;text-transform:uppercase;letter-spacing:.5px}.code-block-dialog__content[_ngcontent-%COMP%]{padding:0;max-height:70vh;overflow:auto}.code-block-dialog__code[_ngcontent-%COMP%]{display:block;background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface);padding:20px;margin:0;font-size:14px;line-height:1.6;border-radius:0;overflow-x:auto;white-space:pre}.code-block-dialog__code[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:Consolas,Monaco,Courier New,monospace;font-size:14px}.code-block-dialog__close-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--mat-sys-on-surface-variant);font-weight:500}.code-block-dialog__close-btn[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-container-low);color:var(--mat-sys-on-surface)}.code-block-dialog__close-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}"],changeDetection:0})}return n})();var hwe=["messageContainer"],E9=(n,i)=>i.id;function fwe(n,i){if(n&1&&(s(0,"div",4)(1,"div",6)(2,"span",7),d(3,"Y"),l()(),s(4,"div",8)(5,"div",9),R(6,"markdown",10),l(),s(7,"div",11),d(8),l()()()),n&2){let e=v().$implicit,t=v();m(6),C("data",e.content),m(2),j(t.formatTime(e.created_at))}}function gwe(n,i){n&1&&(ei(),s(0,"svg",15)(1,"defs")(2,"linearGradient",18),R(3,"stop",19)(4,"stop",20),l()(),s(5,"g",21),R(6,"path",22)(7,"path",23)(8,"path",24)(9,"path",25),l()())}function _we(n,i){if(n&1){let e=z();s(0,"div",27),g("click",function(){let o=k(e).$implicit,r=v(4);return T(r.openToolCallDialog(o))}),s(1,"mat-icon",28),d(2,"build"),l(),s(3,"span",29),d(4),l(),s(5,"mat-icon",30),d(6,"open_in_new"),l()()}if(n&2){let e=i.$implicit;m(4),j(e.function.name)}}function vwe(n,i){if(n&1&&(s(0,"div",16),Y(1,_we,7,1,"div",26,E9),l()),n&2){let e=v(2).$implicit;m(),Z(e.tool_calls)}}function Cwe(n,i){if(n&1){let e=z();s(0,"div",32),g("click",function(){let o=k(e).$implicit,r=v(4);return T(r.openAssistantToolResultDialog(o))}),s(1,"mat-icon",28),d(2,"check_circle"),l(),s(3,"span",29),d(4),l(),s(5,"mat-icon",30),d(6,"open_in_new"),l()()}if(n&2){let e=i.$implicit;m(4),j(e.toolName)}}function bwe(n,i){if(n&1&&(s(0,"div",17),Y(1,Cwe,7,1,"div",31,Hi),l()),n&2){let e=v(2).$implicit;m(),Z(e.tool_result)}}function xwe(n,i){if(n&1&&(s(0,"div",5)(1,"div",12),R(2,"img",13),l(),s(3,"div",8)(4,"div",14),R(5,"markdown",10),A(6,gwe,10,0,":svg:svg",15),l(),A(7,vwe,3,0,"div",16),A(8,bwe,3,0,"div",17),s(9,"div",11),d(10),l()()()),n&2){let e=v().$implicit,t=v();m(4),Be("gns3-chat-message-list__bubble--streaming",t.isStreaming()&&e===t.lastAssistantMessage),m(),C("data",e.content),m(),O(t.isStreaming()&&e===t.lastAssistantMessage&&e.content?6:-1),m(),O(e.tool_calls&&e.tool_calls.length>0?7:-1),m(),O(e.tool_result&&e.tool_result.length>0?8:-1),m(2),j(t.formatTime(e.created_at))}}function ywe(n,i){if(n&1&&(s(0,"div",5)(1,"div",33),R(2,"markdown",10),l()()),n&2){let e=v().$implicit;m(2),C("data",e.content)}}function Swe(n,i){if(n&1&&(s(0,"div",5)(1,"div",34)(2,"mat-icon",35),d(3,"error"),l(),s(4,"div",36),d(5),l()()()),n&2){let e=v().$implicit;m(5),j(e.metadata.error)}}function wwe(n,i){if(n&1&&(A(0,fwe,9,2,"div",4),A(1,xwe,11,7,"div",5),A(2,ywe,3,1,"div",5),A(3,Swe,6,1,"div",5)),n&2){let e=i.$implicit;O(e.role==="user"?0:-1),m(),O(e.role==="assistant"?1:-1),m(),O(e.role==="system"?2:-1),m(),O(e.metadata!=null&&e.metadata.error?3:-1)}}function Mwe(n,i){if(n&1){let e=z();s(0,"div",3)(1,"div",37)(2,"div",38),R(3,"img",39),l(),s(4,"h3",40),d(5,"Welcome to GNS3 AI Assistant"),l(),s(6,"p",41),d(7,"Ask me anything about network automation and GNS3"),l(),s(8,"div",42)(9,"div",43),g("click",function(){k(e);let o=v();return T(o.sendSuggestion("Help me understand this network topology"))}),s(10,"mat-icon"),d(11,"help_outline"),l(),s(12,"span"),d(13,"Explain network topology"),l()(),s(14,"div",43),g("click",function(){k(e);let o=v();return T(o.sendSuggestion("Analyze the network configuration"))}),s(15,"mat-icon"),d(16,"analytics"),l(),s(17,"span"),d(18,"Analyze configuration"),l()(),s(19,"div",43),g("click",function(){k(e);let o=v();return T(o.sendSuggestion("Find potential network issues"))}),s(20,"mat-icon"),d(21,"search"),l(),s(22,"span"),d(23,"Find network issues"),l()()()()()}}var S2=(()=>{class n{messages=le([]);isStreaming=le(!1);autoScroll=le(!0);scrollToEnd=new ve;suggestionClicked=new ve;messageContainer=Nt.required("messageContainer");shouldScrollToBottom=!1;dialog=f(nt);constructor(){}ngOnChanges(e){e.messages&&e.messages.previousValue!==e.messages.currentValue&&(this.shouldScrollToBottom=!0)}ngAfterViewChecked(){this.shouldScrollToBottom&&this.autoScroll()&&(requestAnimationFrame(()=>{this.scrollToBottom(),requestAnimationFrame(()=>{this.scrollToBottom()})}),this.shouldScrollToBottom=!1)}ngAfterViewInit(){this.setupCodeBlockCollapse();let e=this.messageContainer().nativeElement;e&&this.messages().length===0&&(e.scrollTop=0)}setupCodeBlockCollapse(){let e=this.messageContainer().nativeElement;new MutationObserver(()=>{this.processCodeBlocks(e),this.wrapTables(e)}).observe(e,{childList:!0,subtree:!0}),this.processCodeBlocks(e),this.wrapTables(e)}processCodeBlocks(e){e.querySelectorAll("markdown pre").forEach(o=>{if(o.hasAttribute("data-code-processed"))return;let r=o.querySelector("code");if(!r)return;let a=r.textContent?.split(`
`).length||0;o.setAttribute("data-code-processed","true"),a>50&&(o.classList.add("code-block-collapsible"),o.setAttribute("title",`Click to view full code (${a} lines)`),o.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),this.openCodeBlockDialog(r.innerHTML,r.className)}))})}wrapTables(e){e.querySelectorAll("markdown table").forEach(o=>{if(o.parentElement?.classList.contains("markdown-table-wrapper"))return;let r=document.createElement("div");r.className="markdown-table-wrapper",o.parentNode?.insertBefore(r,o),r.appendChild(o)})}openCodeBlockDialog(e,t){let o=t.match(/language-(\w+)/)?.[1]||void 0,r={code:e,language:o};this.dialog.open(T9,{data:r,panelClass:["base-dialog-panel","code-block-dialog-panel"]})}get lastAssistantMessage(){let e=this.messages().filter(t=>t.role==="assistant");return e[e.length-1]}isToolCallExecuting(e){return!1}formatTime(e){if(!e)return"";let t=e;/(Z|[+-]\d{2}:\d{2})$/.test(e)||(t=e+"Z");let r=new Date(t),a=new Date;if(isNaN(r.getTime()))return"";let c=a.getTime()-r.getTime(),p=Math.floor(c/6e4);return p<1?"Just now":p<60?`${p} minutes ago`:p<1440?`${Math.floor(p/60)} hours ago`:r.toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}scrollToBottom(){let e=this.messageContainer();if(e?.nativeElement){let t=e.nativeElement;t.scrollTop=t.scrollHeight,this.scrollToEnd.emit()}}trackByMessageId(e,t){return t.id}openToolCallDialog(e,t){let o;t!==void 0?o=t:o=e;let r={type:"tool_call",toolCall:o};this.dialog.open(zv,{data:r,width:"800px",minWidth:"600px",maxWidth:"95vw",maxHeight:"85vh",panelClass:["tool-details-dialog"]})}openAssistantToolResultDialog(e){let t={type:"tool_result",toolName:e.toolName,toolOutput:e.toolOutput};this.dialog.open(zv,{data:t,width:"800px",minWidth:"600px",maxWidth:"95vw",maxHeight:"85vh",panelClass:["tool-details-dialog"]})}sendSuggestion(e){this.suggestionClicked.emit(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-chat-message-list"]],viewQuery:function(t,o){t&1&&Xt(o.messageContainer,hwe,5),t&2&&Kt()},inputs:{messages:[1,"messages"],isStreaming:[1,"isStreaming"],autoScroll:[1,"autoScroll"]},outputs:{scrollToEnd:"scrollToEnd",suggestionClicked:"suggestionClicked"},features:[bn],decls:6,vars:3,consts:[["messageContainer",""],[1,"gns3-chat-message-list"],[1,"gns3-chat-message-list__messages-container"],[1,"gns3-chat-message-list__empty-state"],[1,"gns3-chat-message-list__message","gns3-chat-message-list__message--user"],[1,"gns3-chat-message-list__message"],[1,"gns3-chat-message-list__avatar","gns3-chat-message-list__avatar--user"],[1,"avatar-text"],[1,"gns3-chat-message-list__content"],[1,"gns3-chat-message-list__bubble","gns3-chat-message-list__bubble--user"],[1,"gns3-chat-message-list__text",3,"data"],[1,"gns3-chat-message-list__time"],[1,"gns3-chat-message-list__avatar","gns3-chat-message-list__avatar--assistant"],["src","assets/gns3_icon.svg","alt","GNS3",1,"gns3-chat-message-list__avatar-logo"],[1,"gns3-chat-message-list__bubble","gns3-chat-message-list__bubble--assistant"],["viewBox","0 0 256 256","xmlns","http://www.w3.org/2000/svg",1,"gns3-chat-message-list__streaming-logo"],[1,"gns3-chat-message-list__tool-calls-container"],[1,"gns3-chat-message-list__tool-results-container"],["id","gns3LoadingGradient","x1","0%","y1","0%","x2","100%","y2","100%"],["offset","0%",2,"stop-color","var(--mat-sys-primary)","stop-opacity","1"],["offset","100%",2,"stop-color","var(--mat-sys-primary)","stop-opacity","0.6"],["transform","translate(0,-356)"],["d","m 147.99093,422.62227 c 0,6.34 -5.13717,11.47729 -11.47726,11.47729 -6.33986,0 -11.47761,-5.13729 -11.47761,-11.47729 0,-6.34019 5.13775,-11.47804 11.47761,-11.47804 6.34009,0 11.47726,5.13785 11.47726,11.47804 z M 22.394349,480.3376 c -6.886487,37.71152 2.514172,64.92952 17.161614,84.38707 26.124988,36.83736 64.492517,43.28645 64.492517,43.28645 44.81704,8.52584 78.92153,-6.99569 99.36233,-26.23425 25.68784,-24.37577 24.81373,-48.53334 24.92311,-48.86119 0.21851,-11.25931 -3.49797,-19.34782 -10.05651,-24.92306 -11.0404,-9.29128 -24.4855,-5.68414 -24.4855,-5.68414 -23.2827,5.46564 -19.457,26.67165 -19.457,26.67165 1.31155,6.33984 4.59052,10.49362 8.30733,12.89839 7.10497,4.37239 14.64752,3.49799 14.64752,3.49799 11.14958,-1.31129 14.42894,-11.80519 13.77292,-17.05238 -1.09318,-8.30719 -8.63562,-9.83784 -8.63562,-9.83784 -2.84184,-0.54643 -5.02802,-0.10925 -6.66791,0.76517 -2.40425,0.98433 -3.38861,2.62342 -3.38861,2.62342 -1.74868,2.95142 -0.65568,4.59143 0.43749,5.24736 0.65611,0.43714 1.42132,0.43714 1.42132,0.43714 0.87411,0 1.42053,-0.2185 2.07653,-0.54638 1.53057,-0.8745 2.73256,-2.29597 5.02855,-1.42145 3.3886,1.31184 2.514,4.91929 2.514,4.91929 -0.76536,3.93499 -3.06079,5.79343 -5.57488,6.44908 -3.3886,0.8745 -6.88644,-0.21851 -6.88644,-0.21851 -12.02422,-4.9193 -6.66794,-16.943 -6.66794,-16.943 3.71635,-7.54269 12.02432,-8.41719 12.02432,-8.41719 13.00749,-2.07647 21.64316,6.6679 20.22168,21.42461 -1.63939,18.36446 -15.73999,30.49734 -30.82506,38.14961 -56.51289,29.07595 -98.706503,-7.76156 -98.706503,-7.76156 -15.740625,-14.97516 -12.024098,-30.82515 -10.275137,-35.853 0.655867,-1.85856 2.404853,-2.18667 3.279285,-2.18667 12.898528,-1.09269 23.610725,22.73676 24.703825,26.01608 2.2955,5.46552 5.90259,8.52567 9.29119,10.49354 7.65184,4.2631 15.74104,2.18631 15.74104,2.18631 11.14918,-3.82574 7.32358,-12.89835 7.32358,-12.89835 -1.31154,-3.60724 -3.27936,-4.5916 -4.80941,-4.48175 -1.42153,0 -2.51417,1.09316 -2.51417,1.09316 -0.54659,0.65552 -1.20277,1.09252 -1.74915,1.63926 -7.10531,6.01193 -10.6033,-0.32811 -10.6033,-0.32811 -2.51397,-4.04423 1.31224,-6.23061 1.31224,-6.23061 0.76515,-0.43697 1.53004,-0.65583 2.07635,-0.87447 2.84229,-0.874 2.40529,-3.27934 2.40529,-3.27934 -0.43714,-4.4811 -5.46562,-2.62337 -5.46562,-2.62337 -4.9188,1.74936 -6.44941,5.79346 -6.88681,7.54276 -0.10925,0.54665 -0.21864,0.9838 -0.9834,1.09305 -1.42087,0.2185 -1.42087,-2.2956 -1.42087,-2.2956 -0.43766,-17.92675 -5.3563,-25.90628 -7.65197,-28.74817 -0.65595,-0.87508 -1.748963,-1.42143 -2.076703,-1.6399 -5.137765,-2.29543 -10.821818,-6.7772 -10.821818,-6.7772 -10.821645,-7.76093 -6.55856,-14.75663 -6.55856,-14.75663 6.449253,-16.1782 11.696148,-21.75305 11.696148,-21.75305 4.372228,-4.15383 8.963563,-0.43707 8.963563,-0.43707 -3.388589,4.154 -6.012231,8.19861 -6.012231,8.19861 -7.760984,12.35148 -9.072721,17.38012 -9.072721,17.38012 -0.109308,0.43699 -0.109308,1.2022 0.54656,2.0769 7.979631,13.66362 29.513532,15.74023 29.622792,15.74023 5.903,0.87439 10.71217,0.10925 10.71217,0.10925 2.84217,-0.5464 3.27932,1.31202 3.27932,1.31202 0.32816,1.09313 1.53073,4.15392 1.53073,4.15392 2.07675,4.37191 5.24645,2.07639 5.24645,2.07639 1.2029,-0.87441 1.74925,-2.07639 1.74925,-3.06023 0,-0.98427 -0.54635,-1.63992 -0.54635,-1.63992 -1.42154,-2.07704 -1.85853,-4.04413 -1.85853,-4.04413 -0.65564,-2.40529 2.07709,-3.38858 2.07709,-3.38858 5.35574,-2.40531 8.3072,2.18559 8.3072,2.18559 2.84233,3.3886 8.52646,-0.87441 8.52646,-0.87441 4.59089,-3.49785 -1.09323,-8.96303 -1.09323,-8.96303 -11.80522,-10.82192 -25.68768,2.84173 -25.68768,2.84173 -0.76544,0.98401 -1.53071,0.98401 -1.53071,0.98401 -11.47697,0.32817 -22.40799,-8.08903 -22.40799,-8.52636 4.37237,-7.32359 12.78893,-20.11308 12.78893,-20.11308 l 44.48933,17.16181 c 1.74859,0.54637 3.60712,0.10928 3.60712,0.10928 l 69.30196,-13.99174 c 1.53069,-0.21862 1.3122,-2.07653 1.3122,-2.07653 0,-1.53068 -0.10984,-1.74919 -1.42146,-1.96769 -1.42085,-0.21851 -67.44413,-5.35634 -67.44413,-5.35634 -3.6071,-0.21853 -3.6071,-5.13719 0.10925,-5.46498 l 48.53404,-4.04469 c 1.09314,-0.10926 1.31163,-1.20245 1.31163,-1.20245 1.31159,-6.44938 0.87399,-14.86588 0.87399,-14.86588 14.10125,-15.7411 7.32407,-31.26273 7.32407,-31.26273 -8.63521,-21.4247 -27.65565,-21.75286 -27.65565,-21.75286 -31.26208,-34.54162 -72.36236,-30.49735 -72.36236,-30.49735 -1.85878,0 -1.96813,1.53056 -1.96813,1.53056 l -4.69982,29.73201 c -0.21882,1.63996 -1.09349,2.07694 -1.09349,2.07694 l -6.23028,4.91872 c -0.76548,0.76538 -0.98406,0.76538 -2.07708,0.76538 -0.98378,0.10951 -4.04425,0.54685 -4.04425,0.54685 C 32.997429,414.53283 22.394349,480.3376 22.394349,480.3376 z M 220.90065,409.94185 c 2.95154,9.40107 -5.13786,12.35249 -5.13786,12.35249 -1.53006,-7.3239 -6.88645,-17.59894 -6.88645,-17.59894 9.07316,-2.84204 12.02431,5.24645 12.02431,5.24645 z m -45.47307,16.7245 c 0,17.27084 -13.99154,31.37192 -31.3715,31.37192 -17.27088,0 -31.37183,-13.99182 -31.37183,-31.37192 0,-17.37995 14.10095,-31.37147 31.37183,-31.37147 17.37996,0 31.3715,14.10077 31.3715,31.37147 z",2,"fill","url(#gns3LoadingGradient)"],["d","m 29.510681,104.95541 c 0,-1.72767 4.629168,-10.485938 8.922862,-16.881827 9.532205,-14.199177 22.127061,-25.580674 36.840478,-33.291355 8.695245,-4.556811 24.61103,-10.609516 25.516669,-9.70388 0.28263,0.282631 0.95772,0.239563 1.50019,-0.09571 0.54248,-0.33527 4.99436,-0.803063 9.89307,-1.039541 4.89871,-0.236478 10.63286,-0.684969 12.74256,-0.996646 l 3.83581,-0.566686 -2.87686,2.434668 c -1.58227,1.339067 -3.14795,2.450186 -3.47929,2.469154 -1.68705,0.09658 -7.68618,10.854586 -9.04972,16.228519 -2.62183,10.333096 0.5702,21.528346 8.42889,29.562183 2.78528,2.847349 3.5502,4.164777 2.58845,4.458047 -0.75085,0.22896 -20.13669,1.997905 -43.079643,3.930994 -22.942952,1.93308 -43.979985,3.76225 -46.748962,4.06482 -3.520186,0.38465 -5.034504,0.21238 -5.034504,-0.57274 z","transform","translate(0,356)",2,"fill","url(#gns3LoadingGradient)"],["d","m 20.883753,139.13783 c 0.0085,-5.02746 2.975045,-19.84783 5.322913,-26.59244 2.494665,-7.1663 2.58356,-7.27734 5.55674,-6.94098 3.274726,0.37048 78.714134,-5.943709 88.732764,-7.426826 5.48582,-0.8121 6.52647,-0.68727 10.069,1.207818 3.317,1.774438 5.48939,2.113528 13.5404,2.113528 10.7302,0 14.442,-1.34017 21.58487,-7.793315 4.3645,-3.943066 9.57454,-13.722604 9.59579,-18.011849 0.008,-1.629888 0.33172,-3.448849 0.71921,-4.042136 0.42463,-0.650131 10.03894,-1.890095 24.19889,-3.120944 30.29526,-2.633408 27.88976,-2.729233 27.18798,1.083051 -0.8022,4.357824 -3.80236,11.080064 -6.55677,14.691283 -1.92557,2.524555 -2.37472,4.35005 -2.60835,10.601279 l -0.28223,7.551581 -24.80503,2.09802 c -13.64277,1.15391 -25.40194,2.32707 -26.13147,2.60703 -1.54574,0.59315 -1.78171,4.01045 -0.33852,4.90238 0.68162,0.42127 59.31288,5.63597 69.73487,6.20227 0.13185,0.007 0.23973,0.63124 0.23973,1.38683 0,1.51563 -0.90249,1.86399 -8.63057,3.33139 -5.68832,1.08009 -69.10668,6.80224 -75.38896,6.80224 -2.3662,0 -9.42164,-2.17638 -18.63036,-5.74688 -8.15202,-3.16078 -15.04629,-5.74995 -15.32061,-5.75372 -0.27431,-0.004 -2.64772,3.43055 -5.27424,7.63179 -3.47938,5.56542 -5.42616,7.76216 -7.17287,8.09378 -4.64405,0.88171 -17.261159,1.68518 -17.261159,1.09921 0,-1.35251 4.978919,-10.2667 9.080733,-16.25801 2.418926,-3.53321 4.144786,-6.83378 3.835256,-7.33462 -0.30953,-0.50083 -2.009311,-0.91061 -3.777284,-0.91061 -4.301856,0 -7.201623,3.5265 -13.207838,16.06246 -2.590162,5.4061 -5.017616,9.82927 -5.394342,9.82927 -0.376727,0 -12.749895,1.07386 -27.49593,2.38635 -33.117257,2.94765 -31.127147,2.93162 -31.122613,0.25077 z","transform","translate(0,356)",2,"fill","url(#gns3LoadingGradient)"],["d","m 22.776215,171.26276 c -0.588994,-1.97784 -1.316927,-9.52959 -1.61763,-16.78168 l -0.546734,-13.1856 h 4.41742 c 4.272458,0 45.974498,-3.38285 52.084903,-4.2251 2.729171,-0.37619 3.068349,-0.13433 3.610054,2.57419 0.747297,3.73649 7.88306,10.75622 15.175011,14.92825 4.051489,2.31803 5.884641,4.10484 7.379631,7.19308 1.09401,2.25992 1.9891,4.55758 1.9891,5.10593 0,1.13043 -9.626814,2.21632 -19.738447,2.22647 -3.735922,0.004 -7.090412,0.30464 -7.454422,0.66866 -0.364011,0.36401 -2.701459,0.81187 -5.19433,0.99524 -2.492869,0.18337 -14.079003,1.18013 -25.746961,2.21502 -11.667959,1.03489 -21.680722,1.88162 -22.250585,1.88162 -0.569862,0 -1.518017,-1.61824 -2.10701,-3.59608 z","transform","translate(0,356)",2,"fill","url(#gns3LoadingGradient)"],[1,"gns3-chat-message-list__tool-call"],[1,"gns3-chat-message-list__tool-call",3,"click"],[1,"gns3-chat-message-list__tool-icon"],[1,"gns3-chat-message-list__tool-name-text"],[1,"gns3-chat-message-list__expand-icon"],[1,"gns3-chat-message-list__tool-result"],[1,"gns3-chat-message-list__tool-result",3,"click"],[1,"gns3-chat-message-list__bubble","gns3-chat-message-list__bubble--system"],[1,"gns3-chat-message-list__bubble","gns3-chat-message-list__bubble--error"],[1,"gns3-chat-message-list__error-icon"],[1,"gns3-chat-message-list__text"],[1,"gns3-chat-message-list__empty-content"],[1,"gns3-chat-message-list__empty-icon-wrapper"],["src","assets/gns3_icon.svg","alt","GNS3",1,"gns3-chat-message-list__empty-logo"],[1,"gns3-chat-message-list__empty-title"],[1,"gns3-chat-message-list__empty-description"],[1,"gns3-chat-message-list__empty-suggestions"],[1,"gns3-chat-message-list__suggestion-chip",3,"click"]],template:function(t,o){t&1&&(s(0,"div",1,0)(2,"div",2),Y(3,wwe,4,4,null,null,E9),A(5,Mwe,24,0,"div",3),l()()),t&2&&(Be("gns3-chat-message-list--auto-scroll",o.autoScroll()),m(3),Z(o.messages()),m(2),O(o.messages().length===0?5:-1))},dependencies:[ne,ie,de,_e,Xf,qS],styles:['.gns3-chat-message-list[_ngcontent-%COMP%]{height:100%;overflow-y:auto;padding:16px;background-color:var(--mat-sys-surface);scrollbar-width:auto;scrollbar-color:var(--mat-sys-primary) transparent}.gns3-chat-message-list[_ngcontent-%COMP%]::-webkit-scrollbar{width:12px}.gns3-chat-message-list[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.gns3-chat-message-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:var(--mat-sys-primary);border-radius:6px;border:3px solid transparent;background-clip:content-box}.gns3-chat-message-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background-color:var(--mat-sys-primary);border:2px solid transparent;background-clip:content-box}.gns3-chat-message-list__messages-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.gns3-chat-message-list__message[_ngcontent-%COMP%]{display:flex;gap:8px;animation:_ngcontent-%COMP%_fadeIn .2s ease-out}.gns3-chat-message-list__message--user[_ngcontent-%COMP%]{flex-direction:row-reverse}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.gns3-chat-message-list__avatar[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.gns3-chat-message-list__avatar--user[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--mat-sys-primary),var(--mat-sys-primary));color:var(--mat-sys-on-primary)}.gns3-chat-message-list__avatar--assistant[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--mat-sys-primary),var(--mat-sys-primary-container));color:var(--mat-sys-on-primary);overflow:hidden}.gns3-chat-message-list__avatar--tool[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--mat-sys-tertiary),var(--mat-sys-tertiary-container));color:var(--mat-sys-on-tertiary)}.gns3-chat-message-list__avatar[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:20px;height:20px;font-size:20px;color:inherit}.gns3-chat-message-list__avatar[_ngcontent-%COMP%] .avatar-text[_ngcontent-%COMP%]{font-size:12px;font-weight:700;font-family:system-ui,-apple-system,sans-serif;letter-spacing:-.5px}.gns3-chat-message-list__avatar-logo[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:contain}.gns3-chat-message-list__content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:4px;max-width:80%}.gns3-chat-message-list__message--user[_ngcontent-%COMP%] .gns3-chat-message-list__content[_ngcontent-%COMP%]{align-items:flex-end}.gns3-chat-message-list__bubble[_ngcontent-%COMP%]{padding:10px 14px;border-radius:16px;position:relative}.gns3-chat-message-list__bubble--user[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container);border-bottom-right-radius:4px;box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent)}.gns3-chat-message-list__bubble--assistant[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--mat-sys-surface-container),var(--mat-sys-surface-container-high));color:var(--mat-sys-on-surface);border-bottom-left-radius:4px;box-shadow:0 1px 3px color-mix(in srgb,var(--mat-sys-shadow) 12%,transparent);border:1px solid var(--mat-sys-outline-variant);position:relative;overflow:hidden}.gns3-chat-message-list__bubble--assistant[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;left:0;right:0;height:2px;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--mat-sys-primary) 50%,transparent),transparent);opacity:0;transition:opacity .2s ease}.gns3-chat-message-list__bubble--assistant[_ngcontent-%COMP%]:hover:after{opacity:1}.gns3-chat-message-list__bubble--system[_ngcontent-%COMP%]{background:linear-gradient(135deg,color-mix(in srgb,var(--mat-sys-primary) 10%,transparent),color-mix(in srgb,var(--mat-sys-primary) 10%,transparent));color:var(--mat-sys-on-surface-variant);text-align:center;font-size:12px;padding:8px 16px;border-radius:20px;margin:0 auto;border:1px solid color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.gns3-chat-message-list__bubble--error[_ngcontent-%COMP%]{background-color:var(--mat-sys-error-container);color:var(--mat-sys-on-error-container);display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:8px}@keyframes _ngcontent-%COMP%_blink{0%,50%{opacity:1}51%,to{opacity:0}}.gns3-chat-message-list__error-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-error-container)}.gns3-chat-message-list__time[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.7;padding:0 4px}.gns3-chat-message-list__streaming-logo[_ngcontent-%COMP%]{flex-shrink:0;margin-top:4px;width:16px;height:16px;opacity:.9;animation:_ngcontent-%COMP%_rotate 1s linear infinite}@keyframes _ngcontent-%COMP%_rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gns3-chat-message-list__tool-calls-container[_ngcontent-%COMP%], .gns3-chat-message-list__tool-results-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin-top:8px}.gns3-chat-message-list__tool-call-message[_ngcontent-%COMP%], .gns3-chat-message-list__tool-result-message[_ngcontent-%COMP%]{margin-left:40px;margin-bottom:8px}.gns3-chat-message-list__tool-call-wrapper[_ngcontent-%COMP%], .gns3-chat-message-list__tool-result-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.gns3-chat-message-list__tool-call[_ngcontent-%COMP%], .gns3-chat-message-list__tool-result[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;background:var(--mat-sys-surface-container-low);border:1px solid var(--mat-sys-outline-variant);border-radius:8px;cursor:pointer;transition:all .1s ease;user-select:none;font-size:12px}.gns3-chat-message-list__tool-call[_ngcontent-%COMP%]{border-left:3px solid var(--mat-sys-primary-container)}.gns3-chat-message-list__tool-call[_ngcontent-%COMP%]:hover{background:var(--mat-sys-primary-container);border-color:var(--mat-sys-primary-container);transform:translateY(-1px);box-shadow:0 2px 6px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.gns3-chat-message-list__tool-result[_ngcontent-%COMP%]{border-left:3px solid var(--mat-sys-tertiary)}.gns3-chat-message-list__tool-result[_ngcontent-%COMP%]:hover{background:var(--mat-sys-tertiary-container);border-color:var(--mat-sys-tertiary);transform:translateY(-1px);box-shadow:0 2px 6px color-mix(in srgb,var(--mat-sys-tertiary) 30%,transparent)}.gns3-chat-message-list__tool-icon[_ngcontent-%COMP%]{width:16px;height:16px;font-size:16px}.gns3-chat-message-list__tool-call[_ngcontent-%COMP%] .gns3-chat-message-list__tool-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary-container)}.gns3-chat-message-list__tool-result[_ngcontent-%COMP%] .gns3-chat-message-list__tool-icon[_ngcontent-%COMP%]{color:var(--mat-sys-tertiary)}.gns3-chat-message-list__tool-name-text[_ngcontent-%COMP%]{font-family:monospace;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface)}.gns3-chat-message-list__expand-icon[_ngcontent-%COMP%]{width:14px;height:14px;font-size:14px;color:var(--mat-sys-on-surface-variant);opacity:.5}.gns3-chat-message-list__empty-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;padding:48px 16px}.gns3-chat-message-list__empty-content[_ngcontent-%COMP%]{text-align:center;max-width:500px}.gns3-chat-message-list__empty-icon-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:80px;height:80px;margin:0 auto 24px;background:linear-gradient(135deg,color-mix(in srgb,var(--mat-sys-tertiary) 10%,transparent),color-mix(in srgb,var(--mat-sys-tertiary) 10%,transparent));border-radius:50%;animation:_ngcontent-%COMP%_pulse 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.05);opacity:.8}}.gns3-chat-message-list__empty-logo[_ngcontent-%COMP%]{width:48px;height:48px;object-fit:contain}.gns3-chat-message-list__empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:var(--mat-sys-on-surface);margin:0 0 8px}.gns3-chat-message-list__empty-description[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);margin:0 0 24px}.gns3-chat-message-list__empty-suggestions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;align-items:center}.gns3-chat-message-list__suggestion-chip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:10px 16px;background:var(--mat-sys-surface-container-low);border:1px solid var(--mat-sys-outline-variant);border-radius:16px;cursor:pointer;transition:all .1s ease;max-width:280px;width:100%;justify-content:center}.gns3-chat-message-list__suggestion-chip[_ngcontent-%COMP%]:hover{background:var(--mat-sys-primary-container);border-color:var(--mat-sys-primary);transform:translateY(-2px);box-shadow:0 4px 6px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent)}.gns3-chat-message-list__suggestion-chip[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px;color:var(--mat-sys-primary)}.gns3-chat-message-list__suggestion-chip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface)}.gns3-chat-message-list--auto-scroll[_ngcontent-%COMP%]{scroll-behavior:smooth}'],changeDetection:0})}return n})();var kwe=["messageInput"],Twe=["menuTrigger"],Ewe=(n,i)=>i.config_id;function Dwe(n,i){n&1&&(s(0,"mat-icon",7),d(1,"stop"),l())}function Pwe(n,i){n&1&&(s(0,"mat-icon"),d(1,"send"),l())}function Iwe(n,i){n&1&&(s(0,"mat-icon",7),d(1,"refresh"),l())}function Awe(n,i){if(n&1&&(s(0,"div",12)(1,"span",16),d(2),l(),s(3,"span",17),d(4," / "),l(),s(5,"span",18),d(6),l()()),n&2){let e=v();m(),Be("gns3-chat-input-area__char-count--warning",e.isNearLimit),m(),j(e.message().length),m(4),j(e.maxLength())}}function Owe(n,i){n&1&&(s(0,"span",21),d(1,"Group"),l())}function Nwe(n,i){if(n&1){let e=z();s(0,"button",19),g("click",function(){let o=k(e).$implicit,r=v();return T(r.selectModel(o))}),s(1,"mat-icon"),d(2),l(),s(3,"span",20),d(4),l(),A(5,Owe,2,0,"span",21),l()}if(n&2){let e=i.$implicit,t=v();Be("selected",e.config_id===t.currentModelId()),m(2),j(e.config_id===t.currentModelId()?"check_circle":"radio_button_unchecked"),m(2),j(t.getModelDisplayName(e)),m(),O(e.source==="group"?5:-1)}}function Fwe(n,i){n&1&&(R(0,"mat-divider"),s(1,"button",22)(2,"mat-icon"),d(3,"error_outline"),l(),s(4,"span"),d(5,"No models configured"),l()())}function Rwe(n,i){if(n&1){let e=z();R(0,"mat-divider"),s(1,"div",23)(2,"div",24),d(3,"Copilot Mode"),l(),s(4,"button",25),g("click",function(){k(e);let o=v();return T(o.selectCopilotMode("teaching_assistant"))}),s(5,"mat-icon"),d(6),l(),s(7,"div",26)(8,"span",27),d(9,"Teaching Assistant"),l(),s(10,"span",28),d(11,"Diagnostics only"),l()()(),s(12,"button",25),g("click",function(){k(e);let o=v();return T(o.selectCopilotMode("lab_automation_assistant"))}),s(13,"mat-icon"),d(14),l(),s(15,"div",26)(16,"span",27),d(17,"Lab Automation"),l(),s(18,"span",28),d(19,"Full configuration access"),l()()()()}if(n&2){let e=v();m(4),Be("selected",e.currentCopilotMode()==="teaching_assistant"),m(2),j(e.currentCopilotMode()==="teaching_assistant"?"check_circle":"radio_button_unchecked"),m(6),Be("selected",e.currentCopilotMode()==="lab_automation_assistant"),m(2),j(e.currentCopilotMode()==="lab_automation_assistant"?"check_circle":"radio_button_unchecked")}}var w2=(()=>{class n{placeholder=le("Message (Ctrl+Enter to send)");disabled=le(!1);isStreaming=le(!1);maxLength=le(4e3);showCharCount=le(!1);warningThreshold=le(.9);modelConfigs=le([]);currentModelId=le(null);currentCopilotMode=le("teaching_assistant");messageSent=new ve;inputChanged=new ve;modelSelected=new ve;copilotModeSelected=new ve;abortClicked=new ve;messageInput=Nt.required("messageInput");menuTrigger=Nt.required("menuTrigger");message=U("");textareaHeight=48;destroy$=new He;previousMessageLength=0;currentTheme="";themeService=f(ci);cdr=f(Q);overlayContainer=f(qu);constructor(){this.currentTheme=this.themeService.savedTheme}ngOnInit(){setTimeout(()=>{this.adjustTextareaHeight()},0),this.themeService.themeChanged.pipe(tt(this.destroy$)).subscribe({next:e=>{this.currentTheme=e;let t=this.menuTrigger();t&&t.menuOpen&&t.closeMenu()},error:e=>{console.error("[ChatInputArea] Theme subscription error:",e)}})}ensureMenuTheme(){requestAnimationFrame(()=>{let e=this.overlayContainer.getContainerElement();e.classList.remove("theme-deeppurple-amber","theme-indigo-pink","theme-magenta-violet","theme-rose-red","theme-pink-bluegrey","theme-purple-green","theme-azure-blue","theme-cyan-orange"),e.classList.add(`theme-${this.currentTheme}`)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get canSend(){return this.message().trim().length>0&&this.message().length<=this.maxLength()}get isNearLimit(){return this.message().length>=this.maxLength()*this.warningThreshold()}handleKeyDown(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.canSend&&!this.disabled()&&this.sendMessage())}onInputChange(e){this.message.set(e),this.inputChanged.emit(this.message()),setTimeout(()=>{this.adjustTextareaHeight()},0)}adjustTextareaHeight(){let e=this.messageInput();if(!e||!e.nativeElement)return;let t=e.nativeElement;t.style.height="auto";let o=t.scrollHeight,r=Math.min(Math.max(o,48),200);this.textareaHeight=r,this.previousMessageLength!==this.message().length&&(t.style.height=`${r}px`,this.previousMessageLength=this.message().length)}sendMessage(){if(this.isStreaming()){this.abortClicked.emit();return}if(!this.canSend||this.disabled())return;let e=this.message().trim();e&&(this.messageSent.emit(e),this.message.set(""),setTimeout(()=>{this.adjustTextareaHeight()},0))}focus(){let e=this.messageInput();e&&e.nativeElement&&e.nativeElement.focus()}clear(){this.message.set(""),setTimeout(()=>{this.adjustTextareaHeight()},0)}getCurrentModelDisplayName(){let e=this.modelConfigs();if(!e||e.length===0)return"Model";let t=e.find(o=>o.config_id===this.currentModelId());return t?Bv(t.config.model):Bv(e[0].config.model)}getFullModelDisplayName(){let e=this.modelConfigs();if(!e||e.length===0)return"No model configured";let t=e.find(o=>o.config_id===this.currentModelId());return t?x2(t):x2(e[0])}getModelDisplayName(e){return x2(e)}selectModel(e){this.modelSelected.emit(e)}selectCopilotMode(e){this.copilotModeSelected.emit(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-chat-input-area"]],viewQuery:function(t,o){t&1&&Xt(o.messageInput,kwe,5)(o.menuTrigger,Twe,5),t&2&&Kt(2)},inputs:{placeholder:[1,"placeholder"],disabled:[1,"disabled"],isStreaming:[1,"isStreaming"],maxLength:[1,"maxLength"],showCharCount:[1,"showCharCount"],warningThreshold:[1,"warningThreshold"],modelConfigs:[1,"modelConfigs"],currentModelId:[1,"currentModelId"],currentCopilotMode:[1,"currentCopilotMode"],message:[1,"message"]},outputs:{messageSent:"messageSent",inputChanged:"inputChanged",modelSelected:"modelSelected",copilotModeSelected:"copilotModeSelected",abortClicked:"abortClicked",message:"messageChange"},decls:26,vars:18,consts:[["messageInput",""],["menuTrigger","matMenuTrigger"],["modelMenu","matMenu"],[1,"gns3-chat-input-area"],[1,"gns3-chat-input-area__input-wrapper"],[1,"gns3-chat-input-area__textarea",3,"input","keydown","placeholder","disabled","value","rows","maxLength"],["matRipple","",1,"gns3-chat-input-area__send-button",3,"click","disabled"],[1,"gns3-chat-input-area__loading-spinner"],["matRipple","",1,"gns3-chat-input-area__model-chip",3,"menuOpened","matMenuTriggerFor","disabled","title"],[1,"gns3-chat-input-area__chip-icon"],[1,"gns3-chat-input-area__chip-text"],[1,"gns3-chat-input-area__chip-arrow"],[1,"gns3-chat-input-area__input-footer"],["xPosition","before"],[1,"gns3-chat-input-area__model-menu-header"],["mat-menu-item","",3,"selected"],[1,"gns3-chat-input-area__char-count"],[1,"gns3-chat-input-area__char-separator"],[1,"gns3-chat-input-area__char-max"],["mat-menu-item","",3,"click"],[1,"gns3-chat-input-area__model-name"],[1,"gns3-chat-input-area__model-source"],["mat-menu-item","","disabled",""],[1,"gns3-chat-input-area__copilot-mode-section"],[1,"gns3-chat-input-area__copilot-mode-header"],["mat-menu-item","",1,"gns3-chat-input-area__copilot-mode-item",3,"click"],[1,"gns3-chat-input-area__mode-info"],[1,"gns3-chat-input-area__mode-name"],[1,"gns3-chat-input-area__mode-description"]],template:function(t,o){if(t&1&&(s(0,"div",3)(1,"div",4)(2,"textarea",5,0),g("input",function(a){return o.onInputChange(a.target.value)})("keydown",function(a){return o.handleKeyDown(a)}),l(),s(4,"button",6),g("click",function(){return o.sendMessage()}),A(5,Dwe,2,0,"mat-icon",7)(6,Pwe,2,0,"mat-icon")(7,Iwe,2,0,"mat-icon",7),l(),s(8,"button",8,1),g("menuOpened",function(){return o.ensureMenuTheme()}),s(10,"mat-icon",9),d(11,"psychology"),l(),s(12,"span",10),d(13),l(),s(14,"mat-icon",11),d(15,"expand_more"),l()()(),A(16,Awe,7,4,"div",12),l(),s(17,"mat-menu",13,2)(19,"div",14),d(20,"Select AI Model"),l(),R(21,"mat-divider"),Y(22,Nwe,6,5,"button",15,Ewe),A(24,Fwe,6,0),A(25,Rwe,20,6),l()),t&2){let r=Pe(18);m(2),nn("height",o.textareaHeight,"px"),C("placeholder",o.placeholder())("disabled",o.disabled())("value",o.message())("rows",1)("maxLength",o.maxLength()),m(2),Be("gns3-chat-input-area__send-button--abort",o.isStreaming()),C("disabled",(!o.canSend||o.disabled())&&!o.isStreaming()),m(),O(o.isStreaming()?5:o.disabled()?7:6),m(3),C("matMenuTriggerFor",r)("disabled",o.disabled()||!o.modelConfigs()||o.modelConfigs().length===0)("title",o.getFullModelDisplayName()),m(5),j(o.getCurrentModelDisplayName()),m(3),O(o.showCharCount()?16:-1),m(6),Z(o.modelConfigs()),m(2),O(!o.modelConfigs()||o.modelConfigs().length===0?24:-1),m(),O(o.modelConfigs()&&o.modelConfigs().length>0?25:-1)}},dependencies:[ne,ie,de,mc,Us,Ge,Qn,Ze,Fn,jr,ga],styles:['.gns3-chat-input-area[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:16px;background:transparent;border-top:1px solid transparent}.gns3-chat-input-area__input-wrapper[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:center;width:100%}.gns3-chat-input-area__textarea[_ngcontent-%COMP%]{flex:1;min-width:0;min-height:48px;max-height:200px;padding:12px 16px;border:2px solid var(--mat-sys-outline-variant);border-radius:24px;background:transparent;color:var(--mat-sys-on-surface);font-family:inherit;font-size:16px;line-height:1.5;resize:none;outline:none;transition:all .2s ease;box-sizing:border-box;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.gns3-chat-input-area__textarea[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.gns3-chat-input-area__textarea[_ngcontent-%COMP%]:focus{border-color:var(--mat-sys-primary);background:var(--mat-sys-surface-container-low);box-shadow:0 0 0 4px color-mix(in srgb,var(--mat-sys-primary) 10%,transparent)}.gns3-chat-input-area__textarea[_ngcontent-%COMP%]:hover{border-color:var(--mat-sys-outline)}.gns3-chat-input-area__textarea[_ngcontent-%COMP%]::placeholder{color:var(--mat-sys-on-surface-variant);opacity:.6}.gns3-chat-input-area__textarea[_ngcontent-%COMP%]:disabled{background-color:var(--mat-sys-surface-container-high);cursor:not-allowed;opacity:.6}.gns3-chat-input-area__model-chip[_ngcontent-%COMP%]{flex-shrink:0;height:36px;min-width:100px;max-width:200px;padding:0 12px;border:none;border-radius:18px;background:linear-gradient(135deg,var(--mat-sys-primary),var(--mat-sys-primary-container));color:var(--mat-sys-on-primary);display:flex;align-items:center;gap:6px;cursor:pointer;transition:all .3s cubic-bezier(.4,0,.2,1);box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent);position:relative;overflow:hidden;font-family:inherit;font-size:13px;font-weight:500}.gns3-chat-input-area__model-chip[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,color-mix(in srgb,var(--mat-sys-on-primary) 20%,transparent),transparent);opacity:0;transition:opacity .3s ease;border-radius:18px}.gns3-chat-input-area__model-chip[_ngcontent-%COMP%]:hover:not(:disabled){box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 50%,transparent);background:linear-gradient(135deg,var(--mat-sys-primary),color-mix(in srgb,var(--mat-sys-primary-container) 80%,black));transform:translateY(-1px)}.gns3-chat-input-area__model-chip[_ngcontent-%COMP%]:hover:not(:disabled):before{opacity:1}.gns3-chat-input-area__model-chip[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(0);box-shadow:0 2px 6px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.gns3-chat-input-area__model-chip[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.gns3-chat-input-area__chip-icon[_ngcontent-%COMP%]{width:16px;height:16px;font-size:16px;color:var(--mat-sys-on-primary);flex-shrink:0}.gns3-chat-input-area__chip-text[_ngcontent-%COMP%]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--mat-sys-on-primary);line-height:1}.gns3-chat-input-area__chip-arrow[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px;color:var(--mat-sys-on-primary);flex-shrink:0}.gns3-chat-input-area__send-button[_ngcontent-%COMP%]{flex-shrink:0;width:48px;height:48px;border:none;border-radius:50%;background:linear-gradient(135deg,var(--mat-sys-primary),var(--mat-sys-tertiary));color:var(--mat-sys-on-primary);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .3s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-tertiary) 30%,transparent);position:relative;overflow:hidden}.gns3-chat-input-area__send-button[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,color-mix(in srgb,var(--mat-sys-on-surface) 20%,transparent),transparent);opacity:0;transition:opacity .3s ease;border-radius:50%}.gns3-chat-input-area__send-button[_ngcontent-%COMP%]:hover:not(:disabled){transform:scale(1.15);box-shadow:0 8px 24px color-mix(in srgb,var(--mat-sys-tertiary) 50%,transparent);background:linear-gradient(135deg,var(--mat-sys-tertiary),color-mix(in srgb,var(--mat-sys-tertiary) 80%,black))}.gns3-chat-input-area__send-button[_ngcontent-%COMP%]:hover:not(:disabled):before{opacity:1}.gns3-chat-input-area__send-button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.05);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-tertiary) 30%,transparent)}.gns3-chat-input-area__send-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.gns3-chat-input-area__send-button--abort[_ngcontent-%COMP%]:not(:disabled){background:linear-gradient(135deg,var(--mat-sys-error),var(--mat-sys-error-container));box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-error) 30%,transparent)}.gns3-chat-input-area__send-button--abort[_ngcontent-%COMP%]:not(:disabled):hover{box-shadow:0 8px 24px color-mix(in srgb,var(--mat-sys-error) 50%,transparent);background:linear-gradient(135deg,var(--mat-sys-error),color-mix(in srgb,var(--mat-sys-error) 80%,black))}.gns3-chat-input-area__send-button--abort[_ngcontent-%COMP%]:not(:disabled):active{box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-error) 30%,transparent)}.gns3-chat-input-area__send-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:20px;height:20px;font-size:20px;color:var(--mat-sys-on-primary)}.gns3-chat-input-area__loading-spinner[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gns3-chat-input-area__input-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;margin-top:8px;padding:0 4px}.gns3-chat-input-area__char-count[_ngcontent-%COMP%]{font-size:11px;font-weight:500;color:var(--mat-sys-on-surface-variant);transition:color .2s ease}.gns3-chat-input-area__char-count--warning[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.gns3-chat-input-area__char-separator[_ngcontent-%COMP%], .gns3-chat-input-area__char-max[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant);opacity:.7;margin:0 2px}.gns3-chat-input-area__model-menu-header[_ngcontent-%COMP%]{padding:12px 16px;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.gns3-chat-input-area__model-name[_ngcontent-%COMP%]{flex:1;font-size:14px}.gns3-chat-input-area__model-source[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 10%,transparent);padding:2px 8px;border-radius:12px;margin-left:8px}.gns3-chat-input-area__model-menu-item.selected[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--mat-sys-primary) 10%,transparent)}.gns3-chat-input-area__copilot-mode-section[_ngcontent-%COMP%]{padding:0}.gns3-chat-input-area__copilot-mode-header[_ngcontent-%COMP%]{padding:12px 16px 8px;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px}.gns3-chat-input-area__copilot-mode-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:8px 16px;min-height:48px}.gns3-chat-input-area__copilot-mode-item[_ngcontent-%COMP%] .gns3-chat-input-area__mode-info[_ngcontent-%COMP%]{display:flex;flex-direction:column}.gns3-chat-input-area__mode-name[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface)}.gns3-chat-input-area__mode-description[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant);opacity:.8;line-height:1.2;margin-top:1px}'],changeDetection:0})}return n})();var Lwe=()=>({top:!0}),Vwe=()=>({right:!0}),Bwe=()=>({bottom:!0}),zwe=()=>({left:!0}),jwe=()=>({top:!0,left:!0}),$we=()=>({top:!0,right:!0}),Hwe=()=>({bottom:!0,left:!0}),Uwe=()=>({bottom:!0,right:!0});function Gwe(n,i){if(n&1){let e=z();s(0,"div",2),g("mousemove",function(o){k(e);let r=v();return T(r.dragWidget(o))},zu)("mouseup",function(){k(e);let o=v();return T(o.toggleDragging(!1))},zu),l()}}function Wwe(n,i){n&1&&R(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"div",8)(6,"div",9)(7,"div",10),n&2&&(C("resizeEdges",Bt(8,Lwe)),m(),C("resizeEdges",Bt(9,Vwe)),m(),C("resizeEdges",Bt(10,Bwe)),m(),C("resizeEdges",Bt(11,zwe)),m(),C("resizeEdges",Bt(12,jwe)),m(),C("resizeEdges",Bt(13,$we)),m(),C("resizeEdges",Bt(14,Hwe)),m(),C("resizeEdges",Bt(15,Uwe)))}function qwe(n,i){n&1&&(s(0,"span",15),d(1,"Assistant"),l())}function Qwe(n,i){if(n&1){let e=z();s(0,"div",16)(1,"button",33),g("click",function(){k(e);let o=v(2);return T(o.onSessionCreated())}),s(2,"mat-icon"),d(3,"add"),l()()()}}function Xwe(n,i){if(n&1){let e=z();s(0,"div",16)(1,"app-chat-session-list",34),g("sessionSelected",function(o){k(e);let r=v(2);return T(r.onSessionSelected(o))})("sessionCreated",function(){k(e);let o=v(2);return T(o.onSessionCreated())})("sessionRenamed",function(o){k(e);let r=v(2);return T(r.onSessionRenamed(o))})("sessionDeleted",function(o){k(e);let r=v(2);return T(r.onSessionDeleted(o))})("sessionPinned",function(o){k(e);let r=v(2);return T(r.onSessionPinned(o))})("sessionUnpinned",function(o){k(e);let r=v(2);return T(r.onSessionUnpinned(o))}),l()()}if(n&2){let e=v(2);m(),C("sessions",e.sessions)("currentSessionId",e.currentSessionId)("controller",e.controller)("projectId",e.project().project_id)}}function Kwe(n,i){n&1&&(ei(),R(0,"path",25))}function Ywe(n,i){n&1&&(ei(),R(0,"path",26))}function Zwe(n,i){if(n&1){let e=z();s(0,"div",11)(1,"div",12)(2,"h3",13),g("mousedown",function(o){return o.stopPropagation()})("click",function(){k(e);let o=v();return T(o.toggleSidebar())}),s(3,"span",14),d(4,"AI"),l(),A(5,qwe,2,0,"span",15),l()(),A(6,Qwe,4,0,"div",16),A(7,Xwe,2,4,"div",16),l(),s(8,"div",17)(9,"div",18),g("mousedown",function(){k(e);let o=v();return T(!o.isMaximized&&o.toggleDragging(!0))}),s(10,"div",19)(11,"span"),d(12),l()(),s(13,"div",20)(14,"button",21),g("mousedown",function(o){return o.stopPropagation()})("click",function(o){k(e);let r=v();return o.stopPropagation(),T(r.minimizeChat())}),ei(),s(15,"svg",22),R(16,"path",23),l()(),Ir(),s(17,"button",24),g("mousedown",function(o){return o.stopPropagation()})("click",function(o){k(e);let r=v();return o.stopPropagation(),T(r.maximizeChat())}),ei(),s(18,"svg",22),A(19,Kwe,1,0,":svg:path",25),A(20,Ywe,1,0,":svg:path",26),l()(),Ir(),s(21,"button",27),g("mousedown",function(o){return o.stopPropagation()})("click",function(o){k(e);let r=v();return o.stopPropagation(),T(r.closeChat())}),ei(),s(22,"svg",22),R(23,"path",28),l()()()(),Ir(),s(24,"div",29)(25,"app-chat-message-list",30),g("scrollToEnd",function(){k(e);let o=v();return T(o.onScrollToEnd())})("suggestionClicked",function(o){k(e);let r=v();return T(r.onSuggestionClicked(o))}),l()(),s(26,"div",31)(27,"app-chat-input-area",32),g("messageSent",function(o){k(e);let r=v();return T(r.onMessageSent(o))})("modelSelected",function(o){k(e);let r=v();return T(r.onModelSelected(o))})("copilotModeSelected",function(o){k(e);let r=v();return T(r.onCopilotModeSelected(o))})("abortClicked",function(){k(e);let o=v();return T(o.onAbortClicked())}),l()()()}if(n&2){let e=v();Be("gns3-ai-chat__sidebar--collapsed",e.sidebarCollapsed),m(2),Be("gns3-ai-chat__sidebar-title--clickable",!0),m(3),O(e.sidebarCollapsed?-1:5),m(),O(e.sidebarCollapsed?6:-1),m(),O(e.sidebarCollapsed?-1:7),m(5),j(e.currentSessionTitle),m(7),O(e.isMaximized?-1:19),m(),O(e.isMaximized?20:-1),m(5),C("messages",e.currentMessages)("isStreaming",e.isStreaming),m(2),C("disabled",e.isStreaming)("isStreaming",e.isStreaming)("modelConfigs",e.modelConfigs)("currentModelId",e.currentModelId)("currentCopilotMode",e.currentCopilotMode)}}var M2=(()=>{class n{static TOOLBAR_HEIGHT_DESKTOP=64;static TOOLBAR_HEIGHT_MOBILE=56;static MOBILE_BREAKPOINT=768;static MIN_PANEL_WIDTH=500;static MIN_PANEL_HEIGHT=400;project=le.required();controller;zIndex=le(1e3);closed=new ve;windowFocused=new ve;sidebarCollapsed=!0;isStreaming=!1;isDraggingEnabled=!1;isMaximized=!1;isMinimized=!1;style={};previousStyle={};resizedWidth=0;resizedHeight=0;sessions=[];currentSessionId=null;currentMessages=[];modelConfigs=[];currentModelId=null;currentCopilotMode="teaching_assistant";isLoadingModels=!1;currentToolCalls=new Map;currentAssistantMessage=null;destroy$=new He;saveStateTimer=null;dragRafId=null;aiChatService=f(eh);controllerService=f(Je);aiProfilesService=f(ug);loginService=f(dl);aiChatStore=f(mg);snackBar=f(vr);cdr=f(Q);boundaryService=f(rd);constructor(){}logError(...e){console.error("[AI Chat Error]",...e)}ngOnInit(){let e=window.innerWidth<=n.MOBILE_BREAKPOINT?n.TOOLBAR_HEIGHT_MOBILE:n.TOOLBAR_HEIGHT_DESKTOP;this.boundaryService.setConfig({topOffset:e}),this.initializeChat(),this.subscribeToStateChanges()}ngOnChanges(e){(e.project||e.controller)&&this.initializeChat()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.cleanup()}onWindowResize(){this.isMinimized||this.isMaximized||(this.style=this.boundaryService.constrainWindowPosition(this.style),this.cdr.markForCheck())}initializeChat(){let e=this.project();!e||!this.controller||(this.aiChatService.resetCurrentSession(),this.aiChatStore.setCurrentProjectId(e.project_id),this.loadPanelState(),this.loadSessions(),this.loadModelConfigs())}loadPanelState(){let e=this.aiChatStore.getPanelStateValue();this.isMaximized=e.isMaximized||!1,this.isMinimized=e.isMinimized||!1;let t=e.width||800,o=e.height||900,r=e.position;this.style={position:"fixed",top:r?.top!==void 0?`${r.top}px`:"80px",right:r?.right!==void 0?`${r.right}px`:void 0,left:r?.left!==void 0?`${r.left}px`:void 0,width:`${t}px`,height:`${o}px`},this.previousStyle=K({},this.style),this.resizedWidth=t,this.resizedHeight=o,this.isMaximized?this.applyMaximizedStyle():this.isMinimized&&this.applyMinimizedStyle()}subscribeToStateChanges(){this.aiChatStore.getSessions().pipe(tt(this.destroy$)).subscribe({next:e=>{this.sessions=e,this.cdr.markForCheck()},error:e=>{this.logError("Failed to subscribe to sessions:",e),this.showError(e||"Failed to load sessions")}}),this.aiChatStore.getCurrentSessionId().pipe(tt(this.destroy$)).subscribe({next:e=>{this.currentSessionId=e,e&&!this.isStreaming&&this.loadSessionMessages(e),this.cdr.markForCheck()},error:e=>{this.logError("Failed to subscribe to current session:",e)}}),this.aiChatStore.getStreamingState().pipe(tt(this.destroy$)).subscribe({next:e=>{this.isStreaming=e,this.cdr.markForCheck()},error:e=>{this.logError("Failed to subscribe to streaming state:",e)}}),this.aiChatStore.getPanelState().pipe(tt(this.destroy$)).subscribe({next:e=>{let t=this.isMinimized,o=this.isMaximized;if(this.isMinimized=e.isMinimized,this.isMaximized=e.isMaximized,t&&!e.isMinimized?(Object.keys(this.previousStyle).length>0&&(this.style=K({},this.previousStyle)),this.cdr.markForCheck()):!t&&e.isMinimized&&(this.previousStyle=K({},this.style),this.style={position:"fixed",left:"-9999px",top:"-9999px",width:"0px",height:"0px"},this.cdr.markForCheck()),o&&!e.isMaximized&&!e.isMinimized){if(Object.keys(this.previousStyle).length>0){let r=this.boundaryService.constrainWindowPosition(this.previousStyle);this.style=r;let a=r.width,c=r.height;a&&(this.resizedWidth=Number(a.split("px")[0])),c&&(this.resizedHeight=Number(c.split("px")[0]))}this.cdr.markForCheck()}},error:e=>{this.logError("Failed to subscribe to panel state:",e)}})}loadSessions(){this.controller&&this.controllerService.get(this.controller.id).then(e=>{this.controller=e,this.aiChatService.getSessions(this.controller,this.project().project_id).pipe(Qi(t=>{this.aiChatStore.setSessions(t)}),tt(this.destroy$)).subscribe({error:t=>{this.logError("Failed to load sessions:",t),this.showError(t||"Failed to load sessions")}})})}loadSessionMessages(e){this.controller&&this.controllerService.get(this.controller.id).then(t=>{this.controller=t,this.aiChatService.getSessionHistory(this.controller,this.project().project_id,e).pipe(Qi(o=>{let r=this.convertLegacyToolMessages(o.messages);this.aiChatStore.setMessages(e,r),this.currentMessages=r,this.cdr.markForCheck()}),tt(this.destroy$)).subscribe({error:o=>{this.logError("Failed to load session history:",o),this.showError("Failed to load session history")}})})}onSessionSelected(e){this.aiChatStore.setCurrentSessionId(e)}onSessionCreated(){this.aiChatStore.setCurrentSessionId(null),this.aiChatService.resetCurrentSession(),this.currentMessages=[],this.currentToolCalls.clear(),this.cdr.markForCheck()}onSessionRenamed(e){this.controller&&this.controllerService.get(this.controller.id).then(t=>{this.controller=t,this.aiChatService.renameSession(this.controller,this.project().project_id,e.sessionId,e.title).pipe(Qi(o=>{this.aiChatStore.updateSession(o)}),tt(this.destroy$)).subscribe({error:o=>{this.logError("Failed to rename session:",o),this.showError("Failed to rename session")}})})}onSessionDeleted(e){this.aiChatStore.deleteSession(e),this.currentSessionId===e&&(this.currentSessionId=null)}onSessionPinned(e){this.controller&&this.controllerService.get(this.controller.id).then(t=>{this.controller=t,this.aiChatService.pinSession(this.controller,this.project().project_id,e).pipe(Qi(o=>{this.aiChatStore.updateSession(o)}),tt(this.destroy$)).subscribe({error:o=>{this.logError("Failed to pin session:",o),this.showError("Failed to pin session")}})})}onSessionUnpinned(e){this.controller&&this.controllerService.get(this.controller.id).then(t=>{this.controller=t,this.aiChatService.unpinSession(this.controller,this.project().project_id,e).pipe(Qi(o=>{this.aiChatStore.updateSession(o)}),tt(this.destroy$)).subscribe({error:o=>{this.logError("Failed to unpin session:",o),this.showError("Failed to unpin session")}})})}onMessageSent(e){if(!this.controller||this.isStreaming)return;let t={id:this.generateMessageId(),role:"user",content:e,created_at:new Date().toISOString()},o=[...this.currentMessages,t];this.currentMessages=o;let r=this.currentSessionId||this.aiChatService.getCurrentSessionId();r?(this.isStreaming=!0,this.aiChatStore.setStreamingState(!0)):(r=this.generateUUID(),this.isStreaming=!0,this.aiChatStore.setStreamingState(!0),this.aiChatStore.setCurrentSessionId(r)),this.aiChatStore.addMessage(r,t),this.cdr.markForCheck(),this.startChatStream(e,r)}startChatStream(e,t){this.controller&&(this.currentAssistantMessage=null,this.controllerService.get(this.controller.id).then(o=>{this.controller=o,this.aiChatStore.setStreamingState(!0),this.aiChatStore.clearError(),this.aiChatService.streamChat(this.controller,this.project().project_id,{message:e,session_id:t,stream:!0}).pipe(tt(this.destroy$)).subscribe({next:r=>{this.handleChatEvent(r)},error:r=>{this.logError("Chat stream error:",r),this.aiChatStore.setStreamingState(!1),this.showError(r||"Chat error occurred")},complete:()=>{this.aiChatStore.setStreamingState(!1),this.currentToolCalls.clear(),this.currentAssistantMessage=null}})}).catch(o=>{this.logError("Failed to get fresh controller:",o),this.showError("Failed to authenticate")}))}handleChatEvent(e){switch(e.type){case"content":this.handleContentEvent(e);break;case"tool_call":this.handleToolCallEvent(e);break;case"tool_start":this.handleToolStartEvent(e);break;case"tool_end":this.handleToolEndEvent(e);break;case"error":this.showError(e.error||"An error occurred");break;case"done":this.loadSessions();break}}handleContentEvent(e){this.currentAssistantMessage?(this.currentAssistantMessage.content+=e.content||"",this.currentMessages=[...this.currentMessages],this.cdr.markForCheck()):(this.currentAssistantMessage={id:e.message_id||this.generateMessageId(),role:"assistant",content:e.content||"",created_at:new Date().toISOString()},this.currentMessages=[...this.currentMessages,this.currentAssistantMessage],this.cdr.markForCheck())}handleToolCallEvent(e){if(!e.tool_call)return;let t=e.tool_call;this.currentToolCalls.set(t.id,t),this.currentAssistantMessage||(this.currentAssistantMessage={id:e.message_id||this.generateMessageId(),role:"assistant",content:"",created_at:new Date().toISOString(),tool_calls:[]},this.currentMessages=[...this.currentMessages,this.currentAssistantMessage]),this.currentAssistantMessage.tool_calls||(this.currentAssistantMessage.tool_calls=[]);let o=this.currentAssistantMessage.tool_calls.find(r=>r.id===t.id);o?(o.function.arguments=t.function.arguments,o.function.complete=t.function.complete):this.currentAssistantMessage.tool_calls.push(K({},t)),this.aiChatStore.addOrUpdateToolCall(t),this.cdr.markForCheck()}handleToolStartEvent(e){if(e.tool_call_id&&this.currentAssistantMessage?.tool_calls){let t=this.currentAssistantMessage.tool_calls.find(o=>o.id===e.tool_call_id);t&&(t.isExecuting=!0,this.currentMessages=[...this.currentMessages],this.cdr.markForCheck())}}handleToolEndEvent(e){let t=null;if(e.tool_call_id)for(let o=this.currentMessages.length-1;o>=0;o--){let r=this.currentMessages[o];if(r.role==="assistant"&&r.tool_calls&&r.tool_calls.find(c=>c.id===e.tool_call_id)){t=r;break}}if(t||(t=this.currentAssistantMessage),t)t.tool_result||(t.tool_result=[]),t.tool_result.push({toolName:e.tool_name||"",toolOutput:e.tool_output||"",tool_call_id:e.tool_call_id}),this.currentMessages=[...this.currentMessages],this.cdr.markForCheck(),this.currentAssistantMessage=null;else{let o={id:this.generateMessageId(),role:"assistant",content:"",created_at:new Date().toISOString(),tool_result:[{toolName:e.tool_name||"",toolOutput:e.tool_output||"",tool_call_id:e.tool_call_id}]};this.currentMessages=[...this.currentMessages,o]}this.cdr.markForCheck()}get currentSessionTitle(){return this.sessions.find(t=>t.thread_id===this.currentSessionId)?.title||"New chat"}toggleSidebar(){this.sidebarCollapsed=!this.sidebarCollapsed}closeChat(){this.aiChatStore.closePanel(),this.cleanup(),this.closed.emit()}onWindowFocus(){this.windowFocused.emit()}maximizeChat(){if(this.isMaximized){this.restoreChat();return}this.previousStyle=K({},this.style),this.isMaximized=!0,this.isMinimized=!1,this.aiChatStore.maximizePanel(),this.applyMaximizedStyle()}minimizeChat(){if(this.isMinimized){this.restoreChat();return}this.previousStyle=K({},this.style),this.isMaximized=!1,this.aiChatStore.minimizePanel()}restoreChat(){this.aiChatStore.restorePanel()}applyMaximizedStyle(){this.style={position:"fixed",top:"0",right:"0",left:"0",width:"100vw",height:"100vh"}}applyMinimizedStyle(){this.style={position:"fixed",left:"-9999px",top:"-9999px",width:"0px",height:"0px"}}onScrollToEnd(){}onSuggestionClicked(e){this.onMessageSent(e)}showError(e){let t;typeof e=="string"?t=e:e.error?.message?t=e.error.message:e.message?t=e.message:e.statusText?t=e.statusText:t="An unknown error occurred";let o=300,r=t;r.length>o&&(r=r.substring(0,o)+"..."),this.aiChatStore.setError(t);let a=this.parseErrorMessage(r);this.snackBar.open(a,"Close",{duration:6e3,panelClass:["ai-chat-snack-error"],horizontalPosition:"center",verticalPosition:"bottom",politeness:"assertive"})}parseErrorMessage(e){if(!e)return"An unknown error occurred";let t=e.match(/Error code:\s*(\d+)\s*-\s*{.*?['"]message['"]:\s*['"]([^'"]+)['"]/);if(t){let a=t[1],c=t[2];return{401:"Authentication failed. Please check your API key or login again.",403:"Access denied. You don't have permission to perform this action.",404:"Resource not found. The requested resource may have been deleted.",429:"Too many requests. Please wait a moment and try again.",500:"Server error. Please try again later.",503:"Service temporarily unavailable. Please try again later."}[a]||c}if(e.includes("{")&&e.includes("}"))try{let a=JSON.parse(e.replace(/'/g,'"'));if(a.error?.message)return this.parseErrorMessage(a.error.message)}catch{}let o=e.match(/Error code:\s*(\d+)\s*-\s*(.+)/);if(o){let a=o[1],c=o[2];return`Error (${a}): ${c}`}let r={AuthenticationError:"Authentication failed. Please check your credentials.",PermissionDenied:"You don't have permission to access this resource.",ConnectionError:"Failed to connect to the server. Please check your network.",TimeoutError:"Request timed out. Please try again.",ValidationError:"Invalid input. Please check your data and try again."};for(let[a,c]of Object.entries(r))if(e.includes(a))return c;return e}clearError(){this.aiChatStore.clearError()}generateMessageId(){let e=new Uint8Array(4);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let o=0;o<e.length;o++)e[o]=Math.floor(Math.random()*256);let t=Array.from(e,o=>o.toString(16).padStart(2,"0")).join("");return`msg_${Date.now()}_${t}`}convertLegacyToolMessages(e){let t=[],o=-1;for(let r of e)if(r.role==="tool")if(o>=0){let a=t[o];a.tool_result||(a.tool_result=[]),a.tool_result.push({toolName:r.name||"",toolOutput:r.content||"",tool_call_id:r.tool_call_id})}else{let a={id:this.generateMessageId(),role:"assistant",content:"",created_at:r.created_at,tool_result:[{toolName:r.name||"",toolOutput:r.content||"",tool_call_id:r.tool_call_id}]};t.push(a),o=t.length-1}else t.push(K({},r)),r.role==="assistant"&&(o=t.length-1);return t}generateUUID(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let o=0;o<e.length;o++)e[o]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,o=>o.toString(16).padStart(2,"0")).join("");return[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20,32)].join("-")}toggleDragging(e){this.isDraggingEnabled=e,e||this.debouncedSavePanelState()}dragWidget(e){this.dragRafId!==null&&cancelAnimationFrame(this.dragRafId),this.dragRafId=requestAnimationFrame(()=>{this.style=this.boundaryService.constrainDragPosition(this.style,e.movementX,e.movementY),this.cdr.markForCheck()})}validate(e){return!(e.rectangle.width&&e.rectangle.height&&(e.rectangle.width<n.MIN_PANEL_WIDTH||e.rectangle.height<n.MIN_PANEL_HEIGHT))}onResizeEnd(e){let t=this.boundaryService.constrainResizeSize(e.rectangle.width||this.resizedWidth,e.rectangle.height||this.resizedHeight,e.rectangle.left,e.rectangle.top),o=this.style.left!==void 0,r={position:"fixed",top:t.top!==void 0?`${t.top}px`:this.style.top};if(o)r.left=t.left!==void 0?`${t.left}px`:this.style.left;else{let a=window.innerWidth-(t.left||0)-t.width;r.right=`${a}px`}this.style=it(K({},r),{width:`${t.width}px`,height:`${t.height}px`}),this.resizedWidth=t.width,this.resizedHeight=t.height,this.debouncedSavePanelState()}debouncedSavePanelState(){this.saveStateTimer&&clearTimeout(this.saveStateTimer),this.saveStateTimer=setTimeout(()=>{let e=Number(this.style.top?.split("px")[0]),t=Number(this.style.right?.split("px")[0]),o=Number(this.style.width?.split("px")[0]),r=Number(this.style.height?.split("px")[0]);!isNaN(o)&&!isNaN(r)&&this.aiChatStore.updatePanelSize(o,r),!isNaN(e)&&!isNaN(t)&&this.aiChatStore.updatePanelPosition({top:e,right:t})},300)}cleanup(){this.aiChatStore.resetSessionState(),this.saveStateTimer&&(clearTimeout(this.saveStateTimer),this.saveStateTimer=null),this.dragRafId!==null&&(cancelAnimationFrame(this.dragRafId),this.dragRafId=null)}loadModelConfigs(){this.controller&&(this.isLoadingModels=!0,this.cdr.markForCheck(),this.loginService.getLoggedUser(this.controller).then(e=>{if(!e){this.isLoadingModels=!1,this.cdr.markForCheck();return}this.aiProfilesService.getConfigs(this.controller,e.user_id).pipe(tt(this.destroy$)).subscribe({next:t=>{this.modelConfigs=t.configs||[],this.currentModelId=t.default_config?.config_id||null,this.currentCopilotMode=t.default_config?.config?.copilot_mode||"teaching_assistant",this.isLoadingModels=!1,this.cdr.markForCheck()},error:t=>{this.logError("Failed to load model configs:",t),this.modelConfigs=[],this.currentModelId=null,this.isLoadingModels=!1,this.cdr.markForCheck()}})}).catch(e=>{this.logError("Failed to get logged user:",e),this.isLoadingModels=!1,this.cdr.markForCheck()}))}onModelSelected(e){this.controller&&this.loginService.getLoggedUser(this.controller).then(t=>{if(!t){this.showError("Failed to get user information");return}this.aiProfilesService.setDefaultConfig(this.controller,t.user_id,e.config_id).pipe(tt(this.destroy$)).subscribe({next:o=>{this.currentModelId=o.config_id,this.currentCopilotMode=o.config?.copilot_mode||"teaching_assistant",this.cdr.markForCheck();let r=Bv(e.config.model);this.snackBar.open(`Switched to ${r}`,"Close",{duration:3e3,horizontalPosition:"center",verticalPosition:"bottom"})},error:o=>{this.logError("Failed to set default model:",o),this.showError("Failed to switch model")}})}).catch(t=>{this.logError("Failed to get logged user:",t),this.showError("Failed to get user information")})}onCopilotModeSelected(e){!this.controller||!this.currentModelId||this.loginService.getLoggedUser(this.controller).then(t=>{if(!t){this.showError("Failed to get user information");return}this.aiProfilesService.updateConfig(this.controller,t.user_id,this.currentModelId,{copilot_mode:e}).pipe(tt(this.destroy$)).subscribe({next:o=>{this.currentCopilotMode=o.config?.copilot_mode||"teaching_assistant",this.cdr.markForCheck();let r=e==="teaching_assistant"?"Teaching Assistant":"Lab Automation";this.snackBar.open(`Switched to ${r} mode`,"Close",{duration:3e3,horizontalPosition:"center",verticalPosition:"bottom"})},error:o=>{this.logError("Failed to update copilot mode:",o),this.showError("Failed to switch copilot mode")}})}).catch(t=>{this.logError("Failed to get logged user:",t),this.showError("Failed to get user information")})}onAbortClicked(){if(!this.controller||!this.isStreaming)return;let e=this.currentSessionId||this.aiChatService.getCurrentSessionId();if(!e){this.logError("No session ID to abort");return}this.controllerService.get(this.controller.id).then(t=>{this.controller=t,this.aiChatService.abortChat(this.controller,this.project().project_id,e).pipe(tt(this.destroy$)).subscribe({next:()=>{this.logError("Chat aborted successfully")},error:o=>{this.logError("Failed to abort chat:",o),this.showError("Failed to abort chat")}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ai-chat"]],hostBindings:function(t,o){t&1&&g("resize",function(){return o.onWindowResize()},lr)},inputs:{project:[1,"project"],controller:"controller",zIndex:[1,"zIndex"]},outputs:{closed:"closed",windowFocused:"windowFocused"},features:[bn],decls:4,vars:12,consts:[[1,"gns3-ai-chat__drag-overlay"],["mwlResizable","",1,"gns3-ai-chat",3,"mousedown","resizeStart","resizeEnd","ngStyle","validateResize","enableGhostResize"],[1,"gns3-ai-chat__drag-overlay",3,"mousemove","mouseup"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-right",3,"resizeEdges"],[1,"gns3-ai-chat__sidebar"],[1,"gns3-ai-chat__sidebar-header"],["title","Click to toggle sidebar",1,"gns3-ai-chat__sidebar-title",3,"mousedown","click"],[1,"gns3-ai-chat__logo"],[1,"sidebar-text"],[1,"gns3-ai-chat__sidebar-content"],[1,"gns3-ai-chat__main"],[1,"gns3-ai-chat__header",3,"mousedown"],[1,"gns3-ai-chat__title"],[1,"gns3-ai-chat__header-actions"],["mat-icon-button","",1,"minimize-button",3,"mousedown","click"],["xmlns","http://www.w3.org/2000/svg","height","20","width","20","viewBox","0 0 24 24",1,"gns3-ai-chat__header-icon"],["d","M19 13H5v-2h14v2z"],["mat-icon-button","",1,"maximize-button",3,"mousedown","click"],["d","M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"],["d","M5 5h14v14H5z"],["mat-icon-button","",1,"close-button",3,"mousedown","click"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"],[1,"gns3-ai-chat__messages"],[3,"scrollToEnd","suggestionClicked","messages","isStreaming"],[1,"gns3-ai-chat__input"],[3,"messageSent","modelSelected","copilotModeSelected","abortClicked","disabled","isStreaming","modelConfigs","currentModelId","currentCopilotMode"],["mat-icon-button","",1,"gns3-ai-chat__new-chat-btn",3,"click"],[3,"sessionSelected","sessionCreated","sessionRenamed","sessionDeleted","sessionPinned","sessionUnpinned","sessions","currentSessionId","controller","projectId"]],template:function(t,o){t&1&&(A(0,Gwe,1,0,"div",0),s(1,"div",1),g("mousedown",function(){return o.onWindowFocus()})("resizeStart",function(){return o.toggleDragging(!1)})("resizeEnd",function(a){return o.onResizeEnd(a)}),A(2,Wwe,8,16),A(3,Zwe,28,17),l()),t&2&&(O(o.isDraggingEnabled&&!o.isMaximized&&!o.isMinimized?0:-1),m(),nn("z-index",o.zIndex()),Be("gns3-ai-chat--maximized",o.isMaximized)("gns3-ai-chat--minimized",o.isMinimized),C("ngStyle",o.style)("validateResize",o.validate)("enableGhostResize",!0),m(),O(o.isMinimized?-1:2),m(),O(o.isMinimized?-1:3))},dependencies:[ne,lc,ec,od,Ya,ie,de,W,je,y2,S2,w2],styles:['.gns3-ai-chat[_ngcontent-%COMP%]{position:fixed;background-color:var(--mat-sys-surface-container-low);border-radius:16px;overflow:hidden;display:flex;z-index:1000;color:var(--mat-sys-on-surface);border:1px solid var(--mat-sys-outline-variant);transition:box-shadow .2s ease,border-color .2s ease}.gns3-ai-chat[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;border-radius:16px;padding:1px;background:linear-gradient(135deg,color-mix(in srgb,var(--mat-sys-primary) 40%,transparent),color-mix(in srgb,var(--mat-sys-primary) 20%,transparent),color-mix(in srgb,var(--mat-sys-primary) 40%,transparent));-webkit-mask:linear-gradient(var(--mat-sys-white) 0 0) content-box,linear-gradient(var(--mat-sys-white) 0 0);mask:linear-gradient(var(--mat-sys-white) 0 0) content-box,linear-gradient(var(--mat-sys-white) 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none;opacity:.8;transition:opacity .2s ease}.gns3-ai-chat[_ngcontent-%COMP%]:hover:before{opacity:1}.gns3-ai-chat--minimized[_ngcontent-%COMP%]{border-radius:50%;border:none;box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 0 8px var(--mat-sys-primary);backdrop-filter:none}.gns3-ai-chat--minimized[_ngcontent-%COMP%]:before{display:none}.gns3-ai-chat--maximized[_ngcontent-%COMP%]{border-radius:0}.gns3-ai-chat--maximized[_ngcontent-%COMP%] .gns3-ai-chat__sidebar[_ngcontent-%COMP%]{height:100vh}.gns3-ai-chat--maximized[_ngcontent-%COMP%] .gns3-ai-chat__header[_ngcontent-%COMP%], .gns3-ai-chat--maximized[_ngcontent-%COMP%] .gns3-ai-chat__sidebar-header[_ngcontent-%COMP%]{cursor:default}.gns3-ai-chat[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface)}.gns3-ai-chat__drag-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:transparent;z-index:1001;cursor:grabbing}.gns3-ai-chat__sidebar[_ngcontent-%COMP%]{width:280px;background-color:color-mix(in srgb,var(--mat-sys-surface-container) 70%,transparent);display:flex;flex-direction:column;transition:width .2s ease;flex-shrink:0}.gns3-ai-chat__sidebar--collapsed[_ngcontent-%COMP%]{width:60px}.gns3-ai-chat__sidebar-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:16px;cursor:grab;user-select:none;height:56px;box-sizing:border-box}.gns3-ai-chat__sidebar-header[_ngcontent-%COMP%]:active{cursor:grabbing}.gns3-ai-chat__new-chat-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;height:56px;background:transparent;border-radius:0;transition:all .2s ease;margin:8px 0}.gns3-ai-chat__new-chat-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:24px;width:24px;height:24px;color:var(--mat-sys-primary);transition:all .2s ease}.gns3-ai-chat__new-chat-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.2);filter:drop-shadow(0 0 6px var(--mat-sys-primary))}.gns3-ai-chat__new-chat-btn[_ngcontent-%COMP%]:active mat-icon[_ngcontent-%COMP%]{transform:scale(.95)}.gns3-ai-chat__sidebar--collapsed[_ngcontent-%COMP%] .gns3-ai-chat__new-chat-btn[_ngcontent-%COMP%]{display:flex}.gns3-ai-chat__sidebar[_ngcontent-%COMP%]:not(--collapsed) .gns3-ai-chat__new-chat-btn[_ngcontent-%COMP%]{display:none}.gns3-ai-chat__sidebar-title[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface);display:flex;align-items:center;gap:8px;width:100%;justify-content:center}.gns3-ai-chat__sidebar-title--clickable[_ngcontent-%COMP%]{cursor:pointer;transition:all .1s ease}.gns3-ai-chat__sidebar-title--clickable[_ngcontent-%COMP%]:hover{opacity:.9}.gns3-ai-chat__sidebar-title--clickable[_ngcontent-%COMP%]:active{opacity:.8}.gns3-ai-chat__logo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;font-family:system-ui,-apple-system,sans-serif;letter-spacing:-.5px;background:linear-gradient(135deg,var(--mat-sys-primary),var(--mat-sys-primary));color:var(--mat-sys-on-primary);padding:6px 10px;border-radius:4px;transition:all .2s ease;flex-shrink:0;box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent);position:relative;overflow:hidden}.gns3-ai-chat__logo[_ngcontent-%COMP%]:after{content:"";position:absolute;top:-50%;left:-50%;width:200%;height:200%;background:linear-gradient(45deg,transparent 30%,color-mix(in srgb,var(--mat-sys-surface) 10%,transparent) 50%,transparent 70%);transform:translate(-100%);transition:transform .2s ease}.gns3-ai-chat__sidebar-title--clickable[_ngcontent-%COMP%]:hover .gns3-ai-chat__logo[_ngcontent-%COMP%]{transform:scale(1.08);box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-primary) 40%,transparent)}.gns3-ai-chat__sidebar-title--clickable[_ngcontent-%COMP%]:hover .gns3-ai-chat__logo[_ngcontent-%COMP%]:after{transform:translate(100%)}.gns3-ai-chat__sidebar-title--clickable[_ngcontent-%COMP%]:active .gns3-ai-chat__logo[_ngcontent-%COMP%]{transform:scale(.95)}.gns3-ai-chat__sidebar-content[_ngcontent-%COMP%]{flex:1;overflow:hidden}.gns3-ai-chat__main[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;background-color:color-mix(in srgb,var(--mat-sys-surface) 60%,transparent);min-width:0}.gns3-ai-chat__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0;cursor:grab;user-select:none;transition:background .2s ease;position:relative;height:56px;box-sizing:border-box}.gns3-ai-chat__header[_ngcontent-%COMP%]:active{cursor:grabbing}.gns3-ai-chat__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface)}.gns3-ai-chat__messages[_ngcontent-%COMP%]{flex:1;overflow:hidden;min-height:0}.gns3-ai-chat__input[_ngcontent-%COMP%]{border-top:1px solid transparent;flex-shrink:0;position:relative;transition:border-color .2s ease,box-shadow .2s ease}.gns3-ai-chat__input[_ngcontent-%COMP%]:focus-within{border-top-color:var(--mat-sys-primary);box-shadow:0 -2px 10px color-mix(in srgb,var(--mat-sys-primary) 20%,transparent)}.gns3-ai-chat__header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .mat-icon-button[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);transition:all .2s ease;width:40px;height:40px;min-width:40px;min-height:40px;padding:0;display:inline-flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .mat-icon-button[_ngcontent-%COMP%]:before{content:"";position:absolute;top:50%;left:50%;width:0;height:0;border-radius:50%;background:var(--mat-sys-primary);transform:translate(-50%,-50%);transition:width .2s ease,height .2s ease}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .mat-icon-button[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 15%,transparent);border-radius:50%;transform:scale(1.15);box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent)}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .mat-icon-button[_ngcontent-%COMP%]:hover:before{width:100%;height:100%}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .mat-icon-button[_ngcontent-%COMP%]:active{transform:scale(.95)}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .gns3-ai-chat__header-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-on-surface);transition:all .2s ease;width:24px;height:24px;position:relative;z-index:1}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .mat-icon-button[_ngcontent-%COMP%]:hover .gns3-ai-chat__header-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-primary);filter:drop-shadow(0 0 3px var(--mat-sys-primary))}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-error) 20%,transparent);box-shadow:0 0 10px color-mix(in srgb,var(--mat-sys-error) 40%,transparent)}.gns3-ai-chat__header-actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]:hover .gns3-ai-chat__header-icon[_ngcontent-%COMP%]{fill:var(--mat-sys-error)}.gns3-ai-chat__minimized-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;cursor:pointer;user-select:none;border-radius:50%;background:linear-gradient(135deg,var(--mat-sys-surface),var(--mat-sys-surface));box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 0 10px var(--mat-sys-primary);transition:all .2s ease;position:relative;overflow:hidden}.gns3-ai-chat__minimized-bar[_ngcontent-%COMP%]:hover{transform:scale(1.15);box-shadow:0 8px 24px color-mix(in srgb,var(--mat-sys-surface) 60%,transparent),0 0 15px var(--mat-sys-primary)}.gns3-ai-chat__minimized-bar[_ngcontent-%COMP%]:hover:before{background:radial-gradient(circle,var(--mat-sys-primary) 0%,transparent 70%);opacity:.5}.gns3-ai-chat__minimized-bar[_ngcontent-%COMP%]:active{transform:scale(1.05)}.gns3-ai-chat__minimized-bar[_ngcontent-%COMP%]:before{content:"";position:absolute;top:50%;left:50%;width:100%;height:100%;border-radius:50%;background:radial-gradient(circle,var(--mat-sys-primary) 0%,transparent 70%);opacity:0;transform:translate(-50%,-50%);transition:opacity .2s ease}.gns3-ai-chat__minimized-icon[_ngcontent-%COMP%]{font-size:28px;width:28px;height:28px;color:var(--mat-sys-outline);position:relative;z-index:1}.gns3-ai-chat__snack-error[_ngcontent-%COMP%]{background-color:var(--mat-sys-error);color:var(--mat-sys-on-error);font-weight:500}.gns3-ai-chat__snack-error[_ngcontent-%COMP%] .mat-simple-snackbar-action[_ngcontent-%COMP%]{color:var(--mat-sys-on-error);font-weight:600}@media(max-width:768px){.gns3-ai-chat__sidebar[_ngcontent-%COMP%]{position:absolute;z-index:100;height:100%}.gns3-ai-chat__sidebar--collapsed[_ngcontent-%COMP%]{width:0}}.resize-handle[_ngcontent-%COMP%]{position:absolute;z-index:100;opacity:0;transition:opacity .15s ease}.gns3-ai-chat[_ngcontent-%COMP%]:hover .resize-handle[_ngcontent-%COMP%]{opacity:1}.resize-handle.resize-handle-top[_ngcontent-%COMP%]{top:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-right[_ngcontent-%COMP%]{top:12px;right:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-bottom[_ngcontent-%COMP%]{bottom:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-left[_ngcontent-%COMP%]{top:12px;left:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-top-left[_ngcontent-%COMP%]{top:-6px;left:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}.resize-handle.resize-handle-top-right[_ngcontent-%COMP%]{top:-6px;right:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-left[_ngcontent-%COMP%]{bottom:-6px;left:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-right[_ngcontent-%COMP%]{bottom:-6px;right:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}'],changeDetection:0})}return n})();var D9="gns3_console_appearance",jv=16,YA=8,ZA=28,Jwe="ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, 'Courier New', monospace",P9=[{name:"Auto (system monospace)",value:null},{name:"Cascadia Code",value:"Cascadia Code"},{name:"JetBrains Mono",value:"JetBrains Mono"},{name:"Fira Code",value:"Fira Code"},{name:"Source Code Pro",value:"Source Code Pro"},{name:"Inconsolata",value:"Inconsolata"},{name:"Ubuntu Mono",value:"Ubuntu Mono"},{name:"Hack",value:"Hack"},{name:"Consolas",value:"Consolas"},{name:"Courier New",value:"Courier New"},{name:"Menlo",value:"Menlo"}],hg=(()=>{class n{themeService;_allowedFontFamilies=new Set(P9.map(e=>e.value).filter(e=>e!==null));_settingsChanged=new He;settingsChanged$=this._settingsChanged.asObservable();_settings={fontSize:jv,fontFamily:null,foregroundColor:null,backgroundColor:null};constructor(e){this.themeService=e,this.loadSettings()}get settings(){return K({},this._settings)}loadSettings(){try{let e=localStorage.getItem(D9);if(e){let t=JSON.parse(e);this._settings=this._sanitizeSettings(t)}}catch{}}updateSettings(e){this._settings=this._sanitizeSettings(K(K({},this._settings),e));try{localStorage.setItem(D9,JSON.stringify(this._settings))}catch{}this._settingsChanged.next(K({},this._settings))}_sanitizeSettings(e){return{fontSize:this._sanitizeFontSize(e.fontSize),fontFamily:this._sanitizeFontFamily(e.fontFamily),foregroundColor:this._sanitizeColor(e.foregroundColor),backgroundColor:this._sanitizeColor(e.backgroundColor)}}_sanitizeFontSize(e){return typeof e!="number"||!Number.isFinite(e)?jv:Math.max(YA,Math.min(ZA,Math.round(e)))}_sanitizeFontFamily(e){if(e==null||typeof e!="string")return null;let t=e.trim();return t&&this._allowedFontFamilies.has(t)?t:null}_sanitizeColor(e){if(e==null||typeof e!="string")return null;let t=e.trim();return t&&/^#[0-9a-f]{6}$/i.test(t)?t:null}resolveColorToHex(e){if(!e)return"#000000";if(/^#[0-9a-f]{6}$/i.test(e))return e;try{let t=document.createElement("canvas");t.width=t.height=1;let o=t.getContext("2d");if(!o)return"#000000";o.fillStyle=e,o.fillRect(0,0,1,1);let[r,a,c]=o.getImageData(0,0,1,1).data;return`#${r.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}catch{return"#000000"}}getCssVar(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}_getCssVars(e){let t=getComputedStyle(document.documentElement),o={};for(let r of e)o[r]=t.getPropertyValue(r).trim();return o}getEffectiveForegroundHex(){return this._settings.foregroundColor?this._settings.foregroundColor:this.resolveColorToHex(this.getCssVar("--mat-sys-on-surface"))}getEffectiveBackgroundHex(){return this._settings.backgroundColor?this._settings.backgroundColor:this.resolveColorToHex(this.getCssVar("--mat-sys-surface"))}buildTerminalTheme(e){let t=this._getCssVars(["--mat-sys-on-surface","--mat-sys-surface","--mat-sys-primary-container","--mat-sys-on-primary-container","--mat-sys-error","--mat-sys-primary","--mat-sys-tertiary","--mat-sys-outline","--mat-sys-surface-variant"]),o=this._settings.foregroundColor||t["--mat-sys-on-surface"],r=this._settings.backgroundColor||t["--mat-sys-surface"],a={background:r,foreground:o,cursor:o,cursorAccent:r,selectionBackground:t["--mat-sys-primary-container"],selectionForeground:t["--mat-sys-on-primary-container"],black:t["--mat-sys-on-surface"],red:t["--mat-sys-error"],green:t["--mat-sys-primary"],yellow:t["--mat-sys-tertiary"],blue:t["--mat-sys-primary"],magenta:t["--mat-sys-error"],cyan:t["--mat-sys-primary"],brightBlack:t["--mat-sys-outline"],brightRed:t["--mat-sys-error"],brightGreen:t["--mat-sys-primary"],brightYellow:t["--mat-sys-tertiary"],brightBlue:t["--mat-sys-primary"],brightMagenta:t["--mat-sys-error"],brightCyan:t["--mat-sys-primary"]};return e?(a.white=t["--mat-sys-surface-variant"],a.brightWhite=t["--mat-sys-surface"]):(a.white=t["--mat-sys-on-surface"],a.brightWhite=t["--mat-sys-surface"]),a}updateTerminalTheme(e,t){let o=this.themeService.getActualTheme()==="light";e.options.theme=this.buildTerminalTheme(o),t?.markForCheck()}getDefaultTerminalOptions(){return{cursorBlink:!0,cursorStyle:"block",fontSize:this._settings.fontSize,fontFamily:this._resolveFontFamily(),rightClickSelectsWord:!0,altClickMovesCursor:!0,scrollback:1e3}}_resolveFontFamily(){return this._settings.fontFamily?`'${this._settings.fontFamily}', monospace`:Jwe}initTerminal(e,t){e.loadAddon(t),t.activate(e)}getInstalledFonts(){return P9.filter(e=>e.value?this._isFontInstalled(e.value):!0)}_isFontInstalled(e){try{if(document.fonts.check(`16px "${e}"`))return!0;let o=document.createElement("canvas").getContext("2d");if(!o)return!1;let r="abcdefghijklmnopqrstuvwxyz0123456789".repeat(2);o.font=`16px "${e}", monospace`;let a=o.measureText(r).width;o.font="16px monospace";let c=o.measureText(r).width;return Math.abs(a-c)>1}catch{return!1}}applySettingsToTerminal(e,t,o){let r=this.themeService.getActualTheme()==="light";e.options.fontSize=this._settings.fontSize,e.options.fontFamily=this._resolveFontFamily(),e.options.theme=this.buildTerminalTheme(r),t&&setTimeout(()=>{try{t.fit()}catch{}},50),o?.markForCheck()}calculateTerminalDimensions(e,t,o){let r=e._core;if(r){let a=r._charMeasure;if(a&&a.width&&a.height)return{cols:Math.floor(t/a.width),rows:Math.floor(o/a.height)}}return{cols:Math.floor(t/8.4),rows:Math.floor(o/17)}}static \u0275fac=function(t){return new(t||n)(ge(ci))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var I9=n=>({lightTheme:n}),e2e=(n,i)=>i.node_id;function t2e(n,i){n&1&&(s(0,"span",4),d(1,"Devices"),l())}function n2e(n,i){if(n&1){let e=z();s(0,"div",8),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.onDeviceClick(o))}),s(1,"div",9),R(2,"div",10),s(3,"div",11)(4,"div",12),d(5),l()()(),s(6,"mat-icon",13),d(7," terminal "),l()()}if(n&2){let e=i.$implicit,t=v(2);Be("started",t.isDeviceStarted(e)),m(2),nn("background-color",t.getStatusColor(e.status)),m(3),j(e.name),m(),Be("disabled",!t.isDeviceStarted(e))}}function i2e(n,i){n&1&&(s(0,"div",7)(1,"mat-icon",14),d(2,"devices"),l(),s(3,"div",15),d(4,"No console devices available"),l()())}function o2e(n,i){if(n&1&&(s(0,"div",5),Y(1,n2e,8,7,"div",6,e2e),A(3,i2e,5,0,"div",7),l()),n&2){let e=v();m(),Z(e.nodes()),m(2),O(e.nodes().length===0?3:-1)}}var k2=(()=>{class n{nodesDataSource=f(di);cdr=f(Q);deviceSelected=new ve;isLightTheme=le(!1);nodes=ae([]);collapsed=ae(!0);destroy$=new He;constructor(){}ngOnInit(){this.nodesDataSource.changes.pipe(tt(this.destroy$)).subscribe(e=>{let t=e.filter(o=>{let r=o.console_type==="none"||!o.console_type,a=o.console_type==="vnc",c=o.console_type&&o.console_type.startsWith("http");return!r&&!a&&!c});this.nodes.set(t),this.sortNodes(),this.cdr.markForCheck()}),this.nodesDataSource.itemChanged.pipe(tt(this.destroy$)).subscribe(e=>{let t=this.nodes(),o=t.findIndex(r=>r.node_id===e.node_id);o>=0&&(t[o]=e,this.nodes.set([...t]),this.sortNodes(),this.cdr.markForCheck())})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}isDeviceStarted(e){return e.status==="started"}sortNodes(){let e=this.nodes();e.sort((t,o)=>{let r=t.status==="started",a=o.status==="started";return r&&!a?-1:!r&&a?1:t.name.localeCompare(o.name)}),this.nodes.set([...e])}getStatusColor(e){return{started:"var(--mat-sys-primary)",starting:"var(--mat-sys-tertiary)",stopped:"var(--mat-sys-outline)",suspended:"var(--mat-sys-secondary)",errored:"var(--mat-sys-error)"}[e]||"var(--mat-sys-outline)"}onDeviceClick(e){this.deviceSelected.emit(e)}togglePanel(){this.collapsed.set(!this.collapsed()),this.cdr.markForCheck()}getStatusLabel(e){return{started:"Running",starting:"Starting",stopped:"Stopped",suspended:"Suspended",errored:"Error"}[e]||"Unknown"}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-console-devices-panel"]],inputs:{isLightTheme:[1,"isLightTheme"]},outputs:{deviceSelected:"deviceSelected"},decls:7,vars:12,consts:[[1,"console-devices-panel",3,"ngClass"],["title","Click to toggle panel",1,"panel-header",3,"mousedown","click","ngClass"],[1,"header-title"],[1,"panel-icon"],[1,"header-text"],[1,"device-list"],[1,"device-item",3,"started"],[1,"empty-state"],[1,"device-item",3,"click"],[1,"device-info"],[1,"device-status-indicator"],[1,"device-details"],[1,"device-name"],[1,"device-icon"],[1,"empty-icon"],[1,"empty-text"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1),g("mousedown",function(a){return a.stopPropagation()})("click",function(){return o.togglePanel()}),s(2,"div",2)(3,"mat-icon",3),d(4,"devices"),l(),A(5,t2e,2,0,"span",4),l()(),A(6,o2e,4,1,"div",5),l()),t&2&&(Be("collapsed",o.collapsed()),C("ngClass",dn(8,I9,o.isLightTheme())),m(),Be("clickable",!0),C("ngClass",dn(10,I9,o.isLightTheme())),m(4),O(o.collapsed()?-1:5),m(),O(o.collapsed()?-1:6))},dependencies:[ne,Yi,ie,de],styles:[".console-devices-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:200px;height:100%;background-color:var(--mat-sys-surface);border-right:1px solid var(--mat-sys-outline-variant);transition:width .1s ease}.console-devices-panel.collapsed[_ngcontent-%COMP%]{width:48px}.panel-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:40px;padding:0 12px;border-bottom:1px solid var(--mat-sys-outline-variant);background-color:var(--mat-sys-surface-container-low);flex-shrink:0}.panel-header.clickable[_ngcontent-%COMP%]{cursor:pointer;transition:all .1s ease}.panel-header[_ngcontent-%COMP%]:hover.clickable{background-color:var(--mat-sys-surface-container)}.panel-header[_ngcontent-%COMP%]:active.clickable{background-color:var(--mat-sys-surface-container-high)}.header-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:4px;margin:0;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface)}.panel-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--mat-sys-primary)}.header-text[_ngcontent-%COMP%]{font-size:12px;font-weight:500;white-space:nowrap}.device-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:4px}.device-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:8px;margin-bottom:4px;border-radius:4px;cursor:pointer;transition:background-color .1s ease;background:var(--mat-sys-surface-container-low)}.device-item[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container)}.device-item.started[_ngcontent-%COMP%]{border-left:3px solid var(--mat-sys-primary)}.device-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex:1;min-width:0}.device-status-indicator[_ngcontent-%COMP%]{width:4px;height:4px;border-radius:50%;flex-shrink:0}.device-details[_ngcontent-%COMP%]{flex:1;min-width:0}.device-name[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.device-status[_ngcontent-%COMP%]{font-size:12px;margin-top:2px;opacity:.8}.device-icon[_ngcontent-%COMP%]{font-size:12px;width:12px;height:12px;color:var(--mat-sys-primary);flex-shrink:0;opacity:.8}.device-icon.disabled[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);opacity:.4}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 8px;text-align:center}.empty-icon[_ngcontent-%COMP%]{font-size:24px;width:24px;height:24px;color:var(--mat-sys-on-surface-variant);opacity:.4;margin-bottom:8px}.empty-text[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.8}@media(max-width:768px){.console-devices-panel[_ngcontent-%COMP%]{position:absolute;height:100%}.console-devices-panel.collapsed[_ngcontent-%COMP%]{width:0}}"],changeDetection:0})}return n})();var O9=Bs(eO()),N9=Bs(nO()),F9=Bs(oO());var P2=(()=>{class n{toaster=f(te);currentMenu=null;attachContextMenu(e,t){let o=r=>{r.preventDefault(),this.showContextMenu(r,e)};return t.addEventListener("contextmenu",o),()=>{t.removeEventListener("contextmenu",o)}}showContextMenu(e,t){this.dismissCurrentMenu();let o=!1;try{if(typeof t.hasSelection=="function")o=t.hasSelection();else{let p=t.getSelection();o=p!=null&&p.trim().length>0}}catch(p){console.error("Error checking selection:",p);let u=t.getSelection();o=u!=null&&u.trim().length>0}let r=document.createElement("div");r.className="xterm-context-menu",this.currentMenu=r;let{left:a,top:c}=this.calculateMenuPosition(e);r.style.left=`${a}px`,r.style.top=`${c}px`,this.createMenuItems(r,t,o),document.body.appendChild(r),this.setupMenuCleanup(r,t)}dismissCurrentMenu(){this.currentMenu&&this.currentMenu.parentNode&&this.currentMenu.remove(),this.currentMenu=null}calculateMenuPosition(e){let t=e.clientX,o=e.clientY,r=180,a=120;return t+r>window.innerWidth&&(t=window.innerWidth-r-10),o+a>window.innerHeight&&(o=window.innerHeight-a-10),t=Math.max(10,t),o=Math.max(10,o),{left:t,top:o}}createMenuItems(e,t,o){if(o){let p=this.createMenuItem("Copy","Ctrl+Shift+C",()=>{try{let u=t.getSelection();u&&navigator.clipboard.writeText(u).then(()=>{this.toaster.success("Copied to clipboard"),t.clearSelection()}).catch(h=>{console.error("Failed to copy:",h),h.name==="NotAllowedError"?this.toaster.error("Clipboard permission denied. Please allow clipboard access."):this.toaster.error("Failed to copy. Please try again.")})}catch(u){console.error("Error copying:",u),this.toaster.error("Failed to copy. Please try again.")}});e.appendChild(p)}let r=this.createMenuItem("Paste","Ctrl+Shift+V",()=>{try{navigator.clipboard.readText().then(p=>{p?t.paste(p):this.toaster.warning("Nothing to paste. Clipboard is empty.")}).catch(p=>{console.error("Failed to paste:",p),p.name==="NotAllowedError"?this.toaster.error("Clipboard permission denied. Please allow clipboard access."):this.toaster.error("Failed to paste. Please try again.")})}catch(p){console.error("Error pasting:",p),this.toaster.error("Failed to paste. Please try again.")}});e.appendChild(r);let a=document.createElement("div");a.className="xterm-context-menu-separator",e.appendChild(a);let c=this.createMenuItem("Select All","",()=>{try{t.selectAll()}catch(p){console.error("Error selecting all:",p)}});if(e.appendChild(c),o){let p=this.createMenuItem("Clear Selection","",()=>{try{t.clearSelection()}catch(u){console.error("Error clearing selection:",u)}});e.appendChild(p)}}createMenuItem(e,t,o){let r=document.createElement("div");return r.className="xterm-context-menu-item",r.textContent=e,r.setAttribute("role","menuitem"),r.setAttribute("tabindex","0"),t&&r.setAttribute("data-shortcut",t),r.addEventListener("click",()=>{o(),this.dismissCurrentMenu()}),r.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),r.click())}),r}setupMenuCleanup(e,t){let o=!1,r=()=>{o||(o=!0,this.currentMenu===e&&(this.currentMenu=null),e.remove(),document.removeEventListener("click",a),document.removeEventListener("keydown",c),t.focus())},a=u=>{e.contains(u.target)||r()},c=u=>{u.key==="Escape"&&(u.preventDefault(),r())},p=new MutationObserver(u=>{for(let h of u)if(h.type==="childList"&&h.removedNodes.length>0){let _=Array.from(h.removedNodes);for(let S of _)if(S===e){document.removeEventListener("click",a),document.removeEventListener("keydown",c),p.disconnect();return}}});p.observe(document.body,{childList:!0,subtree:!1}),setTimeout(()=>{o||(document.addEventListener("click",a),document.addEventListener("keydown",c))},0)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var r2e=["terminal"],fg=(()=>{class n{controller=le(void 0);project=le(void 0);node=le(void 0);consoleService=f(rr);themeService=f(ci);cdr=f(Q);contextMenuService=f(P2);xtermService=f(hg);term=new O9.Terminal(K({cols:100,rows:32},this.xtermService.getDefaultTerminalOptions()));fitAddon=new F9.FitAddon;socket=null;isLightThemeEnabled=!1;resizeObserver=null;contextMenuCleanup=null;destroy$=new He;isDestroying=!1;terminal=Nt("terminal");constructor(){}ngOnInit(){this.isLightThemeEnabled=this.themeService.getActualTheme()==="light",this.cdr.markForCheck(),this.themeService.themeChanged.pipe(tt(this.destroy$)).subscribe(()=>{this.xtermService.updateTerminalTheme(this.term,this.cdr),this.isLightThemeEnabled=this.themeService.getActualTheme()==="light"}),this.consoleService.consoleResized.pipe(tt(this.destroy$)).subscribe(()=>{setTimeout(()=>{this.fitTerminal()},50)}),this.consoleService.getNumberOfColumns()&&this.consoleService.getNumberOfRows()&&this.term.resize(this.consoleService.getNumberOfColumns(),this.consoleService.getNumberOfRows())}ngAfterViewInit(){let e=this.terminal();this.term.open(e.nativeElement),this.xtermService.updateTerminalTheme(this.term,this.cdr),this.socket=new WebSocket(this.consoleService.getUrl(this.controller(),this.node())),this.socket.onerror=()=>{console.error("[WebConsole] Socket connection error"),this.term.write(`\r
\x1B[31mConnection lost. Please check if the node is still running.\x1B[0m\r
`)},this.socket.onclose=()=>{if(!this.isDestroying){console.log("[WebConsole] Socket closed unexpectedly"),this.term.write(`\r
\x1B[33mConnection closed.\x1B[0m\r
`);let o=this.node();o&&this.consoleService.closeConsoleForNode(o)}};let t=new N9.AttachAddon(this.socket);this.term.loadAddon(t),this.xtermService.initTerminal(this.term,this.fitAddon),this.fitAddon.fit(),this.term.focus(),this.term.attachCustomKeyEventHandler(o=>{if(o.altKey&&o.key>="1"&&o.key<="9"){let r=new CustomEvent("consoleTabShortcut",{detail:{key:o.key},bubbles:!0});return this.term.element.dispatchEvent(r),!1}return!((o.code==="KeyC"||o.code==="KeyV")&&o.ctrlKey&&o.shiftKey)}),this.setupResizeObserver(),this.xtermService.settingsChanged$.pipe(tt(this.destroy$)).subscribe(()=>{this.xtermService.applySettingsToTerminal(this.term,this.fitAddon,this.cdr)}),this.contextMenuCleanup=this.contextMenuService.attachContextMenu(this.term,e.nativeElement)}setupResizeObserver(){let e=this.terminal();e?.nativeElement&&(this.resizeObserver=new ResizeObserver(t=>{for(let o of t){let{width:r,height:a}=o.contentRect;r===0||a===0||requestAnimationFrame(()=>{try{this.fitTerminal()}catch{}})}}),this.resizeObserver.observe(e.nativeElement))}fitTerminal(){this.fitAddon.fit();let e=this.term.cols,t=this.term.rows;this.consoleService.setNumberOfColumns(e),this.consoleService.setNumberOfRows(t),this.term.resize(e,t)}focusTerminal(){this.term&&this.term.focus()}ngOnDestroy(){this.isDestroying=!0,this.destroy$.next(),this.destroy$.complete(),this.socket&&(this.socket.close(),this.socket=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.contextMenuCleanup&&(this.contextMenuCleanup(),this.contextMenuCleanup=null),this.term.dispose()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-web-console"]],viewQuery:function(t,o){t&1&&Xt(o.terminal,r2e,5),t&2&&Kt()},inputs:{controller:[1,"controller"],project:[1,"project"],node:[1,"node"]},decls:2,vars:0,consts:[["terminal",""],[1,"terminal"]],template:function(t,o){t&1&&bs(0,"div",1,0)},dependencies:[ne],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;height:100%}[hidden][_nghost-%COMP%]{display:none}.lightTheme[_nghost-%COMP%]{background:var(--mat-sys-surface);color:var(--mat-sys-on-surface)}.terminal[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0})}return n})();var R9={name:"gns3-web-ui",version:"3.1.0a4",author:{name:"GNS3 Technology Inc.",email:"developers@gns3.com"},description:"Graphical Network Simulator-3 is a network software emulator.",license:"GPLv3",repository:{type:"git",url:"https://github.com/GNS3/gns3-web-ui.git"},scripts:{ng:"ng",start:"ng serve",build:"ng build",buildforproduction:"ng build --source-map=false --configuration=production --base-href /static/web-ui/",buildforgithub:"ng build --configuration=githubProd",test:"ng test","test:run":"ng test --watch=false",lint:"ng lint",release:"build","prettier:base":"prettier","prettier:check":'yarn prettier:base -- --list-different "src/**/*.{ts,js,html,scss}"',"prettier:write":'yarn prettier:base -- --write "src/**/*.{ts,js,html,scss}"',"generate-licenses-file":"yarn license-checker --production --csv --out licenses.csv","snyk-protect":"snyk-protect",prepare:"husky install"},private:!0,dependencies:{"@angular/animations":"^21.0.0","@angular/cdk":"^21.0.0","@angular/common":"^21.0.0","@angular/compiler":"^21.0.0","@angular/core":"^21.0.0","@angular/forms":"^21.0.0","@angular/material":"^21.0.0","@angular/platform-browser":"^21.0.0","@angular/platform-browser-dynamic":"^21.0.0","@angular/router":"^21.0.0","@snyk/protect":"^1.972.0","@types/react":"^17.0.34","@types/react-dom":"^17.0.11","@xterm/addon-attach":"^0.11.0","@xterm/addon-fit":"^0.10.0","@xterm/xterm":"^5.5.0","angular-draggable-droppable":"^9.0.1","angular-resizable-element":"^8.0.3",bootstrap:"5.3.8","command-exists":"^1.2.9","core-js":"^3.22.3","css-tree":"^2.1.0","dagre-d3-es":"7.0.14",dompurify:"3.4.0",eev:"^0.1.5","github-markdown-css":"^5.9.0",ini:"^3.0.0","ipaddr.js":"^2.1.0",marked:"^17.0.0","material-design-icons":"^3.0.1","material-symbols":"^0.43.0",mousetrap:"^1.6.5","ng2-file-upload":"^3.0.0","ngx-device-detector":"4.0.1","ngx-json-viewer":"^3.2.1","ngx-markdown":"^21.2.0","node-fetch":"^3.2.10","notosans-fontface":"^1.3.0","postcss-loader":"^6.2.1","prettier-plugin-organize-imports":"^2.3.4",rxjs:"^7.5.0","save-svg-as-png":"^1.4.17","spark-md5":"^3.0.2","spice-html5-bower":"^1.7.3","svg-crowbar":"^0.7.0","tree-kill":"^1.2.2",tslib:"^2.4.0","typeface-roboto":"^1.1.13",yargs:"^17.4.1"},devDependencies:{"@analogjs/vite-plugin-angular":"^2.4.0","@angular-devkit/build-angular":"^21.0.0","@angular-eslint/builder":"^21.3.1","@angular-eslint/eslint-plugin":"^21.3.1","@angular-eslint/eslint-plugin-template":"^21.3.1","@angular-eslint/schematics":"^21.3.1","@angular-eslint/template-parser":"^21.3.1","@angular/build":"^21.2.5","@angular/cli":"^21.2.3","@angular/compiler-cli":"^21.0.0","@angular/language-service":"^21.0.0","@babel/runtime":"^7.29.2","@sentry/cli":"^2.0.4","@types/node":"24","@typescript-eslint/eslint-plugin":"^8.57.2","@typescript-eslint/parser":"^8.57.2","@typescript-eslint/utils":"^8.57.2",autoprefixer:"^10.4.27",esbuild:"^0.27.4",eslint:"^9.0.0","file-loader":"^6.2.0",husky:"^8.0.3",jsdom:"^29.0.1","license-checker":"^25.0.1","popper.js":"^1.16.1",postcss:"^8.5.8",prettier:"^2.6.2",replace:"^1.2.1",sass:"^1.98.0","ts-node":"^10.7.0",typescript:"~5.9.0",vite:"^8.0.3","vite-tsconfig-paths":"^6.1.1",vitest:"^4.1.2",webpack:"^5.72.0","yarn-upgrade-all":"^0.7.1"},greenkeeper:{ignore:["typescript"]},snyk:!0,engines:{node:">=18.0.0"},overrides:{dompurify:"3.4.0","dagre-d3-es":"7.0.14",yaml:"1.10.3","lodash-es":"4.18.0"},resolutions:{dompurify:"3.4.0","dagre-d3-es":"7.0.14",yaml:"1.10.3","lodash-es":"4.18.0"}};var gg=R9.version;var I2=(()=>{class n extends Qd{getItemKey(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var L9=Bs(GA());var s2e=["console"],l2e=["commandInput"],A2=n=>({lightTheme:n});function c2e(n,i){if(n&1&&(s(0,"span",9),d(1),R(2,"br"),l()),n&2){let e=i.$implicit;m(),ee(" ",e.message," ")}}var _g=(()=>{class n{projectWebServiceHandler=f(Wf);nodeService=f(ut);nodesDataSource=f(di);protocolHandlerService=f(pp);logEventsDataSource=f(I2);httpService=f(mn);themeService=f(ci);cd=f(Q);nodeConsoleService=f(rr);controller;project=le(void 0);console=Nt("console");commandInput=Nt("commandInput");focusInput(){let e=this.commandInput();e?.nativeElement&&e.nativeElement.focus()}version=gg;nodeSubscription;linkSubscription;drawingSubscription;controllerRequestsSubscription;errorSubscription;warningSubscription;infoSubscription;command=U("");filters=["all","errors","warnings","info","map updates","controller requests"];selectedFilter="all";filteredEvents=[];regexStart=/^start (.*?)$/;regexStop=/^stop (.*?)$/;regexSuspend=/^suspend (.*?)$/;regexReload=/^reload (.*?)$/;regexShow=/^show (.*?)$/;regexConsole=/^console (.*?)$/;style={};isDraggingEnabled=!1;isLightThemeEnabled=!1;selected=new Ye(0);constructor(){}ngOnInit(){this.nodeConsoleService.consoleResized.subscribe(e=>{this.style={width:`${e.width}px`,height:`${e.height-70}px`},this.cd.detectChanges()}),this.themeService.getActualTheme()==="light"?this.isLightThemeEnabled=!0:this.isLightThemeEnabled=!1,this.style={width:"848px",height:"477px"},this.nodeSubscription=this.projectWebServiceHandler.nodeNotificationEmitter.subscribe(e=>{let t=e.event,o="";t.label?o=`Event received: ${e.action} - ${this.printNode(t)}.`:o=`Event received: ${e.action} - ${t.name}.`,this.showMessage({type:"map update",message:o})}),this.linkSubscription=this.projectWebServiceHandler.linkNotificationEmitter.subscribe(e=>{let t=e.event,o=`Event received: ${e.action} - ${this.printLink(t)}.`;this.showMessage({type:"map update",message:o})}),this.drawingSubscription=this.projectWebServiceHandler.drawingNotificationEmitter.subscribe(e=>{let t=e.event,o=`Event received: ${e.action} - ${this.printDrawing(t)}.`;this.showMessage({type:"map update",message:o})}),this.controllerRequestsSubscription=this.httpService.requestsNotificationEmitter.subscribe(e=>{this.showMessage({type:"controller request",message:e})}),this.errorSubscription=this.projectWebServiceHandler.errorNotificationEmitter.subscribe(e=>{this.showMessage({type:"error",message:e})}),this.warningSubscription=this.projectWebServiceHandler.warningNotificationEmitter.subscribe(e=>{this.showMessage({type:"warning",message:e})}),this.infoSubscription=this.projectWebServiceHandler.infoNotificationEmitter.subscribe(e=>{this.showMessage({type:"info",message:e})})}ngAfterViewInit(){let e=this.console();e.nativeElement&&(e.nativeElement.scrollTop=e.nativeElement.scrollHeight)}ngOnDestroy(){this.nodeSubscription.unsubscribe(),this.linkSubscription.unsubscribe(),this.drawingSubscription.unsubscribe(),this.controllerRequestsSubscription.unsubscribe(),this.errorSubscription.unsubscribe(),this.warningSubscription.unsubscribe(),this.infoSubscription.unsubscribe()}applyFilter(e){this.selectedFilter=e,this.filteredEvents=this.getFilteredEvents(),this.cd.detectChanges()}onKeyDown(e){e.key==="Enter"&&this.handleCommand()}handleCommand(){if(this.command()==="help"||this.command()==="")this.showCommand("Available commands: help, version, console {node name}, start all, start {node name}, stop all, stop {node name}, suspend all, suspend {node name}, reload all, reload {node name}, show {node name}.");else if(this.command()==="version")this.showCommand("Current version: "+this.version);else if(this.command()==="start all")this.showCommand("Starting all nodes..."),this.nodeService.startAll(this.controller,this.project()).subscribe(()=>{this.showCommand("All nodes started.")});else if(this.command()==="stop all")this.showCommand("Stopping all nodes..."),this.nodeService.stopAll(this.controller,this.project()).subscribe(()=>{this.showCommand("All nodes stopped.")});else if(this.command()==="suspend all")this.showCommand("Suspending all nodes..."),this.nodeService.suspendAll(this.controller,this.project()).subscribe(()=>{this.showCommand("All nodes suspended.")});else if(this.command()==="reload all")this.showCommand("Reloading all nodes..."),this.nodeService.reloadAll(this.controller,this.project()).subscribe(()=>{this.showCommand("All nodes reloaded.")});else if(this.regexStart.test(this.command())||this.regexStop.test(this.command())||this.regexSuspend.test(this.command())||this.regexReload.test(this.command())||this.regexShow.test(this.command())||this.regexConsole.test(this.command())){let t=this.command().split(/[ ,]+/),o=this.nodesDataSource.getItems().find(r=>r.name.valueOf()===t[1].valueOf());if(o)if(this.regexStart.test(this.command()))this.showCommand(`Starting node ${t[1]}...`),this.nodeService.start(this.controller,o).subscribe(()=>this.showCommand(`Node ${o.name} started.`));else if(this.regexStop.test(this.command()))this.showCommand(`Stopping node ${t[1]}...`),this.nodeService.stop(this.controller,o).subscribe(()=>this.showCommand(`Node ${o.name} stopped.`));else if(this.regexSuspend.test(this.command()))this.showCommand(`Suspending node ${t[1]}...`),this.nodeService.suspend(this.controller,o).subscribe(()=>this.showCommand(`Node ${o.name} suspended.`));else if(this.regexReload.test(this.command()))this.showCommand(`Reloading node ${t[1]}...`),this.nodeService.reload(this.controller,o).subscribe(()=>this.showCommand(`Node ${o.name} reloaded.`));else if(this.regexConsole.test(this.command()))if(o.status==="started"){this.showCommand(`Launching console for node ${t[1]}...`);var e=o.console_host;(e==="0.0.0.0"||e==="::"||e==="0:0:0:0:0:0:0:0")&&(e=this.controller.host),L9.IPv6.isValid(e)&&(e=`[${e}]`),o.console_type==="telnet"||o.console_type==="ssh"?this.protocolHandlerService.open(`gns3+${o.console_type}://${e}:${o.console}?name=${encodeURIComponent(o.name)}&project_id=${o.project_id}&node_id=${o.node_id}`):o.console_type==="vnc"?this.protocolHandlerService.open(`gns3+vnc://${e}:${o.console}?name=${encodeURIComponent(o.name)}&project_id=${o.project_id}&node_id=${o.node_id}`):o.console_type&&o.console_type.startsWith("spice")?this.protocolHandlerService.open(`gns3+spice://${e}:${o.console}?name=${encodeURIComponent(o.name)}&project_id=${o.project_id}&node_id=${o.node_id}`):o.console_type&&o.console_type.startsWith("http")?window.open(`${o.console_type}://${e}:${o.console}`):this.showCommand("Supported console types are: telnet, ssh, vnc, spice and spice+agent")}else this.showCommand("This node must be started before a console can be opened.");else this.regexShow.test(this.command())&&(this.showCommand(`Information about node ${o.name}:`),this.showCommand(this.printNode(o)));else this.showCommand(`Node with ${t[1]} name was not found.`)}else this.showCommand(`Unknown syntax: ${this.command()}`);this.command.set(""),this.cd.detectChanges()}clearConsole(){this.filteredEvents=[],this.console().nativeElement.scrollTop=this.console().nativeElement.scrollHeight}showCommand(e){this.showMessage({type:"command",message:e})}showMessage(e){this.logEventsDataSource.add(e),this.filteredEvents=this.getFilteredEvents(),this.console().nativeElement.scrollTop=this.console().nativeElement.scrollHeight,setTimeout(()=>{this.console().nativeElement.scrollTop=this.console().nativeElement.scrollHeight},100),this.cd.detectChanges()}getFilteredEvents(){return this.selectedFilter==="controller requests"?this.logEventsDataSource.getItems().filter(e=>e.type==="controller request"):this.selectedFilter==="errors"?this.logEventsDataSource.getItems().filter(e=>e.type==="error"):this.selectedFilter==="warnings"?this.logEventsDataSource.getItems().filter(e=>e.type==="warning"):this.selectedFilter==="info"?this.logEventsDataSource.getItems().filter(e=>e.type==="info"):this.selectedFilter==="map updates"?this.logEventsDataSource.getItems().filter(e=>e.type==="map update"||e.type==="command"):this.logEventsDataSource.getItems()}printNode(e){return`command_line: ${e.command_line},
compute_id: ${e.compute_id},
console: ${e.console},
console_host: ${e.console_host},
console_type: ${e.console_type},
first_port_name: ${e.first_port_name},
height: ${e.height},
label: ${e.label.text},
name: ${e.name},
node_directory: ${e.node_directory},
node_id: ${e.node_id},
node_type: ${e.node_type},
port_name_format: ${e.port_name_format},
port_segment_size: ${e.port_segment_size}, `+this.printPorts(e.ports)+`project_id: ${e.project_id},
status: ${e.status},
symbol: ${e.symbol},
symbol_url: ${e.symbol_url},
width: ${e.width},
x: ${e.x},
y: ${e.y},
z: ${e.z}`}printPorts(e){let t="ports: ";return e.forEach(o=>{t=t+`adapter_number: ${o.adapter_number},
link_type: ${o.link_type},
name: ${o.name},
port_number: ${o.port_number},
short_name: ${o.short_name}, `}),t}printLink(e){return`capture_file_name: ${e.capture_file_name},
capture_file_path: ${e.capture_file_path},
capturing: ${e.capturing},
link_id: ${e.link_id},
link_type: ${e.link_type},
project_id: ${e.project_id},
suspend: ${e.suspend}, `}printDrawing(e){return`drawing_id: ${e.drawing_id},
project_id: ${e.project_id},
rotation: ${e.rotation},
x: ${e.x},
y: ${e.y},
z: ${e.z}`}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-log-console"]],viewQuery:function(t,o){t&1&&Xt(o.console,s2e,5)(o.commandInput,l2e,5),t&2&&Kt(2)},inputs:{controller:"controller",project:[1,"project"],command:[1,"command"]},outputs:{command:"commandChange"},decls:27,vars:15,consts:[["filterMenu","matMenu"],["console",""],["commandInput",""],[1,"consoleHeader"],[1,"consoleFiltering"],[1,"filterButton",3,"ngClass","matMenuTriggerFor"],["xPosition","after"],["mat-menu-item","",3,"click"],[1,"console",3,"ngClass","ngStyle"],[1,"console-item"],[1,"consoleInput",3,"ngClass"],[1,"inputIcon"],["autofocus","","type","text",1,"commandLine",3,"keydown","input","ngClass","value"]],template:function(t,o){if(t&1&&(s(0,"div",3)(1,"div",4)(2,"button",5),d(3," Apply filter "),l(),s(4,"mat-menu",6,0)(6,"button",7),g("click",function(){return o.applyFilter("all")}),d(7,"all"),l(),s(8,"button",7),g("click",function(){return o.applyFilter("errors")}),d(9,"errors"),l(),s(10,"button",7),g("click",function(){return o.applyFilter("warnings")}),d(11,"warnings"),l(),s(12,"button",7),g("click",function(){return o.applyFilter("info")}),d(13,"info"),l(),s(14,"button",7),g("click",function(){return o.applyFilter("map updates")}),d(15,"map updates"),l(),s(16,"button",7),g("click",function(){return o.applyFilter("controller requests")}),d(17,"controller requests"),l()()()(),s(18,"div",8,1),Y(20,c2e,3,1,"span",9,Ae),l(),s(22,"div",10)(23,"mat-icon",11),d(24,"keyboard_arrow_right"),l(),s(25,"input",12,2),g("keydown",function(a){return o.onKeyDown(a)})("input",function(a){return o.command.set(a.target.value)}),l()()),t&2){let r=Pe(5);m(2),C("ngClass",dn(7,A2,o.isLightThemeEnabled))("matMenuTriggerFor",r),m(16),C("ngClass",dn(9,A2,o.isLightThemeEnabled))("ngStyle",o.style),m(2),Z(o.filteredEvents),m(2),C("ngClass",dn(11,A2,o.isLightThemeEnabled)),m(3),C("ngClass",dn(13,A2,o.isLightThemeEnabled))("value",o.command())}},dependencies:[ne,Yi,lc,ie,de,W,Ge,Qn,Ze,Fn],styles:[".consoleWrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;background:var(--mat-sys-surface);color:var(--mat-sys-on-surface);overflow:hidden;font-size:12px}.filterButton[_ngcontent-%COMP%]{background:transparent;color:var(--mat-sys-on-surface-variant);border:none;margin-top:0;outline:none;font-weight:700;padding:0}.consoleFiltering[_ngcontent-%COMP%]{display:flex}.consoleHeader[_ngcontent-%COMP%]{width:100%;height:32px;font-size:12px;overflow:hidden;display:flex;padding:4px 8px;justify-content:space-between;background:var(--mat-sys-surface);flex-shrink:0}.console[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:8px;color:var(--mat-sys-on-surface);font-family:Menlo,Monaco,Courier New,monospace;font-size:12px;line-height:1.4;scrollbar-color:var(--mat-sys-on-surface-variant) var(--mat-sys-surface);scrollbar-width:thin;background:var(--mat-sys-surface)}.consoleInput[_ngcontent-%COMP%]{width:100%;height:32px;padding:4px 8px;display:flex;background:var(--mat-sys-surface);flex-shrink:0}.commandLine[_ngcontent-%COMP%]{background-color:transparent;color:var(--mat-sys-on-surface);border:none;font-family:Menlo,Monaco,Courier New,monospace;font-size:12px}.inputIcon[_ngcontent-%COMP%]{margin-top:2px}mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}input[_ngcontent-%COMP%]:focus{outline:none}.closeButton[_ngcontent-%COMP%]{cursor:pointer}"],changeDetection:0})}return n})();var d2e=["consoleWrapper"],m2e=(n,i,e,t)=>({lightTheme:n,"console-active":i,"is-minimized":e,"is-dragging":t}),p2e=()=>({top:!0}),u2e=()=>({right:!0}),h2e=()=>({bottom:!0}),f2e=()=>({left:!0}),g2e=()=>({top:!0,left:!0}),_2e=()=>({top:!0,right:!0}),v2e=()=>({bottom:!0,left:!0}),C2e=()=>({bottom:!0,right:!0}),b2e=(n,i)=>i.name;function x2e(n,i){n&1&&R(0,"div",15)(1,"div",16)(2,"div",17)(3,"div",18)(4,"div",19)(5,"div",20)(6,"div",21)(7,"div",22),n&2&&(C("resizeEdges",Bt(8,p2e)),m(),C("resizeEdges",Bt(9,u2e)),m(),C("resizeEdges",Bt(10,h2e)),m(),C("resizeEdges",Bt(11,f2e)),m(),C("resizeEdges",Bt(12,g2e)),m(),C("resizeEdges",Bt(13,_2e)),m(),C("resizeEdges",Bt(14,v2e)),m(),C("resizeEdges",Bt(15,C2e)))}function y2e(n,i){if(n&1){let e=z();R(0,"span",23),s(1,"span",24),d(2),l(),s(3,"button",25),g("mousedown",function(o){return o.stopPropagation()})("click",function(){k(e);let o=v().$index,r=v();return T(r.removeTab(o))}),s(4,"mat-icon"),d(5,"close"),l()()}if(n&2){let e=v().$implicit;m(2),j(e.name)}}function S2e(n,i){n&1&&(s(0,"mat-tab"),xe(1,y2e,6,1,"ng-template",7),l())}function w2e(n,i){n&1&&(s(0,"span",24),d(1,"GNS3 console"),l())}function M2e(n,i){if(n&1){let e=z();s(0,"button",46),g("click",function(){k(e);let o=v(2);return T(o.resetBgColor())}),s(1,"mat-icon"),d(2,"restart_alt"),l()()}}function k2e(n,i){n&1&&(s(0,"span",35),d(1,"auto"),l())}function T2e(n,i){if(n&1){let e=z();s(0,"button",47),g("click",function(){k(e);let o=v(2);return T(o.resetFgColor())}),s(1,"mat-icon"),d(2,"restart_alt"),l()()}}function E2e(n,i){n&1&&(s(0,"span",35),d(1,"auto"),l())}function D2e(n,i){if(n&1){let e=z();s(0,"button",48),g("click",function(){k(e);let o=v(2);return T(o.resetFontSize())}),s(1,"mat-icon"),d(2,"restart_alt"),l()()}}function P2e(n,i){if(n&1&&(s(0,"option",45),d(1),l()),n&2){let e=i.$implicit;C("value",e.value||""),m(),j(e.name)}}function I2e(n,i){if(n&1){let e=z();s(0,"div",26),g("click",function(){k(e);let o=v();return T(o.closeSettingsPanel())}),l(),s(1,"div",27),g("mousedown",function(o){return o.stopPropagation()})("click",function(o){return o.stopPropagation()}),s(2,"div",28),d(3,"Terminal Settings"),l(),s(4,"div",29)(5,"span",30),d(6,"Background"),l(),s(7,"div",31)(8,"label",32)(9,"input",33),g("change",function(o){k(e);let r=v();return T(r.onBgColorChange(o))}),l()(),A(10,M2e,3,0,"button",34)(11,k2e,2,0,"span",35),l()(),s(12,"div",29)(13,"span",30),d(14,"Text Color"),l(),s(15,"div",31)(16,"label",36)(17,"input",33),g("change",function(o){k(e);let r=v();return T(r.onFgColorChange(o))}),l()(),A(18,T2e,3,0,"button",37)(19,E2e,2,0,"span",35),l()(),s(20,"div",29)(21,"span",30),d(22,"Font Size"),l(),s(23,"div",38)(24,"button",39),g("click",function(){k(e);let o=v();return T(o.changeFontSize(-1))}),s(25,"mat-icon"),d(26,"remove"),l()(),s(27,"span",40),d(28),l(),s(29,"button",41),g("click",function(){k(e);let o=v();return T(o.changeFontSize(1))}),s(30,"mat-icon"),d(31,"add"),l()(),A(32,D2e,3,0,"button",42),l()(),s(33,"div",43)(34,"span",30),d(35,"Font"),l(),s(36,"select",44),g("change",function(o){k(e);let r=v();return T(r.onFontFamilyChange(o.target.value))}),Y(37,P2e,2,2,"option",45,b2e),l()()()}if(n&2){let e=v();m(8),nn("--swatch-color",e.effectiveBgHex()),Be("color-swatch--custom",e.currentSettings().backgroundColor),m(),C("value",e.effectiveBgHex()),m(),O(e.currentSettings().backgroundColor?10:11),m(6),nn("--swatch-color",e.effectiveFgHex()),Be("color-swatch--custom",e.currentSettings().foregroundColor),m(),C("value",e.effectiveFgHex()),m(),O(e.currentSettings().foregroundColor?18:19),m(6),C("disabled",e.currentSettings().fontSize<=e.minFontSize),m(4),ee("",e.currentSettings().fontSize,"px"),m(),C("disabled",e.currentSettings().fontSize>=e.maxFontSize),m(3),O(e.currentSettings().fontSize!==e.defaultFontSize?32:-1),m(4),C("value",e.currentSettings().fontFamily||""),m(),Z(e.terminalFonts)}}function A2e(n,i){if(n&1&&R(0,"app-web-console",14),n&2){let e=i.$index,t=v();C("hidden",t.selected.value!==e)("controller",t.controller())("node",t.nodes[e])}}var O2=(()=>{class n{CONSOLE_HEADER_HEIGHT=40;DEFAULT_WIDTH=848;DEFAULT_HEIGHT=600;DEFAULT_LEFT="80px";DEFAULT_BOTTOM="100px";destroy$=new He;themeSubscription=null;controller=le(void 0);project=le(void 0);zIndex=le(1e3);closeConsole=new ve;deviceSelected=new ve;consoleDeactivated=new ve;windowFocused=new ve;windowMinimized=new ve;style={};styleInside={height:"120px"};isDraggingSignal=ae(!1);isMinimizedSignal=ae(!1);isMaximizedSignal=ae(!1);isConsoleActiveSignal=ae(!1);isLightThemeEnabledSignal=ae(!1);isDragging=this.isDraggingSignal.asReadonly();isMinimized=this.isMinimizedSignal.asReadonly();isMaximized=this.isMaximizedSignal.asReadonly();isConsoleActive=this.isConsoleActiveSignal.asReadonly();isLightThemeEnabled=this.isLightThemeEnabledSignal.asReadonly();resizedWidth=this.DEFAULT_WIDTH;resizedHeight=this.DEFAULT_HEIGHT;_resizeNotifyTimeoutId=null;consoleService=f(rr);themeService=f(ci);mapSettingsService=f(go);boundaryService=f(rd);windowManagement=f(ed);cdr=f(Q);renderer=f(Si);xtermService=f(hg);showSettingsPanelSignal=ae(!1);settingsSignal=ae(this.xtermService.settings);terminalFonts=this.xtermService.getInstalledFonts();defaultFontSize=jv;minFontSize=YA;maxFontSize=ZA;showSettingsPanel=this.showSettingsPanelSignal.asReadonly();currentSettings=this.settingsSignal.asReadonly();effectiveBgHex=Jt(()=>{let e=this.settingsSignal().backgroundColor;return e||this.xtermService.getEffectiveBackgroundHex()});effectiveFgHex=Jt(()=>{let e=this.settingsSignal().foregroundColor;return e||this.xtermService.getEffectiveForegroundHex()});dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartBottom=0;preMinimizeStyle=null;constructor(){ha(()=>{let t=this.windowManagement.minimizedWindows().some(o=>o.id==="console");t&&!this.isMinimizedSignal()?this.isMinimizedSignal.set(!0):!t&&this.isMinimizedSignal()&&this.isMinimizedSignal.set(!1)})}nodes=[];selected=new Ye(0);webConsoleComponents=NO(fg);logConsoleComponent=Nt(_g);consoleWrapper=Nt("consoleWrapper");ngOnInit(){this.isLightThemeEnabledSignal.set(this.themeService.getActualTheme()==="light"),this.themeSubscription=this.themeService.themeChanged.subscribe(()=>{this.isLightThemeEnabledSignal.set(this.themeService.getActualTheme()==="light"),this.cdr.markForCheck()}),this.loadWindowState();let e=window.innerWidth<=768?56:64;this.boundaryService.setConfig({topOffset:e}),this.consoleService.nodeConsoleTrigger.pipe(tt(this.destroy$)).subscribe(t=>{this.addTab(t,!0)}),this.consoleService.closeNodeConsoleTrigger.pipe(tt(this.destroy$)).subscribe(t=>{let o=this.nodes.findIndex(r=>r.node_id===t.node_id);o>=0&&this.removeTab(o)}),this.selected.valueChanges.pipe(tt(this.destroy$)).subscribe(t=>{t>=0&&t<this.nodes.length&&this.deviceSelected.emit(this.nodes[t].node_id)})}minimize(e){if(this.isMinimizedSignal.set(e),e?this.windowManagement.minimizeWindow("console","console"):this.windowManagement.restoreWindow("console"),e)this.preMinimizeStyle=K({},this.style);else{if(this.preMinimizeStyle){let o=this.preMinimizeStyle.left||this.DEFAULT_LEFT,r=this.preMinimizeStyle.bottom||this.DEFAULT_BOTTOM;if(this.isMaximizedSignal()){let a=window.innerWidth<=768?56:64,p=window.innerHeight-a-20;this.updateStyle({bottom:"0px",left:o,width:`${this.resizedWidth}px`,height:`${p}px`})}else this.updateStyle({bottom:r,left:o,width:`${this.resizedWidth}px`,height:`${this.resizedHeight}px`});this.preMinimizeStyle=null}else{let o=this.style.left||this.DEFAULT_LEFT,r=this.style.bottom||this.DEFAULT_BOTTOM;this.updateStyle({bottom:r,left:o,width:`${this.resizedWidth}px`,height:`${this.resizedHeight}px`})}let t=this.selected.value;t<this.nodes.length?this.focusTerminalAfterRender(t):t===this.nodes.length&&this.focusGns3ConsoleInput()}}toggleMinimize(){this.minimize(!this.isMinimizedSignal())}toggleMaximize(){if(this.isMaximizedSignal.set(!this.isMaximizedSignal()),this.isMaximizedSignal()){let e=window.innerWidth<=768?56:64,o=window.innerHeight-e-20,r=this.style.left||this.DEFAULT_LEFT;this.updateStyle({bottom:"0px",left:r,width:`${this.resizedWidth}px`,height:`${o}px`}),this.notifyConsoleResized(o)}else{let e=this.style.left||this.DEFAULT_LEFT;this.updateStyle({bottom:this.DEFAULT_BOTTOM,left:e,width:`${this.resizedWidth}px`,height:`${this.resizedHeight}px`}),this.notifyConsoleResized(this.resizedHeight)}this.cdr.markForCheck(),this.saveWindowState()}addTab(e,t){if(e.console_type==="vnc")return;this.minimize(!1);let o=this.nodes.findIndex(r=>r.node_id===e.node_id);if(o>=0)t&&(this.selected.setValue(o),this.cdr.markForCheck());else if(this.nodes.push(e),this.consoleService.openConsoles++,t){let r=this.nodes.length-1;this.selected.setValue(-1),this.cdr.markForCheck(),setTimeout(()=>{this.selected.setValue(r),this.cdr.markForCheck(),this.focusTerminalAfterRender(r)},0)}}removeTab(e){if(e<0||e>=this.nodes.length)return;this.nodes.splice(e,1),this.consoleService.openConsoles>0&&this.consoleService.openConsoles--;let t=this.selected.value,o=this.nodes.length;o===0?this.selected.setValue(0):e<=t&&t<o?this.selected.setValue(Math.max(0,t-1)):t>=o&&this.selected.setValue(o-1),this.cdr.markForCheck()}applyStyleToElement(e){let t=this.consoleWrapper()?.nativeElement;t&&(e.position&&this.renderer.setStyle(t,"position",e.position),e.left&&this.renderer.setStyle(t,"left",e.left),e.top&&this.renderer.setStyle(t,"top",e.top),e.bottom&&this.renderer.setStyle(t,"bottom",e.bottom),e.right&&this.renderer.setStyle(t,"right",e.right),e.width&&this.renderer.setStyle(t,"width",e.width),e.height&&this.renderer.setStyle(t,"height",e.height))}updateStyle(e){this.style=e,this.applyStyleToElement(e),this.cdr.markForCheck()}validate(e){return!(e.rectangle.width&&e.rectangle.height&&(e.rectangle.width<500||e.rectangle.height<400))}onResizeEnd(e){let t=this.style,o=t.bottom!==void 0&&t.top===void 0,r=this.boundaryService.constrainResizeSize(e.rectangle.width||this.resizedWidth,e.rectangle.height||this.resizedHeight,e.rectangle.left,e.rectangle.top);if(o){let a=window.innerHeight-r.top-r.height;this.updateStyle({position:"fixed",left:`${r.left}px`,bottom:`${a}px`,width:`${r.width}px`,height:`${r.height}px`})}else this.updateStyle({position:"fixed",left:`${r.left}px`,top:`${r.top}px`,width:`${r.width}px`,height:`${r.height}px`});this.styleInside={height:`${r.height-this.CONSOLE_HEADER_HEIGHT}px`,width:`${r.width}px`},this.consoleService.consoleResized.next({width:r.width,height:r.height-this.CONSOLE_HEADER_HEIGHT}),this.resizedWidth=r.width,this.resizedHeight=r.height,this.saveWindowState()}close(){this.closeConsole.emit(!1)}getActiveTabName(){let e=this.selected.value;if(e<this.nodes.length){let t=this.nodes[e].name;return t.length>12?t.substring(0,10)+"...":t}else return"Console"}onDeviceSelected(e){this.addTab(e,!0),this.deviceSelected.emit(e.node_id)}handleTabShortcut(e){if(!this.isConsoleActiveSignal())return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t==="9")this.switchToTab(this.nodes.length);else{let o=parseInt(t)-1;o<this.nodes.length&&this.switchToTab(o)}}onXtermTabShortcut(e){if(!this.isConsoleActiveSignal())return;e.preventDefault(),e.stopPropagation();let t=e.detail.key,o=parseInt(t)-1;this.switchToTab(o)}onConsoleActivate(){this.isConsoleActiveSignal.set(!0),this.cdr.markForCheck()}onWindowFocus(){this.windowFocused.emit()}onDocumentClick(e){setTimeout(()=>{let t=document.querySelector(".consoleWrapper"),o=e.target;t&&!t.contains(o)&&this.isConsoleActiveSignal()&&(this.isConsoleActiveSignal.set(!1),this.consoleDeactivated.emit(),this.cdr.markForCheck())},0)}switchToTab(e){e<0||e>this.nodes.length||(this.selected.setValue(e),e<this.nodes.length&&this.webConsoleComponents()&&this.focusTerminalAfterRender(e),e===this.nodes.length&&this.focusGns3ConsoleInput())}focusGns3ConsoleInput(){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=this.logConsoleComponent();e&&e.focusInput()})})}focusTerminalAfterRender(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let t=this.webConsoleComponents();t&&t[e]&&t[e].focusTerminal()})})}enableScroll(e){this.mapSettingsService.isScrollDisabled.next(!1)}disableScroll(e){this.mapSettingsService.isScrollDisabled.next(!0)}onWindowResize(){this.isMinimizedSignal()||this.updateStyle(this.boundaryService.constrainWindowPosition(this.style))}ngAfterViewInit(){this.applyStyleToElement(this.style),this.setupDragHandling(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(this.isMaximizedSignal()){let e=window.innerWidth<=768?56:64,o=window.innerHeight-e-20;this.consoleService.consoleResized.next({width:this.resizedWidth,height:o-this.CONSOLE_HEADER_HEIGHT})}else this.consoleService.consoleResized.next({width:this.resizedWidth,height:this.resizedHeight-this.CONSOLE_HEADER_HEIGHT})})})}setupDragHandling(){let e=this.consoleWrapper()?.nativeElement;if(!e)return;let t=e.querySelector(".consoleHeader");if(!t)return;let o=sr(t,"mousedown"),r=sr(document,"mousemove"),a=sr(document,"mouseup");o.pipe(Qi(c=>{c.preventDefault(),this.isDraggingSignal.set(!0),this.cdr.markForCheck(),this.dragStartX=c.clientX,this.dragStartY=c.clientY,this.dragStartLeft=Number(this.style.left?.split("px")[0])||0,this.dragStartBottom=Number(this.style.bottom?.split("px")[0])||0,this.setIframePointerEvents("none")}),Un(()=>r.pipe(Ud(0,nc),tt(a.pipe(Qi(()=>{this.onDragEnd()}))))),tt(this.destroy$)).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,_=this.dragStartBottom-u,S=this.resizedWidth,x=this.isMinimizedSignal()?48:this.resizedHeight,b=window.innerWidth-S,M=this.boundaryService.getConfigValue().topOffset||0,w=window.innerHeight-x-M;h=Math.max(0,Math.min(b,h)),_=Math.max(0,Math.min(w,_)),this.renderer.setStyle(e,"left",`${h}px`),this.renderer.setStyle(e,"bottom",`${_}px`),this.style.left=`${h}px`,this.style.bottom=`${_}px`})}notifyConsoleResized(e){let t={width:this.resizedWidth,height:e-this.CONSOLE_HEADER_HEIGHT};this.consoleService.consoleResized.next(t),this._resizeNotifyTimeoutId!==null&&clearTimeout(this._resizeNotifyTimeoutId),this._resizeNotifyTimeoutId=setTimeout(()=>{this._resizeNotifyTimeoutId=null,this.consoleService.consoleResized.next({width:this.resizedWidth,height:e-this.CONSOLE_HEADER_HEIGHT})},50)}onDragEnd(){this.isDraggingSignal.set(!1),this.setIframePointerEvents(""),this.cdr.markForCheck(),this.saveWindowState()}setIframePointerEvents(e){let t=this.consoleWrapper()?.nativeElement;t&&t.querySelectorAll("iframe").forEach(o=>{this.renderer.setStyle(o,"pointer-events",e)})}toggleSettingsPanel(){this.showSettingsPanelSignal.update(e=>!e),this.cdr.markForCheck()}closeSettingsPanel(){this.showSettingsPanelSignal.set(!1),this.cdr.markForCheck()}applySettings(e){this.xtermService.updateSettings(e),this.settingsSignal.set(this.xtermService.settings),this.cdr.markForCheck()}onBgColorChange(e){this.applySettings({backgroundColor:e.target.value})}onFgColorChange(e){this.applySettings({foregroundColor:e.target.value})}resetBgColor(){this.applySettings({backgroundColor:null})}resetFgColor(){this.applySettings({foregroundColor:null})}changeFontSize(e){this.applySettings({fontSize:Math.max(this.minFontSize,Math.min(this.maxFontSize,this.currentSettings().fontSize+e))})}resetFontSize(){this.applySettings({fontSize:jv})}onFontFamilyChange(e){this.applySettings({fontFamily:e||null})}ngOnDestroy(){this.themeSubscription&&(this.themeSubscription.unsubscribe(),this.themeSubscription=null),this.destroy$.next(),this.destroy$.complete()}loadWindowState(){let e="gns3_console_window_state";try{let t=localStorage.getItem(e);if(t){let o=JSON.parse(t);if(this.resizedWidth=o.width||this.DEFAULT_WIDTH,this.resizedHeight=o.height||this.DEFAULT_HEIGHT,this.isMaximizedSignal.set(o.isMaximized||!1),this.isMaximizedSignal()){let r=window.innerWidth<=768?56:64,c=window.innerHeight-r-20;this.style={bottom:"0px",left:o.left||this.DEFAULT_LEFT,width:`${this.resizedWidth}px`,height:`${c}px`}}else this.style={bottom:o.bottom||this.DEFAULT_BOTTOM,left:o.left||this.DEFAULT_LEFT,width:`${this.resizedWidth}px`,height:`${this.resizedHeight}px`}}else this.style={bottom:this.DEFAULT_BOTTOM,left:this.DEFAULT_LEFT,width:`${this.DEFAULT_WIDTH}px`,height:`${this.DEFAULT_HEIGHT}px`}}catch{this.style={bottom:this.DEFAULT_BOTTOM,left:this.DEFAULT_LEFT,width:`${this.DEFAULT_WIDTH}px`,height:`${this.DEFAULT_HEIGHT}px`}}}saveWindowState(){let e="gns3_console_window_state";try{let t={width:this.resizedWidth,height:this.resizedHeight,bottom:this.style.bottom,left:this.style.left,isMaximized:this.isMaximizedSignal()};localStorage.setItem(e,JSON.stringify(t))}catch{}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-console-wrapper"]],viewQuery:function(t,o){t&1&&Xt(o.webConsoleComponents,fg,5)(o.logConsoleComponent,_g,5)(o.consoleWrapper,d2e,5),t&2&&Kt(3)},hostBindings:function(t,o){t&1&&g("keydown.alt.1",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.2",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.3",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.4",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.5",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.6",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.7",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.8",function(a){return o.handleTabShortcut(a)},lr)("keydown.alt.9",function(a){return o.handleTabShortcut(a)},lr)("consoleTabShortcut",function(a){return o.onXtermTabShortcut(a)},zu)("click",function(a){return o.onDocumentClick(a)},zu)("resize",function(){return o.onWindowResize()},lr)},inputs:{controller:[1,"controller"],project:[1,"project"],zIndex:[1,"zIndex"]},outputs:{closeConsole:"closeConsole",deviceSelected:"deviceSelected",consoleDeactivated:"consoleDeactivated",windowFocused:"windowFocused",windowMinimized:"windowMinimized"},decls:29,vars:22,consts:[["consoleWrapper",""],["mwlResizable","","tabindex","0",1,"consoleWrapper",3,"mousedown","resizeEnd","click","focus","ngClass","validateResize","enableGhostResize"],[1,"console-content"],[3,"deviceSelected","isLightTheme"],[1,"console-area"],[1,"consoleHeader"],[1,"console-wrapper__tabs",3,"selectedIndexChange","selectedIndex"],["mat-tab-label",""],[1,"console-header-actions"],["mat-icon-button","","title","Terminal settings","aria-label","Terminal settings",1,"header-action-btn",3,"mousedown","click"],["mat-icon-button","",1,"header-action-btn",3,"mousedown","click","title"],["mat-icon-button","","aria-label","Minimize console",1,"header-action-btn",3,"mousedown","click"],["mat-icon-button","","aria-label","Close console",1,"header-action-btn","header-action-btn--close",3,"mousedown","click"],[3,"hidden","controller","project"],[3,"hidden","controller","node"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-right",3,"resizeEdges"],[1,"tab-label-spacer"],[1,"tab-label-text"],["title","Close","aria-label","Close tab",1,"tab-close-btn",3,"mousedown","click"],[1,"settings-backdrop",3,"click"],[1,"console-settings-panel",3,"mousedown","click"],[1,"settings-panel__title"],[1,"settings-panel__row"],[1,"settings-panel__label"],[1,"settings-panel__color-control"],["title","Pick background color",1,"color-swatch"],["type","color",3,"change","value"],["title","Reset to theme default","aria-label","Reset background color",1,"reset-btn"],[1,"settings-panel__auto-badge"],["title","Pick text color",1,"color-swatch"],["title","Reset to theme default","aria-label","Reset text color",1,"reset-btn"],[1,"settings-panel__font-size-control"],["aria-label","Decrease font size",1,"font-size-step-btn",3,"click","disabled"],[1,"settings-panel__font-size-value"],["aria-label","Increase font size",1,"font-size-step-btn",3,"click","disabled"],["title","Reset to default size","aria-label","Reset font size",1,"reset-btn"],[1,"settings-panel__row","settings-panel__row--font"],["aria-label","Select terminal font",1,"settings-panel__font-select",3,"change","value"],[3,"value"],["title","Reset to theme default","aria-label","Reset background color",1,"reset-btn",3,"click"],["title","Reset to theme default","aria-label","Reset text color",1,"reset-btn",3,"click"],["title","Reset to default size","aria-label","Reset font size",1,"reset-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",1,0),g("mousedown",function(){return o.onWindowFocus()})("resizeEnd",function(a){return o.onResizeEnd(a)})("click",function(){return o.onConsoleActivate()})("focus",function(){return o.onConsoleActivate()}),A(2,x2e,8,16),s(3,"div",2)(4,"app-console-devices-panel",3),g("deviceSelected",function(a){return o.onDeviceSelected(a)}),l(),s(5,"div",4)(6,"div",5)(7,"mat-tab-group",6),g("selectedIndexChange",function(a){return o.selected.setValue(a)}),Y(8,S2e,2,0,"mat-tab",null,Hi),s(10,"mat-tab"),xe(11,w2e,2,0,"ng-template",7),l()(),s(12,"div",8)(13,"button",9),g("mousedown",function(a){return a.stopPropagation()})("click",function(){return o.toggleSettingsPanel()}),s(14,"mat-icon"),d(15,"tune"),l()(),s(16,"button",10),g("mousedown",function(a){return a.stopPropagation()})("click",function(){return o.toggleMaximize()}),s(17,"mat-icon"),d(18),l()(),s(19,"button",11),g("mousedown",function(a){return a.stopPropagation()})("click",function(){return o.minimize(!0)}),s(20,"mat-icon"),d(21,"remove"),l()(),s(22,"button",12),g("mousedown",function(a){return a.stopPropagation()})("click",function(){return o.close()}),s(23,"mat-icon"),d(24,"close"),l()()()(),A(25,I2e,39,17),R(26,"app-log-console",13),Y(27,A2e,1,3,"app-web-console",14,Hi),l()()()),t&2&&(nn("z-index",o.zIndex()),C("ngClass",nC(17,m2e,o.isLightThemeEnabled(),o.isConsoleActive(),o.isMinimized(),o.isDragging()))("validateResize",o.validate)("enableGhostResize",!0),m(2),O(o.isMinimized()?-1:2),m(2),C("isLightTheme",o.isLightThemeEnabled()),m(3),C("selectedIndex",o.selected.value),m(),Z(o.nodes),m(5),Be("active",o.showSettingsPanel()),m(3),C("title",o.isMaximized()?"Restore":"Maximize height"),qt("aria-label",o.isMaximized()?"Restore console height":"Maximize console height"),m(2),j(o.isMaximized()?"fullscreen_exit":"fullscreen"),m(7),O(o.showSettingsPanel()?25:-1),m(),C("hidden",o.selected.value!==o.nodes.length)("controller",o.controller())("project",o.project()),m(),Z(o.nodes))},dependencies:[ne,Yi,Xe,l4,c4,To,V4,tr,nr,ie,de,W,je,wt,ec,od,k2,fg,_g],styles:['@charset "UTF-8";@media screen and (max-width:700px){.consoleWrapper[_ngcontent-%COMP%]{visibility:hidden}}.consoleWrapper[_ngcontent-%COMP%]{box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent);position:fixed;bottom:100px;left:80px;height:180px;width:600px;background:var(--mat-sys-surface);color:var(--mat-sys-on-surface);overflow:hidden;font-size:12px;border-radius:4px;outline:none;transition:box-shadow .2s cubic-bezier(.4,0,.2,1);z-index:900;contain:layout style}.consoleWrapper.is-dragging[_ngcontent-%COMP%]{cursor:grabbing;user-select:none;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 40%,transparent);transition:none;will-change:left,bottom}.consoleWrapper.is-minimized[_ngcontent-%COMP%]{display:none}.taskbar-icon[_ngcontent-%COMP%]{position:fixed;bottom:20px;left:20px;z-index:901;display:flex;align-items:center;gap:8px;padding:8px 12px;height:48px;width:180px;cursor:pointer;user-select:none;transition:background-color .15s var(--mat-sys-motion-easing-linear);background:var(--mat-sys-surface);border-radius:8px;box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 25%,transparent),0 0 0 1px var(--mat-sys-outline-variant)}.taskbar-icon[_ngcontent-%COMP%]:hover{background:var(--mat-sys-hover-state-layer)}.taskbar-icon[_ngcontent-%COMP%]:active{background:var(--mat-sys-focus-state-layer)}.taskbar-icon__icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--mat-sys-primary);flex-shrink:0}.taskbar-icon__label[_ngcontent-%COMP%]{flex:1;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.consoleHeader[_ngcontent-%COMP%]{width:100%;height:40px;overflow:hidden;overflow:clip;display:flex;padding:0 2px;justify-content:space-between;align-items:center;background:var(--mat-sys-surface);cursor:grab;position:relative;z-index:10;flex-shrink:0;border-bottom:1px solid var(--mat-sys-outline-variant)}.consoleHeader[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.consoleHeader[_ngcontent-%COMP%]:active{cursor:grabbing}.console-wrapper__tabs[_ngcontent-%COMP%]{flex:1;min-width:0}.tab-label-spacer[_ngcontent-%COMP%]{width:18px;flex-shrink:0}.tab-label-text[_ngcontent-%COMP%]{flex:1;font-size:14px;font-weight:500;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-close-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:none;background:transparent;border-radius:3px;cursor:pointer;color:var(--mat-sys-on-surface-variant);padding:0;flex-shrink:0;opacity:.6;transition:opacity .1s ease,background-color .1s ease}.tab-close-btn[_ngcontent-%COMP%]:hover{opacity:1;background:color-mix(in srgb,var(--mat-sys-on-surface) 15%,transparent)}.tab-close-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px}.header-action-btn[_ngcontent-%COMP%]{width:32px;height:32px;--mat-icon-button-state-layer-size: 32px}.header-action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.header-action-btn.active[_ngcontent-%COMP%]{color:var(--mat-sys-primary);background:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-radius:4px}.header-action-btn--close[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--mat-sys-error) 15%,transparent);border-radius:50%;color:var(--mat-sys-error)}.header-action-btn--close[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--mat-sys-error) 28%,transparent)}.settings-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:199}.console-settings-panel[_ngcontent-%COMP%]{position:absolute;top:40px;right:15px;z-index:200;background:var(--mat-sys-surface-container-high);border:1px solid var(--mat-sys-outline-variant);border-top:none;border-radius:0 0 8px 8px;padding:12px 10px 12px 14px;min-width:280px;box-shadow:0 4px 16px color-mix(in srgb,var(--mat-sys-shadow) 28%,transparent)}.settings-panel__title[_ngcontent-%COMP%]{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--mat-sys-on-surface-variant);margin-bottom:10px}.settings-panel__row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;min-height:30px;gap:8px}.settings-panel__row[_ngcontent-%COMP%] + .settings-panel__row[_ngcontent-%COMP%]{margin-top:4px}.settings-panel__label[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface);flex:1}.settings-panel__color-control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-shrink:0}.color-swatch[_ngcontent-%COMP%]{display:flex;width:28px;height:22px;flex-shrink:0;border-radius:4px;background-color:var(--swatch-color);box-shadow:inset 0 0 0 1px var(--mat-sys-outline-variant),0 0 0 1px transparent;overflow:hidden;cursor:pointer;position:relative;transition:box-shadow .12s ease}.color-swatch[_ngcontent-%COMP%]:hover{box-shadow:inset 0 0 0 1px var(--mat-sys-outline),0 0 0 1px transparent}.color-swatch--custom[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 1px var(--mat-sys-primary),0 0 0 1px var(--mat-sys-primary)}.color-swatch[_ngcontent-%COMP%] input[type=color][_ngcontent-%COMP%]{position:absolute;inset:-4px;width:calc(100% + 8px);height:calc(100% + 8px);border:none;padding:0;cursor:pointer;background:none;opacity:.01}.settings-panel__auto-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:26px;height:22px;font-size:10px;font-weight:500;color:var(--mat-sys-on-surface-variant);background:color-mix(in srgb,var(--mat-sys-on-surface-variant) 12%,transparent);border-radius:3px;flex-shrink:0}.reset-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--mat-sys-on-surface-variant);padding:0;flex-shrink:0;transition:background-color .1s ease,color .1s ease}.reset-btn[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--mat-sys-on-surface-variant) 12%,transparent);color:var(--mat-sys-on-surface)}.reset-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;line-height:20px}.settings-panel__font-size-control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.settings-panel__row--font[_ngcontent-%COMP%]{align-items:center}.settings-panel__font-select[_ngcontent-%COMP%]{flex:1;min-width:0;height:26px;padding:0 6px;font-size:12px;color:var(--mat-sys-on-surface);background:var(--mat-sys-surface-container);border:1px solid var(--mat-sys-outline-variant);border-radius:4px;cursor:pointer;appearance:auto;transition:border-color .12s ease}.settings-panel__font-select[_ngcontent-%COMP%]:hover{border-color:var(--mat-sys-outline)}.settings-panel__font-select[_ngcontent-%COMP%]:focus{outline:2px solid var(--mat-sys-primary);outline-offset:1px}.settings-panel__font-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-high);color:var(--mat-sys-on-surface)}.settings-panel__font-size-value[_ngcontent-%COMP%]{font-size:12px;font-weight:600;color:var(--mat-sys-on-surface);min-width:36px;text-align:center}.font-size-step-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid var(--mat-sys-outline-variant);border-radius:4px;background:transparent;color:var(--mat-sys-on-surface);cursor:pointer;padding:0;transition:background-color .12s ease,border-color .12s ease}.font-size-step-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--mat-sys-on-surface) 10%,transparent);border-color:var(--mat-sys-outline)}.font-size-step-btn[_ngcontent-%COMP%]:disabled{opacity:.38;cursor:default}.font-size-step-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.console-content[_ngcontent-%COMP%]{display:flex;height:100%;overflow:hidden}.console-area[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative}.resize-handle[_ngcontent-%COMP%]{position:absolute;z-index:100;opacity:0;transition:opacity .15s ease}.consoleWrapper[_ngcontent-%COMP%]:hover .resize-handle[_ngcontent-%COMP%]{opacity:1}.resize-handle.resize-handle-top[_ngcontent-%COMP%]{top:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-right[_ngcontent-%COMP%]{top:12px;right:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-bottom[_ngcontent-%COMP%]{bottom:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-left[_ngcontent-%COMP%]{top:12px;left:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-top-left[_ngcontent-%COMP%]{top:-6px;left:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}.resize-handle.resize-handle-top-right[_ngcontent-%COMP%]{top:-6px;right:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-left[_ngcontent-%COMP%]{bottom:-6px;left:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-right[_ngcontent-%COMP%]{bottom:-6px;right:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}'],changeDetection:0})}return n})();var O2e=["windowWrapper"],N2e=()=>({top:!0}),F2e=()=>({right:!0}),R2e=()=>({bottom:!0}),L2e=()=>({left:!0}),V2e=()=>({top:!0,left:!0}),B2e=()=>({top:!0,right:!0}),z2e=()=>({bottom:!0,left:!0}),j2e=()=>({bottom:!0,right:!0});function $2e(n,i){n&1&&R(0,"div",17)(1,"div",18)(2,"div",19)(3,"div",20)(4,"div",21)(5,"div",22)(6,"div",23)(7,"div",24),n&2&&(C("resizeEdges",Bt(8,N2e)),m(),C("resizeEdges",Bt(9,F2e)),m(),C("resizeEdges",Bt(10,R2e)),m(),C("resizeEdges",Bt(11,L2e)),m(),C("resizeEdges",Bt(12,V2e)),m(),C("resizeEdges",Bt(13,B2e)),m(),C("resizeEdges",Bt(14,z2e)),m(),C("resizeEdges",Bt(15,j2e)))}function H2e(n,i){n&1&&(s(0,"div",14)(1,"mat-icon",25),d(2,"loading"),l(),s(3,"span"),d(4,"Starting Web Wireshark..."),l()())}function U2e(n,i){n&1&&(s(0,"div",15),R(1,"img",26),s(2,"span"),d(3,"Restarting Web Wireshark..."),l()())}var V9=(()=>{class n{DEFAULT_WIDTH=800;DEFAULT_HEIGHT=600;DEFAULT_LEFT="100px";DEFAULT_TOP="100px";MIN_WIDTH=800;MIN_HEIGHT=600;MAX_WIDTH=1920;MAX_HEIGHT=1080;destroy$=new He;link=le.required();controller=le.required();project=le.required();zIndex=le(1e3);closeWindow=new ve;windowFocused=new ve;windowMinimized=new ve;style={position:"fixed",left:this.DEFAULT_LEFT,top:this.DEFAULT_TOP,width:`${this.DEFAULT_WIDTH}px`,height:`${this.DEFAULT_HEIGHT}px`};resizedWidth=this.DEFAULT_WIDTH;resizedHeight=this.DEFAULT_HEIGHT;isDraggingSignal=ae(!1);isResizingSignal=ae(!1);isLoadingSignal=ae(!0);isMinimizedSignal=ae(!1);isRestartingSignal=ae(!1);isDownloadingSignal=ae(!1);isDragging=this.isDraggingSignal.asReadonly();isResizing=this.isResizingSignal.asReadonly();isLoading=this.isLoadingSignal.asReadonly();isMinimized=this.isMinimizedSignal.asReadonly();isRestarting=this.isRestartingSignal.asReadonly();isDownloading=this.isDownloadingSignal.asReadonly();wiresharkUrl="";xpraConsoleService=f(rg);boundaryService=f(rd);toasterService=f(te);cdr=f(Q);renderer=f(Si);sanitizer=f(fr);windowManagement=f(ed);linkService=f(Fi);dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartTop=0;windowWrapper=Nt("windowWrapper");constructor(){ha(()=>{let e=this.link(),t=this.windowManagement.minimizedWindows(),o=`wireshark-${e?.link_id}`,r=t.some(a=>a.id===o);r&&!this.isMinimizedSignal()?this.isMinimizedSignal.set(!0):!r&&this.isMinimizedSignal()&&this.isMinimizedSignal.set(!1)})}ngOnInit(){let e=window.innerWidth<=768?56:64;this.boundaryService.setConfig({topOffset:e,minWidth:this.MIN_WIDTH,minHeight:this.MIN_HEIGHT,maxWidth:this.MAX_WIDTH,maxHeight:this.MAX_HEIGHT}),this.wiresharkUrl=this.buildWiresharkUrl(),this.setupDragHandling()}getWindowId(){return`wireshark-${this.link().link_id}`}buildWiresharkUrl(){let e=this.link(),t=this.controller(),o=this.xpraConsoleService.buildXpraWebSocketUrlForWebWireshark(t,e),r=this.xpraConsoleService.buildXpraConsolePageUrl(o);return this.sanitizer.bypassSecurityTrustResourceUrl(r)}onIframeLoad(){this.isLoadingSignal.set(!1),this.cdr.markForCheck()}close(){this.windowManagement.restoreWindow(this.getWindowId()),this.closeWindow.emit()}toggleMinimize(){this.windowManagement.toggleMinimize(this.getWindowId(),"wireshark",this.link().link_id),this.cdr.markForCheck()}restartWireshark(){this.isRestartingSignal()||(this.isRestartingSignal.set(!0),this.cdr.markForCheck(),this.linkService.restartWiresharkCapture(this.controller(),this.link()).subscribe({next:e=>{this.isRestartingSignal.set(!1),this.wiresharkUrl=this.buildWiresharkUrl(),this.isLoadingSignal.set(!0),this.cdr.markForCheck()},error:e=>{this.isRestartingSignal.set(!1),this.toasterService.error(`Failed to restart Web Wireshark: ${e.message||e.detail||"Unknown error"}`),this.cdr.markForCheck()}}))}downloadPcapFile(){this.isDownloadingSignal()||(this.isDownloadingSignal.set(!0),this.cdr.markForCheck(),this.linkService.downloadPcap(this.controller(),this.link()).subscribe({next:e=>{let t=window.URL.createObjectURL(e),o=document.createElement("a");o.href=t;let r=this.link().capture_file_name||"capture";o.download=r.endsWith(".pcap")?r:`${r}.pcap`,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(t),this.isDownloadingSignal.set(!1),this.toasterService.success("Pcap file downloaded successfully"),this.cdr.markForCheck()},error:e=>{this.isDownloadingSignal.set(!1);let t=e.error?.message||e.message||"Failed to download pcap file";this.toasterService.error(`Failed to download pcap file: ${t}`),this.cdr.markForCheck()}}))}onWindowFocus(){if(this.isMinimizedSignal()){this.toggleMinimize();return}this.windowFocused.emit()}validate(e){return!(e.rectangle.width&&e.rectangle.height&&(e.rectangle.width<this.MIN_WIDTH||e.rectangle.height<this.MIN_HEIGHT||e.rectangle.width>this.MAX_WIDTH||e.rectangle.height>this.MAX_HEIGHT))}onResizeStart(){this.isResizingSignal.set(!0),this.setIframePointerEvents("none"),this.cdr.markForCheck()}onResizeEnd(e){let t=this.boundaryService.constrainResizeSize(e.rectangle.width||this.resizedWidth,e.rectangle.height||this.resizedHeight,e.rectangle.left,e.rectangle.top);this.style={position:"fixed",left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`},this.resizedWidth=t.width,this.resizedHeight=t.height,this.applyStyleToElement(),this.isResizingSignal.set(!1),this.setIframePointerEvents(""),this.cdr.markForCheck()}applyStyleToElement(){let e=this.windowWrapper()?.nativeElement;e&&(this.style.position&&this.renderer.setStyle(e,"position",this.style.position),this.style.left&&this.renderer.setStyle(e,"left",this.style.left),this.style.top&&this.renderer.setStyle(e,"top",this.style.top),this.style.width&&this.renderer.setStyle(e,"width",this.style.width),this.style.height&&this.renderer.setStyle(e,"height",this.style.height))}setupDragHandling(){let e=this.windowWrapper()?.nativeElement;if(!e)return;let t=e.querySelector(".web-wireshark-inline-header");if(!t)return;let o=sr(t,"mousedown"),r=sr(document,"mousemove"),a=sr(document,"mouseup");o.pipe(Qi(c=>{c.preventDefault(),this.isDraggingSignal.set(!0),this.cdr.markForCheck(),this.dragStartX=c.clientX,this.dragStartY=c.clientY,this.dragStartLeft=Number(this.style.left?.split("px")[0])||0,this.dragStartTop=Number(this.style.top?.split("px")[0])||0,this.setIframePointerEvents("none")}),Un(()=>r.pipe(tt(a.pipe(Qi(()=>{this.onDragEnd()}))))),tt(this.destroy$)).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,_=this.dragStartTop+u,S=this.resizedWidth,x=this.resizedHeight,b=window.innerWidth-S,M=this.boundaryService.getConfigValue().topOffset||0,w=window.innerHeight-x-M;h=Math.max(0,Math.min(b,h)),_=Math.max(M,Math.min(w,_)),this.renderer.setStyle(e,"left",`${h}px`),this.renderer.setStyle(e,"top",`${_}px`),this.style.left=`${h}px`,this.style.top=`${_}px`})}onDragEnd(){this.isDraggingSignal.set(!1),this.setIframePointerEvents(""),this.cdr.markForCheck()}setIframePointerEvents(e){let t=this.windowWrapper()?.nativeElement;t&&t.querySelectorAll("iframe").forEach(o=>{this.renderer.setStyle(o,"pointer-events",e)})}onWindowResize(){this.style=this.boundaryService.constrainWindowPosition(this.style),this.applyStyleToElement()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-web-wireshark-inline"]],viewQuery:function(t,o){t&1&&Xt(o.windowWrapper,O2e,5),t&2&&Kt()},hostBindings:function(t,o){t&1&&g("resize",function(){return o.onWindowResize()},lr)},inputs:{link:[1,"link"],controller:[1,"controller"],project:[1,"project"],zIndex:[1,"zIndex"]},outputs:{closeWindow:"closeWindow",windowFocused:"windowFocused",windowMinimized:"windowMinimized"},decls:29,vars:22,consts:[["windowWrapper",""],["mwlResizable","",1,"web-wireshark-inline",3,"mousedown","resizeStart","resizeEnd","ngStyle","validateResize","enableGhostResize"],[1,"web-wireshark-inline__content"],[1,"web-wireshark-inline-header"],[1,"web-wireshark-inline-header__title"],[1,"header-icon"],[1,"link-info"],[1,"web-wireshark-inline-header__actions"],["mat-icon-button","","title","Download pcap file",1,"download-button",3,"click","disabled"],["mat-icon-button","","title","Restart Web Wireshark",1,"restart-button",3,"click","disabled"],[1,"restart-icon"],["mat-icon-button","","title","Minimize",1,"minimize-button",3,"click"],["mat-icon-button","","title","Close",1,"close-button",3,"click"],[1,"web-wireshark-inline__iframe-container"],[1,"loading-overlay"],[1,"restart-overlay"],["allowfullscreen","",1,"web-wireshark-inline__iframe",3,"load","src"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-right",3,"resizeEdges"],[1,"loading-icon"],["src","assets/gns3_icon.svg","alt","GNS3",1,"restart-logo"]],template:function(t,o){t&1&&(s(0,"div",1,0),g("mousedown",function(){return o.onWindowFocus()})("resizeStart",function(){return o.onResizeStart()})("resizeEnd",function(a){return o.onResizeEnd(a)}),A(2,$2e,8,16),s(3,"div",2)(4,"div",3)(5,"div",4)(6,"mat-icon",5),d(7,"analytics"),l(),s(8,"span"),d(9,"Web Wireshark"),l(),s(10,"span",6),d(11),l()(),s(12,"div",7)(13,"button",8),g("click",function(){return o.downloadPcapFile()}),s(14,"mat-icon"),d(15,"download"),l()(),s(16,"button",9),g("click",function(){return o.restartWireshark()}),s(17,"mat-icon",10),d(18,"restart_alt"),l()(),s(19,"button",11),g("click",function(){return o.toggleMinimize()}),s(20,"mat-icon"),d(21,"remove"),l()(),s(22,"button",12),g("click",function(){return o.close()}),s(23,"mat-icon"),d(24,"close"),l()()()(),s(25,"div",13),A(26,H2e,5,0,"div",14),A(27,U2e,4,0,"div",15),s(28,"iframe",16),g("load",function(){return o.onIframeLoad()}),l()()()()),t&2&&(nn("z-index",o.zIndex()),Be("is-dragging",o.isDragging())("is-resizing",o.isResizing())("is-minimized",o.isMinimized()),C("ngStyle",o.style)("validateResize",o.validate)("enableGhostResize",!1),m(2),O(o.isMinimized()?-1:2),m(9),j(o.link().capture_file_name),m(2),C("disabled",o.isDownloading()),m(),Be("is-downloading",o.isDownloading()),m(2),C("disabled",o.isRestarting()),m(),Be("is-spinning",o.isRestarting()),m(9),O(o.isLoading()?26:-1),m(),O(o.isRestarting()?27:-1),m(),C("src",o.wiresharkUrl,Zv))},dependencies:[ne,lc,ie,de,W,je,ec,od],styles:[".web-wireshark-inline[_ngcontent-%COMP%]{position:fixed;z-index:1000;background:var(--mat-sys-surface);border:2px solid var(--mat-sys-outline);border-radius:8px;box-shadow:0 8px 24px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent),0 4px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);overflow:visible;transition:box-shadow .2s ease;contain:layout style}.web-wireshark-inline[_ngcontent-%COMP%]:hover{box-shadow:0 12px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 6px 12px color-mix(in srgb,var(--mat-sys-shadow) 12%,transparent)}.web-wireshark-inline.is-dragging[_ngcontent-%COMP%]{box-shadow:0 16px 48px color-mix(in srgb,var(--mat-sys-shadow) 25%,transparent),0 8px 16px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent);opacity:.9;cursor:move;will-change:left,top}.web-wireshark-inline.is-minimized[_ngcontent-%COMP%]{display:none}.web-wireshark-inline__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;border-radius:6px}.web-wireshark-inline-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;background:var(--mat-sys-surface-container);border-bottom:1px solid var(--mat-sys-outline-variant);cursor:move;user-select:none;flex-shrink:0}.web-wireshark-inline-header__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface)}.web-wireshark-inline-header__title[_ngcontent-%COMP%] .header-icon[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-primary);width:14px;height:14px}.web-wireshark-inline-header__title[_ngcontent-%COMP%] .link-info[_ngcontent-%COMP%]{font-size:10px;color:var(--mat-sys-on-surface-variant);font-weight:400;margin-left:4px;padding-left:4px;border-left:1px solid var(--mat-sys-outline-variant)}.web-wireshark-inline-header__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{width:24px;height:24px;padding:0;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;vertical-align:middle}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%]:hover, .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-error-container);color:var(--mat-sys-error)}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .restart-button[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .download-button[_ngcontent-%COMP%]{width:24px;height:24px;padding:0;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .restart-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .download-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;vertical-align:middle;color:var(--mat-sys-primary)}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .restart-button[_ngcontent-%COMP%]:hover:not(:disabled), .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .download-button[_ngcontent-%COMP%]:hover:not(:disabled){background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .restart-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .download-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary-container)}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .restart-button[_ngcontent-%COMP%]:disabled, .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .download-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.web-wireshark-inline-header__actions[_ngcontent-%COMP%] .restart-button[_ngcontent-%COMP%] .restart-icon.is-spinning[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .restart-button[_ngcontent-%COMP%] mat-icon.is-downloading[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .download-button[_ngcontent-%COMP%] .restart-icon.is-spinning[_ngcontent-%COMP%], .web-wireshark-inline-header__actions[_ngcontent-%COMP%] .download-button[_ngcontent-%COMP%] mat-icon.is-downloading[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 1s linear infinite}.web-wireshark-inline__iframe-container[_ngcontent-%COMP%]{flex:1;position:relative;overflow:hidden;min-height:200px;height:100%}.web-wireshark-inline__iframe[_ngcontent-%COMP%]{width:100%;height:100%;border:none;display:block}.loading-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:var(--mat-sys-surface);z-index:1}.loading-overlay[_ngcontent-%COMP%] .loading-icon[_ngcontent-%COMP%]{font-size:48px;color:var(--mat-sys-primary);will-change:transform;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-overlay[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant)}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.restart-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:color-mix(in srgb,var(--mat-sys-surface) 90%,transparent);backdrop-filter:blur(4px);z-index:10}.restart-overlay[_ngcontent-%COMP%] .restart-logo[_ngcontent-%COMP%]{width:80px;height:80px;animation:_ngcontent-%COMP%_breathe 2s ease-in-out infinite;filter:drop-shadow(0 0 8px var(--mat-sys-primary))}.restart-overlay[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface);font-weight:500}@keyframes _ngcontent-%COMP%_breathe{0%,to{transform:scale(1);opacity:.8}50%{transform:scale(1.1);opacity:1}}.resize-handle[_ngcontent-%COMP%]{position:absolute;z-index:100;opacity:0;transition:opacity .15s ease}.web-wireshark-inline[_ngcontent-%COMP%]:hover .resize-handle[_ngcontent-%COMP%]{opacity:1}.resize-handle.resize-handle-top[_ngcontent-%COMP%]{top:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-right[_ngcontent-%COMP%]{top:12px;right:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-bottom[_ngcontent-%COMP%]{bottom:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-left[_ngcontent-%COMP%]{top:12px;left:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-top-left[_ngcontent-%COMP%]{top:-6px;left:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}.resize-handle.resize-handle-top-right[_ngcontent-%COMP%]{top:-6px;right:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-left[_ngcontent-%COMP%]{bottom:-6px;left:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-right[_ngcontent-%COMP%]{bottom:-6px;right:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}"],changeDetection:0})}return n})();var G2e=["windowWrapper"],W2e=()=>({top:!0}),q2e=()=>({right:!0}),Q2e=()=>({bottom:!0}),X2e=()=>({left:!0}),K2e=()=>({top:!0,left:!0}),Y2e=()=>({top:!0,right:!0}),Z2e=()=>({bottom:!0,left:!0}),J2e=()=>({bottom:!0,right:!0});function eMe(n,i){n&1&&R(0,"div",13)(1,"div",14)(2,"div",15)(3,"div",16)(4,"div",17)(5,"div",18)(6,"div",19)(7,"div",20),n&2&&(C("resizeEdges",Bt(8,W2e)),m(),C("resizeEdges",Bt(9,q2e)),m(),C("resizeEdges",Bt(10,Q2e)),m(),C("resizeEdges",Bt(11,X2e)),m(),C("resizeEdges",Bt(12,K2e)),m(),C("resizeEdges",Bt(13,Y2e)),m(),C("resizeEdges",Bt(14,Z2e)),m(),C("resizeEdges",Bt(15,J2e)))}function tMe(n,i){n&1&&(s(0,"div",11)(1,"mat-icon",21),d(2,"loading"),l(),s(3,"span"),d(4,"Starting Web Console..."),l()())}function nMe(n,i){if(n&1){let e=z();s(0,"iframe",22),g("load",function(){k(e);let o=v();return T(o.onIframeLoad())}),l()}if(n&2){let e=v();C("src",e.consoleUrl,Zv)}}var B9=(()=>{class n{DEFAULT_WIDTH=1024;DEFAULT_HEIGHT=768;DEFAULT_LEFT="100px";DEFAULT_TOP="100px";MIN_WIDTH=400;MIN_HEIGHT=300;destroy$=new He;node=le.required();controller=le.required();project=le.required();zIndex=le(1e3);closeWindow=new ve;windowFocused=new ve;windowMinimized=new ve;style={position:"fixed",left:this.DEFAULT_LEFT,top:this.DEFAULT_TOP,width:`${this.DEFAULT_WIDTH}px`,height:`${this.DEFAULT_HEIGHT}px`};resizedWidth=this.DEFAULT_WIDTH;resizedHeight=this.DEFAULT_HEIGHT;isDraggingSignal=ae(!1);isResizingSignal=ae(!1);isLoadingSignal=ae(!0);isMinimizedSignal=ae(!1);isDragging=this.isDraggingSignal.asReadonly();isResizing=this.isResizingSignal.asReadonly();isLoading=this.isLoadingSignal.asReadonly();isMinimized=this.isMinimizedSignal.asReadonly();consoleUrl="";boundaryService=f(rd);toasterService=f(te);cdr=f(Q);renderer=f(Si);sanitizer=f(fr);windowManagement=f(ed);dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartTop=0;windowWrapper=Nt("windowWrapper");constructor(){ha(()=>{let e=this.windowManagement.minimizedWindows(),t=this.getWindowId(),o=e.some(r=>r.id===t);o&&!this.isMinimizedSignal()?this.isMinimizedSignal.set(!0):!o&&this.isMinimizedSignal()&&this.isMinimizedSignal.set(!1)})}ngOnInit(){let e=window.innerWidth<=768?56:64;this.boundaryService.setConfig({topOffset:e}),this.adjustWindowSizeFromConsoleResolution(),this.consoleUrl=this.buildConsoleUrl(),this.setupDragHandling()}adjustWindowSizeFromConsoleResolution(){let e=this.node(),t=10,o=this.DEFAULT_WIDTH,r=this.DEFAULT_HEIGHT;if(e.properties){let a=e.properties;if(a.console_resolution){let p=a.console_resolution.split("x");if(p.length===2){let u=parseInt(p[0],10),h=parseInt(p[1],10);!isNaN(u)&&!isNaN(h)&&(o=u+t,r=h+t,this.style={position:"fixed",left:this.DEFAULT_LEFT,top:this.DEFAULT_TOP,width:`${o}px`,height:`${r}px`},this.resizedWidth=o,this.resizedHeight=r)}}}}getWindowId(){return`console-${this.node().node_id}`}buildConsoleUrl(){let e=this.node(),t=this.controller();if(e.console_type==="vnc"){let o=this.buildVncWebSocketUrl(t,e),r=this.buildVncConsolePageUrl(o,e);return this.sanitizer.bypassSecurityTrustResourceUrl(r)}else if(e.console_type&&e.console_type.startsWith("http")){let o=e.console_host;(o==="0.0.0.0"||o==="0:0:0:0:0:0:0:0"||o==="::")&&(o=t.host);let r=`${e.console_type}://${o}:${e.console}`;return this.sanitizer.bypassSecurityTrustResourceUrl(r)}return this.toasterService.error(`Console type '${e.console_type}' is not supported in inline mode.`),""}buildVncWebSocketUrl(e,t){return`${e.protocol==="https:"?"wss":"ws"}://${e.host}:${e.port}/v3/projects/${t.project_id}/nodes/${t.node_id}/console/vnc?token=${e.authToken}`}buildVncConsolePageUrl(e,t){return`assets/vnc-console/index.html?${new URLSearchParams({ws_url:e,node_name:t.name,node_id:t.node_id,project_id:t.project_id,autoconnect:"1"}).toString()}`}onIframeLoad(){this.isLoadingSignal.set(!1),this.cdr.markForCheck()}close(){this.windowManagement.restoreWindow(this.getWindowId()),this.closeWindow.emit()}toggleMinimize(){this.windowManagement.toggleMinimize(this.getWindowId(),"console",this.node().node_id),this.cdr.markForCheck()}onWindowFocus(){if(this.isMinimizedSignal()){this.toggleMinimize();return}this.windowFocused.emit(),this.cdr.markForCheck()}validate(e){return!(e.rectangle.width&&e.rectangle.height&&(e.rectangle.width<this.MIN_WIDTH||e.rectangle.height<this.MIN_HEIGHT))}onResizeStart(){this.isResizingSignal.set(!0),this.setIframePointerEvents("none"),this.cdr.markForCheck()}onResizeEnd(e){let t=this.boundaryService.constrainResizeSize(e.rectangle.width||this.resizedWidth,e.rectangle.height||this.resizedHeight,e.rectangle.left,e.rectangle.top);this.style={position:"fixed",left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`},this.resizedWidth=t.width,this.resizedHeight=t.height,this.applyStyleToElement(),this.isResizingSignal.set(!1),this.setIframePointerEvents(""),this.cdr.markForCheck()}applyStyleToElement(){let e=this.windowWrapper()?.nativeElement;e&&(this.style.position&&this.renderer.setStyle(e,"position",this.style.position),this.style.left&&this.renderer.setStyle(e,"left",this.style.left),this.style.top&&this.renderer.setStyle(e,"top",this.style.top),this.style.width&&this.renderer.setStyle(e,"width",this.style.width),this.style.height&&this.renderer.setStyle(e,"height",this.style.height))}setupDragHandling(){let e=this.windowWrapper()?.nativeElement;if(!e)return;let t=e.querySelector(".web-console-inline-header");if(!t)return;let o=sr(t,"mousedown"),r=sr(document,"mousemove"),a=sr(document,"mouseup");o.pipe(Qi(c=>{c.preventDefault(),this.isDraggingSignal.set(!0),this.cdr.markForCheck(),this.dragStartX=c.clientX,this.dragStartY=c.clientY,this.dragStartLeft=Number(this.style.left?.split("px")[0])||0,this.dragStartTop=Number(this.style.top?.split("px")[0])||0,this.setIframePointerEvents("none")}),Un(()=>r.pipe(Ud(0,nc),tt(a.pipe(Qi(()=>{this.onDragEnd()}))))),tt(this.destroy$)).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,_=this.dragStartTop+u,S=this.resizedWidth,x=this.resizedHeight,b=window.innerWidth-S,M=this.boundaryService.getConfigValue().topOffset||0,w=window.innerHeight-x-M;h=Math.max(0,Math.min(b,h)),_=Math.max(M,Math.min(w,_)),this.renderer.setStyle(e,"left",`${h}px`),this.renderer.setStyle(e,"top",`${_}px`),this.style.left=`${h}px`,this.style.top=`${_}px`})}onDragEnd(){this.isDraggingSignal.set(!1),this.setIframePointerEvents(""),this.cdr.markForCheck()}setIframePointerEvents(e){let t=this.windowWrapper()?.nativeElement;t&&t.querySelectorAll("iframe").forEach(o=>{this.renderer.setStyle(o,"pointer-events",e)})}onWindowResize(){this.style=this.boundaryService.constrainWindowPosition(this.style),this.applyStyleToElement()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-web-console-inline"]],viewQuery:function(t,o){t&1&&Xt(o.windowWrapper,G2e,5),t&2&&Kt()},hostBindings:function(t,o){t&1&&g("resize",function(){return o.onWindowResize()},lr)},inputs:{node:[1,"node"],controller:[1,"controller"],project:[1,"project"],zIndex:[1,"zIndex"]},outputs:{closeWindow:"closeWindow",windowFocused:"windowFocused",windowMinimized:"windowMinimized"},decls:22,vars:15,consts:[["windowWrapper",""],["mwlResizable","",1,"web-console-inline",3,"mousedown","resizeStart","resizeEnd","ngStyle","validateResize","enableGhostResize"],[1,"web-console-inline__content"],[1,"web-console-inline-header"],[1,"web-console-inline-header__title"],[1,"header-icon"],[1,"node-info"],[1,"web-console-inline-header__actions"],["mat-icon-button","","title","Minimize",1,"minimize-button",3,"click"],["mat-icon-button","","title","Close",1,"close-button",3,"click"],[1,"web-console-inline__iframe-container"],[1,"loading-overlay"],["allowfullscreen","",1,"web-console-inline__iframe",3,"src"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-right",3,"resizeEdges"],[1,"loading-icon"],["allowfullscreen","",1,"web-console-inline__iframe",3,"load","src"]],template:function(t,o){t&1&&(s(0,"div",1,0),g("mousedown",function(){return o.onWindowFocus()})("resizeStart",function(){return o.onResizeStart()})("resizeEnd",function(a){return o.onResizeEnd(a)}),A(2,eMe,8,16),s(3,"div",2)(4,"div",3)(5,"div",4)(6,"mat-icon",5),d(7,"terminal"),l(),s(8,"span"),d(9,"Web Console"),l(),s(10,"span",6),d(11),l()(),s(12,"div",7)(13,"button",8),g("click",function(){return o.toggleMinimize()}),s(14,"mat-icon"),d(15,"remove"),l()(),s(16,"button",9),g("click",function(){return o.close()}),s(17,"mat-icon"),d(18,"close"),l()()()(),s(19,"div",10),A(20,tMe,5,0,"div",11),A(21,nMe,1,1,"iframe",12),l()()()),t&2&&(nn("z-index",o.zIndex()),Be("is-dragging",o.isDragging())("is-resizing",o.isResizing())("is-minimized",o.isMinimized()),C("ngStyle",o.style)("validateResize",o.validate)("enableGhostResize",!1),m(2),O(o.isMinimized()?-1:2),m(9),j(o.node().name),m(9),O(o.isLoading()?20:-1),m(),O(o.consoleUrl?21:-1))},dependencies:[ne,lc,ie,de,W,je,ec,od],styles:[".web-console-inline[_ngcontent-%COMP%]{position:fixed;z-index:1000;background:var(--mat-sys-surface);border:2px solid var(--mat-sys-outline);border-radius:8px;box-shadow:0 8px 24px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent),0 4px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);overflow:visible;transition:box-shadow .2s ease;contain:layout style}.web-console-inline[_ngcontent-%COMP%]:hover{box-shadow:0 12px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 6px 12px color-mix(in srgb,var(--mat-sys-shadow) 12%,transparent)}.web-console-inline.is-dragging[_ngcontent-%COMP%]{box-shadow:0 16px 48px color-mix(in srgb,var(--mat-sys-shadow) 25%,transparent),0 8px 16px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent);opacity:.9;cursor:move;will-change:left,top}.web-console-inline.is-minimized[_ngcontent-%COMP%]{display:none}.web-console-inline__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;border-radius:6px}.web-console-inline-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;background:var(--mat-sys-surface-container);border-bottom:1px solid var(--mat-sys-outline-variant);cursor:move;user-select:none;flex-shrink:0}.web-console-inline-header__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface)}.web-console-inline-header__title[_ngcontent-%COMP%] .header-icon[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-primary);width:14px;height:14px}.web-console-inline-header__title[_ngcontent-%COMP%] .node-info[_ngcontent-%COMP%]{font-size:10px;color:var(--mat-sys-on-surface-variant);font-weight:400;margin-left:4px;padding-left:4px;border-left:1px solid var(--mat-sys-outline-variant)}.web-console-inline-header__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.web-console-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%], .web-console-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{width:24px;height:24px;padding:0;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.web-console-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .web-console-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;vertical-align:middle}.web-console-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%]:hover, .web-console-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-error-container);color:var(--mat-sys-error)}.web-console-inline__iframe-container[_ngcontent-%COMP%]{flex:1;position:relative;overflow:hidden;min-height:200px;height:100%}.web-console-inline__iframe[_ngcontent-%COMP%]{width:100%;height:100%;border:none;display:block}.loading-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:var(--mat-sys-surface);z-index:1}.loading-overlay[_ngcontent-%COMP%] .loading-icon[_ngcontent-%COMP%]{font-size:48px;color:var(--mat-sys-primary);will-change:transform;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-overlay[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant)}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.resize-handle[_ngcontent-%COMP%]{position:absolute;z-index:100;opacity:0;transition:opacity .15s ease}.web-console-inline[_ngcontent-%COMP%]:hover .resize-handle[_ngcontent-%COMP%]{opacity:1}.resize-handle.resize-handle-top[_ngcontent-%COMP%]{top:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-right[_ngcontent-%COMP%]{top:12px;right:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-bottom[_ngcontent-%COMP%]{bottom:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-left[_ngcontent-%COMP%]{top:12px;left:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-top-left[_ngcontent-%COMP%]{top:-6px;left:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}.resize-handle.resize-handle-top-right[_ngcontent-%COMP%]{top:-6px;right:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-left[_ngcontent-%COMP%]{bottom:-6px;left:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-right[_ngcontent-%COMP%]{bottom:-6px;right:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}"],changeDetection:0})}return n})();var rO=class{_document;_textarea;constructor(i,e){this._document=e;let t=this._textarea=this._document.createElement("textarea"),o=t.style;o.position="fixed",o.top=o.opacity="0",o.left="-999em",t.setAttribute("aria-hidden","true"),t.value=i,t.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(t)}copy(){let i=this._textarea,e=!1;try{if(i){let t=this._document.activeElement;i.select(),i.setSelectionRange(0,i.value.length),e=this._document.execCommand("copy"),t&&t.focus()}}catch{}return e}destroy(){let i=this._textarea;i&&(i.remove(),this._textarea=void 0)}},N2=(()=>{class n{_document=f(Xi);constructor(){}copy(e){let t=this.beginCopy(e),o=t.copy();return t.destroy(),o}beginCopy(e){return new rO(e,this._document)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var z9=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({})}return n})();var iMe=["menuTrigger"],oMe=["editorGutter"],j9=(n,i)=>i.path;function rMe(n,i){if(n&1&&(s(0,"div",6),R(1,"div",16),s(2,"span",17)(3,"mat-icon",9),d(4,"download"),l(),d(5),l()()),n&2){let e=v();m(),nn("width",e.downloadProgress(),"%"),m(4),ee(" ",e.downloadProgress(),"% ")}}function aMe(n,i){n&1&&(s(0,"div",11),R(1,"mat-progress-spinner",18),l())}function sMe(n,i){if(n&1&&(s(0,"div",12)(1,"mat-icon",19),d(2,"error_outline"),l(),s(3,"p"),d(4),l()()),n&2){let e=v();m(4),j(e.error())}}function lMe(n,i){n&1&&(s(0,"div",11),R(1,"mat-progress-spinner",18),l())}function cMe(n,i){if(n&1&&(s(0,"div",26),R(1,"span",28),s(2,"span",29),d(3),l()()),n&2){let e=i.$implicit,t=v(3);m(),Be("editor-line-marker--modified",t.getLineState(e)==="modified")("editor-line-marker--added",t.getLineState(e)==="added"),m(2),j(e)}}function dMe(n,i){if(n&1){let e=z();s(0,"div",24)(1,"div",25,2),Y(3,cMe,4,5,"div",26,Ae),l(),s(5,"textarea",27),g("input",function(o){k(e);let r=v(2);return T(r.onContentChange(o.target.value))})("scroll",function(o){k(e);let r=v(2);return T(r.onEditorScroll(o))}),l()()}if(n&2){let e=v(2);m(3),Z(e.lineNumbers()),m(2),C("value",e.editContent())}}function mMe(n,i){if(n&1){let e=z();s(0,"div",13)(1,"div",20)(2,"span",4),d(3),l(),s(4,"div",21)(5,"button",22),g("click",function(){k(e);let o=v();return T(o.cancelEdit())}),d(6,"Cancel"),l(),s(7,"button",23),g("click",function(){k(e);let o=v();return T(o.saveEdit())}),d(8,"Save"),l()()(),A(9,lMe,2,0,"div",11)(10,dMe,6,1,"div",24),l()}if(n&2){let e=v();m(3),ee("Editing: ",i.path),m(2),C("disabled",e.saving()),m(2),C("disabled",e.saving()||e.loadingContent()),m(2),O(e.loadingContent()?9:10)}}function pMe(n,i){if(n&1){let e=z();s(0,"div",50),g("click",function(){k(e);let o=v().$implicit,r=v(2);return T(r.navigateToDir(o.path))}),R(1,"span"),s(2,"span",51),g("click",function(o){k(e);let r=v().$implicit;return v(2).expandDir(r),T(o.stopPropagation())}),s(3,"mat-icon",52),d(4),l()(),s(5,"mat-icon",53),d(6,"folder"),l(),s(7,"span",54),d(8),l()()}if(n&2){let e=v().$implicit,t=v(2),o=t.treeDepth(e.path);Be("node-file-manager__tree-row--active",t.currentPath()===e.path),m(),nn("width",o*16,"px"),m(3),j(t.isExpanded(e.path)?"expand_more":"chevron_right"),m(4),j(e.name)}}function uMe(n,i){if(n&1&&A(0,pMe,9,6,"div",49),n&2){let e=i.$implicit,t=v(2);O(t.isNodeVisible(e)?0:-1)}}function hMe(n,i){n&1&&(s(0,"span",55),d(1,"/"),l())}function fMe(n,i){if(n&1){let e=z();A(0,hMe,2,0,"span",55),s(1,"button",56),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.currentPath.set(o.path))}),d(2),l()}if(n&2){let e=i.$implicit,t=i.$index;O(t!==0?0:-1),m(2),j(e.label)}}function gMe(n,i){n&1&&R(0,"mat-header-cell",57)}function _Me(n,i){if(n&1&&(s(0,"mat-cell",57)(1,"mat-icon",58),d(2),l()()),n&2){let e=i.$implicit;m(),nn("color",e.isDir?"var(--mat-sys-primary)":""),m(),j(e.isDir?"folder":"description")}}function vMe(n,i){n&1&&(s(0,"mat-header-cell"),d(1,"Name"),l())}function CMe(n,i){if(n&1){let e=z();s(0,"mat-cell",59),g("dblclick",function(){let o=k(e).$implicit,r=v(2);return T(o.isDir?r.navigateToDir(o.path):r.isEditableFile(o)&&r.editFile(o))}),s(1,"span"),d(2),l()()}if(n&2){let e=i.$implicit,t=v(2);nn("cursor",e.isDir||t.isEditableFile(e)?"pointer":"default"),m(2),j(e.isDir?e.name:t.fileName(e))}}function bMe(n,i){n&1&&(s(0,"mat-header-cell"),d(1,"Type"),l())}function xMe(n,i){if(n&1&&(s(0,"mat-cell",60),d(1),l()),n&2){let e=i.$implicit,t=v(2);m(),j(e.isDir?"Dir":t.shortFileType(e.file_type))}}function yMe(n,i){n&1&&(s(0,"mat-header-cell"),d(1,"Size"),l())}function SMe(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit,t=v(2);m(),j(e.isDir?"-":t.formatFileSize(e.size))}}function wMe(n,i){n&1&&(s(0,"mat-header-cell"),d(1,"Modified"),l())}function MMe(n,i){if(n&1&&(s(0,"mat-cell",60),d(1),l()),n&2){let e=i.$implicit,t=v(2);m(),j(e.isDir?"-":t.formatDate(e.modified_at))}}function kMe(n,i){n&1&&R(0,"mat-header-row",61),n&2&&C("sticky",!0)}function TMe(n,i){if(n&1){let e=z();s(0,"mat-row",62),g("contextmenu",function(o){let r=k(e).$implicit,a=v(2);return T(a.onRowContextMenu(o,r))}),l()}n&2&&nn("cursor","context-menu")}function EMe(n,i){if(n&1&&(s(0,"div",30),Y(1,uMe,1,1,null,null,j9),l(),s(3,"div",31)(4,"div",32),Y(5,fMe,3,2,null,null,j9),l(),s(7,"div",33)(8,"mat-table",34),Le(9,35),xe(10,gMe,1,0,"mat-header-cell",36)(11,_Me,3,3,"mat-cell",37),Ve(),Le(12,38),xe(13,vMe,2,0,"mat-header-cell",39)(14,CMe,3,3,"mat-cell",40),Ve(),Le(15,41),xe(16,bMe,2,0,"mat-header-cell",39)(17,xMe,2,1,"mat-cell",42),Ve(),Le(18,43),xe(19,yMe,2,0,"mat-header-cell",39)(20,SMe,2,1,"mat-cell",44),Ve(),Le(21,45),xe(22,wMe,2,0,"mat-header-cell",39)(23,MMe,2,1,"mat-cell",42),Ve(),xe(24,kMe,1,1,"mat-header-row",46)(25,TMe,1,2,"mat-row",47),l()(),s(26,"p",48),d(27,"Double-click a text file to edit"),l()()),n&2){let e=v();m(),Z(e.treeNodes()),m(4),Z(e.breadcrumbs()),m(3),C("dataSource",e.viewItems()),m(16),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns)}}function DMe(n,i){if(n&1){let e=z();s(0,"button",63),g("click",function(){let o=k(e).file,r=v();return T(r.downloadFile(o))}),s(1,"mat-icon"),d(2,"download"),l(),d(3," Download "),l(),s(4,"button",64),g("click",function(){let o=k(e).file,r=v();return T(r.copyPath(o.path))}),s(5,"mat-icon"),d(6),l(),d(7),l(),R(8,"mat-divider"),s(9,"button",64),g("click",function(){let o=k(e).file,r=v();return T(r.deleteFile(o))}),s(10,"mat-icon"),d(11,"delete"),l(),d(12),l()}if(n&2){let e=i.file,t=v();C("disabled",e.isDir),m(6),j(t.copied()===e.path?"check":"content_copy"),m(),ee(" ",t.copied()===e.path?"Copied!":"Copy path"," "),m(5),ee(" ",e.isDir?"Delete directory":"Delete"," ")}}var F2=(()=>{class n{route=f(lt);nodeService=f(ut);controllerService=f(Je);dialog=f(nt);toaster=f(te);clipboard=f(N2);cd=f(Q);inputNode=le(void 0);inputController=le(void 0);controllerId="";projectId="";nodeId="";nodeName=ae("");controller=ae(null);currentPath=ae("");loading=ae(!0);error=ae(null);copied=ae(null);selectedFile=ae(null);contextMenuTrigger=Nt("menuTrigger");menuPosition=ae({left:0,top:0});editorGutter=Nt("editorGutter");uploading=ae(!1);uploadProgress=ae(0);downloading=ae(!1);downloadProgress=ae(0);editingFile=ae(null);editContent=U("");saving=ae(!1);loadingContent=ae(!1);lineCount=ae(1);originalLines=ae([]);currentLines=ae([]);displayedColumns=["icon","path","file_type","size","modified_at"];dirCache=ae(new Map);setDirCache(e,t){let o=this.dirCache();o.set(e,t),this.dirCache.set(new Map(o))}getDirCache(e){return this.dirCache().get(e)||[]}breadcrumbs=Jt(()=>{let e=this.currentPath().split("/").filter(Boolean),t=[{label:"root",path:""}],o="";for(let r of e)o=o?`${o}/${r}`:r,t.push({label:r,path:o});return t});currentFiles=Jt(()=>this.getDirCache(this.currentPath()).filter(t=>t.file_type!=="directory"));subdirs=Jt(()=>this.getDirCache(this.currentPath()).filter(t=>t.file_type==="directory").map(t=>({name:t.path.split("/").pop(),path:t.path})));viewItems=Jt(()=>{let e=this.subdirs().map(o=>({isDir:!0,name:o.name,path:o.path,size:0,created_at:"",modified_at:"",file_type:"directory"})),t=this.currentFiles().map(o=>K({isDir:!1,name:this.fileName(o)},o));return[...e,...t]});treeNodes=ae([]);expandedDirs=ae(new Set);expandDir(e){let t=this.expandedDirs();if(t.has(e.path)){t.delete(e.path),this.expandedDirs.set(new Set(t));return}this.navigateToDir(e.path),t.add(e.path),this.expandedDirs.set(new Set(t)),this.dirCache().has(e.path)||this.loadDir(e.path)}addToTree(e,t){let o=this.treeNodes();if(o.some(c=>c.path===e))return;let a=e.split("/").pop()||e;o.push({name:a,path:e,expanded:!1,loading:!1}),o.sort((c,p)=>c.path.localeCompare(p.path)),this.treeNodes.set([...o])}isExpanded(e){return this.expandedDirs().has(e)}treeDepth(e){return e.split("/").length}isNodeVisible(e){let t=e.path.split("/");for(let o=1;o<t.length;o++)if(!this.expandedDirs().has(t.slice(0,o).join("/")))return!1;return!0}treeIsLastChild(e){let o=e.split("/").slice(0,-1).join("/"),r=this.treeNodes().filter(a=>{let c=a.path.split("/");return c.pop(),c.join("/")===o});return r.length>0&&r[r.length-1].path===e}ngOnInit(){let e=this.inputNode(),t=this.inputController();e&&t?(this.controllerId=t.id?.toString()||"",this.projectId=e.project_id,this.nodeId=e.node_id,this.nodeName.set(e.name),this.controller.set(t),this.loadFiles()):(this.controllerId=this.route.snapshot.paramMap.get("controller_id"),this.projectId=this.route.snapshot.paramMap.get("project_id"),this.nodeId=this.route.snapshot.paramMap.get("node_id"),this.nodeName.set(this.route.snapshot.queryParamMap.get("name")||this.nodeId),this.controllerService.get(+this.controllerId).then(o=>{this.controller.set(o),this.loadFiles()},()=>{this.loading.set(!1),this.toaster.error("Failed to load controller"),this.cd.markForCheck()}))}loadFiles(){this.loading.set(!0),this.error.set(null),this.dirCache.set(new Map),this.treeNodes.set([]);let e=this.controller();this.nodeService.getNodeFiles(e,this.projectId,this.nodeId).subscribe({next:t=>{this.setDirCache("",t);for(let o of t)o.file_type==="directory"&&this.addToTree(o.path,[]);this.loading.set(!1),this.cd.markForCheck()},error:t=>{this.error.set(t.error?.message||t.message||"Failed to load files"),this.loading.set(!1),this.cd.markForCheck()}})}loadDir(e){let t=e.endsWith("/")?e:e+"/",o=this.controller();this.nodeService.getNodeFiles(o,this.projectId,this.nodeId,t).subscribe({next:r=>{this.setDirCache(e,r);for(let a of r)a.file_type==="directory"&&this.addToTree(a.path,[]);this.cd.markForCheck()},error:r=>{this.toaster.error(r.error?.message||r.message||"Failed to load directory")}})}navigateToDir(e){this.currentPath.set(e),this.getDirCache(e).length||this.loadDir(e)}fileName(e){let t=this.currentPath();return t?e.path.substring(t.length+1):e.path}shortFileType(e){return e.split(" ").slice(0,2).join(" ")}isEditableFile(e){return e.file_type.includes("ASCII")||e.file_type.includes("UTF-8")||e.file_type.includes("text")}formatFileSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}formatDate(e){return e?new Date(e).toLocaleString():"-"}copyPath(e){this.clipboard.copy(e),this.copied.set(e),setTimeout(()=>this.copied.set(null),2e3)}onRowContextMenu(e,t){e.preventDefault(),this.selectedFile.set(t),this.menuPosition.set({left:e.clientX,top:e.clientY});let o=this.contextMenuTrigger();o&&(o.menuData={file:t},o.openMenu())}editFile(e){this.editingFile.set(e),this.editContent.set(""),this.loadingContent.set(!0);let t=this.controller();this.nodeService.getNodeFileContent(t,this.projectId,this.nodeId,e.path).subscribe({next:o=>{this.editContent.set(o),this.originalLines.set(o.split(`
`)),this.currentLines.set(o.split(`
`)),this.loadingContent.set(!1),this.updateLineCount(o),this.cd.markForCheck()},error:o=>{this.toaster.error(o.error?.message||o.message||"Failed to load file"),this.loadingContent.set(!1),this.cancelEdit(),this.cd.markForCheck()}})}saveEdit(){let e=this.editingFile();if(!e)return;this.saving.set(!0);let t=this.controller();this.nodeService.saveNodeFileContent(t,this.projectId,this.nodeId,e.path,this.editContent()).subscribe({next:()=>{this.toaster.success(`File "${e.path}" saved.`),this.saving.set(!1),this.editingFile.set(null),this.loadFiles(),this.cd.markForCheck()},error:o=>{this.toaster.error(o.error?.message||o.message||"Failed to save file"),this.saving.set(!1),this.cd.markForCheck()}})}cancelEdit(){this.editingFile.set(null),this.editContent.set("")}onEditorScroll(e){let t=e.target,o=this.editorGutter()?.nativeElement;o&&(o.scrollTop=t.scrollTop)}updateLineCount(e){this.lineCount.set((e.match(/\n/g)||[]).length+1)}onContentChange(e){this.editContent.set(e),this.currentLines.set(e.split(`
`)),this.updateLineCount(e)}getLineState(e){let t=this.originalLines(),o=this.currentLines(),r=e-1;return r<t.length&&r<o.length?t[r]!==o[r]?"modified":"unchanged":r<o.length?"added":"unchanged"}lineNumbers(){return Array.from({length:this.lineCount()},(e,t)=>t+1)}onUploadClick(){let e=document.createElement("input");e.type="file",e.style.display="none",document.body.appendChild(e),e.addEventListener("change",t=>{this.onFileSelected(t),document.body.removeChild(e)}),e.click()}onFileSelected(e){let t=e.target;if(!t.files?.length)return;let o=t.files[0];this.uploading.set(!0),this.uploadProgress.set(0);let r=this.controller(),a=this.currentPath()?`${this.currentPath()}/${o.name}`:o.name;this.nodeService.uploadNodeFileWithProgress(r,this.projectId,this.nodeId,a,o).subscribe({next:c=>{this.uploadProgress.set(c),this.cd.markForCheck()},error:c=>{this.uploading.set(!1),this.uploadProgress.set(0),this.toaster.error(c.message||"Upload failed"),this.cd.markForCheck()},complete:()=>{this.uploading.set(!1),this.uploadProgress.set(0),this.toaster.success(`File "${o.name}" uploaded.`);let c=this.getDirCache(this.currentPath()),p={path:a,size:o.size,created_at:"",modified_at:"",file_type:"ASCII text"};this.setDirCache(this.currentPath(),[...c,p]),this.cd.markForCheck()}})}async downloadFile(e){let t=window.showSaveFilePicker;if(t){let o;try{o=await t({suggestedName:e.path})}catch{return}this.downloading.set(!0),this.downloadProgress.set(0);try{await this.nodeService.streamNodeFileToFile(this.controller(),this.projectId,this.nodeId,e.path,o,r=>{this.downloadProgress.set(e.size>0?Math.min(Math.round(r/e.size*100),100):0),this.cd.markForCheck()}),this.downloading.set(!1),this.downloadProgress.set(0),this.toaster.success(`File "${e.path}" downloaded.`),this.cd.markForCheck()}catch(r){this.downloading.set(!1),this.downloadProgress.set(0),this.toaster.error(r.message||"Download failed"),this.cd.markForCheck()}return}this.downloading.set(!0),this.downloadProgress.set(0);try{let o=await fO(this.nodeService.downloadNodeFile(this.controller(),this.projectId,this.nodeId,e.path)),r=URL.createObjectURL(o),a=document.createElement("a");a.href=r,a.download=e.path,a.click(),URL.revokeObjectURL(r),this.downloading.set(!1),this.toaster.success(`File "${e.path}" downloaded.`),this.cd.markForCheck()}catch(o){this.downloading.set(!1),this.toaster.error(o.message||"Download failed"),this.cd.markForCheck()}}deleteFile(e){let t=e.isDir||e.file_type==="directory";this.dialog.open(Ns,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{title:t?"Delete directory":"Delete file",message:`Are you sure you want to delete "${e.path}"?${t?" This will permanently remove the directory and all its contents.":""}`,confirmButtonText:t?"Delete directory":"Delete",cancelButtonText:"Cancel"}}).afterClosed().subscribe(r=>{if(!r)return;let a=this.controller();this.nodeService.deleteNodeFile(a,this.projectId,this.nodeId,e.path).subscribe({next:()=>{this.toaster.success(`File "${e.path}" deleted.`);let c=e.path.split("/").slice(0,-1).join("/"),p=this.getDirCache(c).filter(u=>u.path!==e.path);this.setDirCache(c,p),this.currentPath().startsWith(e.path)&&this.currentPath.set(c),(e.isDir||e.file_type==="directory")&&this.treeNodes.set(this.treeNodes().filter(u=>u.path!==e.path&&!u.path.startsWith(e.path+"/"))),this.cd.markForCheck()},error:c=>{this.toaster.error(c.error?.message||c.message||"Delete failed"),this.cd.markForCheck()}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-node-file-manager-page"]],viewQuery:function(t,o){t&1&&Xt(o.contextMenuTrigger,iMe,5)(o.editorGutter,oMe,5),t&2&&Kt(2)},inputs:{inputNode:[1,"inputNode"],inputController:[1,"inputController"],editContent:[1,"editContent"]},outputs:{editContent:"editContentChange"},decls:21,vars:13,consts:[["rowMenu","matMenu"],["menuTrigger","matMenuTrigger"],["editorGutter",""],[1,"node-file-manager__bar"],[1,"node-file-manager__title"],[1,"node-file-manager__actions"],[1,"node-file-manager__progress-btn"],[1,"node-file-manager__progress-fill",2,"background","var(--mat-sys-primary-container)"],["mat-stroked-button","",2,"font-size","14px","border","none","position","relative","z-index","1","background","transparent",3,"click","disabled"],[1,"node-file-manager__icon-lg"],[1,"node-file-manager__content"],[1,"node-file-manager__spinner"],[1,"node-file-manager__error"],[1,"node-file-manager__edit-area"],["matMenuContent",""],[2,"position","fixed","width","1px","height","1px","opacity","0","pointer-events","none",3,"matMenuTriggerFor"],[1,"node-file-manager__progress-fill",2,"background","var(--mat-sys-tertiary-container)"],[1,"node-file-manager__progress-label"],["mode","indeterminate"],[1,"node-file-manager__error-icon"],[1,"node-file-manager__edit-toolbar"],[1,"node-file-manager__edit-actions"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"editor-container",2,"flex","1"],[1,"editor-gutter",2,"padding","12px 0","background","var(--mat-sys-surface-container)","border-radius","8px 0 0 8px","border","1px solid var(--mat-sys-outline-variant)","border-right","none","font-family","monospace","font-size","13px","line-height","1.5","user-select","none","overflow","hidden","min-width","52px"],[2,"display","flex","align-items","center"],["spellcheck","false",1,"editor-textarea",3,"input","scroll","value"],[1,"editor-line-marker",2,"width","4px","height","1.5em","flex-shrink","0"],[1,"node-file-manager__text-sm",2,"padding","0 8px","color","var(--mat-sys-on-surface-variant)","text-align","right","flex","1"],[1,"node-file-manager__sidebar"],[1,"node-file-manager__main"],[1,"node-file-manager__breadcrumbs"],[1,"node-file-browser__table-container",2,"flex","1","overflow-y","auto"],[1,"node-file-browser__table",3,"dataSource"],["matColumnDef","icon"],["style","max-width: 36px; min-width: 36px;",4,"matHeaderCellDef"],["style","max-width: 36px; min-width: 36px;",4,"matCellDef"],["matColumnDef","path"],[4,"matHeaderCellDef"],["class","node-file-manager__mono",3,"cursor","dblclick",4,"matCellDef"],["matColumnDef","file_type"],["class","node-file-manager__text-sm",4,"matCellDef"],["matColumnDef","size"],[4,"matCellDef"],["matColumnDef","modified_at"],[3,"sticky",4,"matHeaderRowDef"],[3,"cursor","contextmenu",4,"matRowDef","matRowDefColumns"],[1,"node-file-manager__hint"],[1,"node-file-manager__tree-row",3,"node-file-manager__tree-row--active"],[1,"node-file-manager__tree-row",3,"click"],[1,"node-file-manager__tree-toggle",3,"click"],[1,"node-file-manager__tree-icon"],[1,"node-file-manager__tree-icon",2,"color","var(--mat-sys-primary)","margin","0 4px"],[1,"node-file-manager__tree-name"],[2,"color","var(--mat-sys-on-surface-variant)"],["mat-button","",2,"min-width","0","padding","0 4px","font-size","13px","line-height","24px",3,"click"],[2,"max-width","36px","min-width","36px"],[2,"font-size","20px"],[1,"node-file-manager__mono",3,"dblclick"],[1,"node-file-manager__text-sm"],[3,"sticky"],[3,"contextmenu"],["mat-menu-item","",3,"click","disabled"],["mat-menu-item","",3,"click"]],template:function(t,o){if(t&1&&(s(0,"div",3)(1,"span",4),d(2),l(),s(3,"div",5),A(4,rMe,6,3,"div",6),s(5,"div",6),R(6,"div",7),s(7,"button",8),g("click",function(){return o.onUploadClick()}),s(8,"mat-icon",9),d(9),l(),d(10),l()()()(),s(11,"div",10),A(12,aMe,2,0,"div",11)(13,sMe,5,1,"div",12)(14,mMe,11,4,"div",13)(15,EMe,28,3),l(),s(16,"mat-menu",null,0),xe(18,DMe,13,4,"ng-template",14),l(),R(19,"span",15,1)),t&2){let r,a=Pe(17);m(2),ee("",o.nodeName()," - Files"),m(2),O(o.downloading()?4:-1),m(2),nn("width",o.uploadProgress(),"%"),m(),C("disabled",o.uploading()),m(2),j(o.uploading()?"cloud_upload":"upload"),m(),ee(" ",o.uploading()?o.uploadProgress()+"%":"Upload file"," "),m(2),O(o.loading()?12:o.error()?13:(r=o.editingFile())?14:15,r),m(7),nn("left",o.menuPosition().left,"px")("top",o.menuPosition().top,"px"),C("matMenuTriggerFor",a)}},dependencies:[ne,W,pe,ie,de,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,pn,li,ms,z9,Ge,Qn,Ze,e8,Fn,jr,ga],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;background:var(--mat-sys-surface);color:var(--mat-sys-on-surface)}.editor-container[_ngcontent-%COMP%]{display:flex;flex:1;min-height:200px}.editor-textarea[_ngcontent-%COMP%]{flex:1;font-family:monospace;font-size:13px;padding:12px;border-radius:0 8px 8px 0;background:var(--mat-sys-surface-container-low);color:var(--mat-sys-on-surface);border:1px solid var(--mat-sys-outline-variant);border-left:none;resize:none;box-sizing:border-box;line-height:1.5;outline:none}.editor-textarea[_ngcontent-%COMP%]:focus{border-color:var(--mat-sys-primary)}.editor-line-marker--modified[_ngcontent-%COMP%]{background:var(--mat-sys-error)}.editor-line-marker--added[_ngcontent-%COMP%]{background:var(--mat-sys-tertiary)}.node-file-browser__table-container[_ngcontent-%COMP%]{width:100%;overflow-x:hidden}.node-file-browser__table[_ngcontent-%COMP%]{width:100%}.node-file-manager__bar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid var(--mat-sys-outline-variant);flex-shrink:0}.node-file-manager__actions[_ngcontent-%COMP%]{margin-left:auto;display:flex;align-items:center;gap:8px}.node-file-manager__progress-btn[_ngcontent-%COMP%]{position:relative;overflow:hidden;border-radius:20px;border:1px solid var(--mat-sys-outline);background:transparent}.node-file-manager__progress-fill[_ngcontent-%COMP%]{position:absolute;top:0;left:0;height:100%;transition:width .2s ease}.node-file-manager__progress-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:14px;padding:4px 16px;position:relative;z-index:1}.node-file-manager__content[_ngcontent-%COMP%]{flex:1;overflow:hidden;display:flex}.node-file-manager__main[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;padding:8px 16px}.node-file-manager__spinner[_ngcontent-%COMP%]{flex:1;display:flex;justify-content:center;align-items:center}.node-file-manager__error[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;color:var(--mat-sys-error)}.node-file-manager__error-icon[_ngcontent-%COMP%]{font-size:48px;height:48px;width:48px}.node-file-manager__sidebar[_ngcontent-%COMP%]{width:200px;flex-shrink:0;overflow-y:auto;border-right:1px solid var(--mat-sys-outline-variant);padding:8px 4px 8px 0}.node-file-manager__tree-row[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:26px;cursor:pointer;background:transparent}.node-file-manager__tree-row[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container-low)}.node-file-manager__tree-row--active[_ngcontent-%COMP%], .node-file-manager__tree-row--active[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container-high)}.node-file-manager__tree-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0}.node-file-manager__tree-name[_ngcontent-%COMP%]{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;user-select:none}.node-file-manager__tree-toggle[_ngcontent-%COMP%]{cursor:pointer;width:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.node-file-manager__breadcrumbs[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin-bottom:8px}.node-file-manager__edit-area[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:16px;overflow:hidden}.node-file-manager__edit-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:8px}.node-file-manager__edit-actions[_ngcontent-%COMP%]{margin-left:auto;display:flex;gap:8px}.node-file-manager__title[_ngcontent-%COMP%]{font-weight:500;font-size:16px}.node-file-manager__icon-lg[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.node-file-manager__text-sm[_ngcontent-%COMP%]{font-size:13px}.node-file-manager__hint[_ngcontent-%COMP%]{margin-top:8px;font-size:13px;color:var(--mat-sys-on-surface-variant);flex-shrink:0}.node-file-manager__mono[_ngcontent-%COMP%]{font-family:monospace;word-break:break-all}.mat-column-icon[_ngcontent-%COMP%]{flex:0 0 36px;min-width:36px;justify-content:center}.mat-column-path[_ngcontent-%COMP%]{flex:3;min-width:200px}.mat-column-file_type[_ngcontent-%COMP%]{flex:0 0 140px;min-width:140px}.mat-column-size[_ngcontent-%COMP%]{flex:0 0 120px;min-width:120px}.mat-column-modified_at[_ngcontent-%COMP%]{flex:1;min-width:150px}.node-file-browser__table[_ngcontent-%COMP%] mat-row[_ngcontent-%COMP%]:nth-child(2n){background:var(--mat-sys-surface-container-low)}.node-file-browser__table[_ngcontent-%COMP%] mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:var(--mat-sys-surface)}'],changeDetection:0})}return n})();var PMe=["windowWrapper"],IMe=()=>({top:!0}),AMe=()=>({right:!0}),OMe=()=>({bottom:!0}),NMe=()=>({left:!0}),FMe=()=>({top:!0,left:!0}),RMe=()=>({top:!0,right:!0}),LMe=()=>({bottom:!0,left:!0}),VMe=()=>({bottom:!0,right:!0});function BMe(n,i){n&1&&R(0,"div",13)(1,"div",14)(2,"div",15)(3,"div",16)(4,"div",17)(5,"div",18)(6,"div",19)(7,"div",20),n&2&&(C("resizeEdges",Bt(8,IMe)),m(),C("resizeEdges",Bt(9,AMe)),m(),C("resizeEdges",Bt(10,OMe)),m(),C("resizeEdges",Bt(11,NMe)),m(),C("resizeEdges",Bt(12,FMe)),m(),C("resizeEdges",Bt(13,RMe)),m(),C("resizeEdges",Bt(14,LMe)),m(),C("resizeEdges",Bt(15,VMe)))}var $9=(()=>{class n{DEFAULT_WIDTH=900;DEFAULT_HEIGHT=600;DEFAULT_LEFT="120px";DEFAULT_TOP="80px";MIN_WIDTH=600;MIN_HEIGHT=400;destroy$=new He;node=le();controller=le();zIndex=le(1e3);closeWindow=new ve;windowFocused=new ve;style={position:"fixed",left:this.DEFAULT_LEFT,top:this.DEFAULT_TOP,width:`${this.DEFAULT_WIDTH}px`,height:`${this.DEFAULT_HEIGHT}px`};resizedWidth=this.DEFAULT_WIDTH;resizedHeight=this.DEFAULT_HEIGHT;isDraggingSignal=ae(!1);isResizingSignal=ae(!1);isMinimizedSignal=ae(!1);isDragging=this.isDraggingSignal.asReadonly();isResizing=this.isResizingSignal.asReadonly();isMinimized=this.isMinimizedSignal.asReadonly();boundaryService=f(rd);windowManagement=f(ed);cdr=f(Q);router=f(ht);dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartTop=0;windowWrapper=Nt("windowWrapper");constructor(){ha(()=>{if(!this.node())return;let t=this.getWindowId(),o=this.windowManagement.minimizedWindows();o.some(r=>r.id===t)&&!this.isMinimizedSignal()?this.isMinimizedSignal.set(!0):!o.some(r=>r.id===t)&&this.isMinimizedSignal()&&this.isMinimizedSignal.set(!1)})}ngOnInit(){let e=window.innerWidth<=768?56:64;this.boundaryService.setConfig({topOffset:e}),this.setupDragHandling()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getWindowId(){return`filemgr-${this.node()?.node_id}`}close(){this.windowManagement.restoreWindow(this.getWindowId()),this.closeWindow.emit()}toggleMinimize(){this.node()&&(this.windowManagement.toggleMinimize(this.getWindowId(),"filemgr"),this.cdr.markForCheck())}onWindowFocus(){if(this.isMinimizedSignal()){this.toggleMinimize();return}this.windowFocused.emit(),this.cdr.markForCheck()}validate(e){return!(e.rectangle.width&&e.rectangle.height&&(e.rectangle.width<this.MIN_WIDTH||e.rectangle.height<this.MIN_HEIGHT))}onResizeStart(){this.isResizingSignal.set(!0),this.setContentPointerEvents("none"),this.cdr.markForCheck()}onResizeEnd(e){let t=this.boundaryService.constrainResizeSize(e.rectangle.width||this.resizedWidth,e.rectangle.height||this.resizedHeight,e.rectangle.left,e.rectangle.top);this.style={position:"fixed",left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`},this.resizedWidth=t.width,this.resizedHeight=t.height,this.isResizingSignal.set(!1),this.setContentPointerEvents(""),this.cdr.markForCheck()}setupDragHandling(){let e=this.windowWrapper()?.nativeElement;if(!e)return;let t=e.querySelector(".node-file-manager-inline-header");if(!t)return;let o=sr(t,"mousedown"),r=sr(document,"mousemove"),a=sr(document,"mouseup");o.pipe(tt(this.destroy$),Qi(c=>{c.preventDefault(),this.isDraggingSignal.set(!0),this.cdr.markForCheck(),this.dragStartX=c.clientX,this.dragStartY=c.clientY,this.dragStartLeft=Number(this.style.left?.toString().split("px")[0])||0,this.dragStartTop=Number(this.style.top?.toString().split("px")[0])||0,this.setContentPointerEvents("none")}),Un(()=>r.pipe(Ud(0,nc),tt(a.pipe(Qi(()=>{this.onDragEnd()})))))).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,_=this.dragStartTop+u;this.style={position:"fixed",left:`${h}px`,top:`${_}px`,width:this.style.width,height:this.style.height},this.cdr.markForCheck()})}onDragEnd(){this.isDraggingSignal.set(!1),this.setContentPointerEvents(""),this.cdr.markForCheck()}setContentPointerEvents(e){let t=this.windowWrapper()?.nativeElement;if(!t)return;let o=t.querySelector("app-node-file-manager-page");o&&(o.style.pointerEvents=e)}openInNewTab(){let e=this.node(),t=this.controller();if(!e||!t)return;let o=this.router.createUrlTree(["/controller",t.id,"project",e.project_id,"nodes",e.node_id,"files"],{queryParams:{name:e.name}}),r=window.location.origin+this.router.serializeUrl(o);window.open(r,"_blank")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-node-file-manager-inline"]],viewQuery:function(t,o){t&1&&Xt(o.windowWrapper,PMe,5),t&2&&Kt()},inputs:{node:[1,"node"],controller:[1,"controller"],zIndex:[1,"zIndex"]},outputs:{closeWindow:"closeWindow",windowFocused:"windowFocused"},decls:24,vars:15,consts:[["windowWrapper",""],["mwlResizable","",1,"node-file-manager-inline",3,"mousedown","resizeStart","resizeEnd","ngStyle","validateResize","enableGhostResize"],[1,"node-file-manager-inline__content"],[1,"node-file-manager-inline-header"],[1,"node-file-manager-inline-header__title"],[1,"header-icon"],[1,"node-info"],[1,"node-file-manager-inline-header__actions"],["mat-icon-button","","title","Open in new tab",1,"open-in-new-tab-button",3,"click"],["mat-icon-button","","title","Minimize",1,"minimize-button",3,"click"],["mat-icon-button","","title","Close",1,"close-button",3,"click"],[1,"node-file-manager-inline__iframe-container"],[3,"inputNode","inputController"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-top-right",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-left",3,"resizeEdges"],["mwlResizeHandle","",1,"resize-handle","resize-handle-bottom-right",3,"resizeEdges"]],template:function(t,o){if(t&1&&(s(0,"div",1,0),g("mousedown",function(){return o.onWindowFocus()})("resizeStart",function(){return o.onResizeStart()})("resizeEnd",function(a){return o.onResizeEnd(a)}),A(2,BMe,8,16),s(3,"div",2)(4,"div",3)(5,"div",4)(6,"mat-icon",5),d(7,"folder"),l(),s(8,"span"),d(9,"File Manager"),l(),s(10,"span",6),d(11),l()(),s(12,"div",7)(13,"button",8),g("click",function(){return o.openInNewTab()}),s(14,"mat-icon"),d(15,"open_in_new"),l()(),s(16,"button",9),g("click",function(){return o.toggleMinimize()}),s(17,"mat-icon"),d(18,"remove"),l()(),s(19,"button",10),g("click",function(){return o.close()}),s(20,"mat-icon"),d(21,"close"),l()()()(),s(22,"div",11),R(23,"app-node-file-manager-page",12),l()()()),t&2){let r;nn("z-index",o.zIndex()),Be("is-dragging",o.isDragging())("is-resizing",o.isResizing())("is-minimized",o.isMinimized()),C("ngStyle",o.style)("validateResize",o.validate)("enableGhostResize",!1),m(2),O(o.isMinimized()?-1:2),m(9),j((r=o.node())==null?null:r.name),m(12),C("inputNode",o.node())("inputController",o.controller())}},dependencies:[ne,lc,ie,de,W,je,ec,od,F2],styles:[".node-file-manager-inline[_ngcontent-%COMP%]{position:fixed;z-index:1000;background:var(--mat-sys-surface);border:2px solid var(--mat-sys-outline);border-radius:8px;box-shadow:0 8px 24px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent),0 4px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);overflow:visible;transition:box-shadow .2s ease}.node-file-manager-inline[_ngcontent-%COMP%]:hover{box-shadow:0 12px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 6px 12px color-mix(in srgb,var(--mat-sys-shadow) 12%,transparent)}.node-file-manager-inline.is-dragging[_ngcontent-%COMP%]{box-shadow:0 16px 48px color-mix(in srgb,var(--mat-sys-shadow) 25%,transparent),0 8px 16px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent);opacity:.9;cursor:move;will-change:left,top}.node-file-manager-inline.is-minimized[_ngcontent-%COMP%]{display:none}.node-file-manager-inline__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;border-radius:6px}.node-file-manager-inline-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;background:var(--mat-sys-surface-container);border-bottom:none;cursor:move;user-select:none;flex-shrink:0}.node-file-manager-inline-header__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface)}.node-file-manager-inline-header__title[_ngcontent-%COMP%] .header-icon[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-primary);width:14px;height:14px}.node-file-manager-inline-header__title[_ngcontent-%COMP%] .node-info[_ngcontent-%COMP%]{font-size:10px;color:var(--mat-sys-on-surface-variant);font-weight:400;margin-left:4px;padding-left:4px;border-left:1px solid var(--mat-sys-outline-variant)}.node-file-manager-inline-header__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.node-file-manager-inline-header__actions[_ngcontent-%COMP%] .open-in-new-tab-button[_ngcontent-%COMP%]{width:24px;height:24px;padding:0;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.node-file-manager-inline-header__actions[_ngcontent-%COMP%] .open-in-new-tab-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;vertical-align:middle}.node-file-manager-inline-header__actions[_ngcontent-%COMP%] .open-in-new-tab-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-primary)}.node-file-manager-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%], .node-file-manager-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{width:24px;height:24px;padding:0;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.node-file-manager-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .node-file-manager-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;vertical-align:middle}.node-file-manager-inline-header__actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%]:hover, .node-file-manager-inline-header__actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-error-container);color:var(--mat-sys-error)}.node-file-manager-inline__iframe-container[_ngcontent-%COMP%]{flex:1;position:relative;overflow:hidden;min-height:200px;height:100%}.node-file-manager-inline__iframe[_ngcontent-%COMP%]{width:100%;height:100%;border:none;display:block}.resize-handle[_ngcontent-%COMP%]{position:absolute;z-index:100;opacity:0;transition:opacity .15s ease}.node-file-manager-inline[_ngcontent-%COMP%]:hover .resize-handle[_ngcontent-%COMP%]{opacity:1}.resize-handle.resize-handle-top[_ngcontent-%COMP%]{top:-4px;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-right[_ngcontent-%COMP%]{top:12px;right:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-bottom[_ngcontent-%COMP%]{bottom:0;left:12px;right:12px;height:12px;cursor:ns-resize;background:transparent}.resize-handle.resize-handle-left[_ngcontent-%COMP%]{top:12px;left:-4px;bottom:12px;width:12px;cursor:ew-resize;background:transparent}.resize-handle.resize-handle-top-left[_ngcontent-%COMP%]{top:-6px;left:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}.resize-handle.resize-handle-top-right[_ngcontent-%COMP%]{top:-6px;right:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-left[_ngcontent-%COMP%]{bottom:0;left:-6px;width:20px;height:20px;cursor:nesw-resize;background:transparent}.resize-handle.resize-handle-bottom-right[_ngcontent-%COMP%]{bottom:0;right:-6px;width:20px;height:20px;cursor:nwse-resize;background:transparent}"],changeDetection:0})}return n})();var R2=class{sourceNode;sourcePort;targetNode;targetPort;constructor(i,e,t,o){this.sourceNode=i,this.sourcePort=e,this.targetNode=t,this.targetPort=o}};var zMe=(n,i)=>i.name;function jMe(n,i){n&1&&(ei(),s(0,"svg",8),R(1,"rect",10),l())}function $Me(n,i){n&1&&(ei(),s(0,"svg",8),R(1,"rect",11),l())}function HMe(n,i){if(n&1){let e=z();s(0,"button",6),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.chooseInterface(o))}),s(1,"span",7),A(2,jMe,2,0,":svg:svg",8),A(3,$Me,2,0,":svg:svg",8),s(4,"span",9),d(5),l()()()}if(n&2){let e=i.$implicit;C("disabled",!e.available),m(2),O(e.available?2:-1),m(),O(e.available?-1:3),m(2),j(e.name)}}function UMe(n,i){if(n&1&&(s(0,"div",2),R(1,"span",3),s(2,"mat-menu",4,0),Y(4,HMe,6,4,"button",5,zMe),l()()),n&2){let e=Pe(3),t=v();nn("left",t.leftPosition)("top",t.topPosition),m(),C("matMenuTriggerFor",e),m(),nn("min-height",0),m(2),Z(t.ports)}}var vg=(()=>{class n{links=le(void 0);chooseInterfaceChange=new ve;contextMenu=Nt(Fn);sanitizer=f(fr);changeDetector=f(Q);topPosition;leftPosition;node;ports;ngOnInit(){this.setPosition(0,0)}setPosition(e,t){this.topPosition=this.sanitizer.bypassSecurityTrustStyle(e+"px"),this.leftPosition=this.sanitizer.bypassSecurityTrustStyle(t+"px"),this.changeDetector.detectChanges()}open(e,t,o){this.node=e,this.filterNodePorts(),this.setPosition(t,o),this.contextMenu().openMenu()}filterNodePorts(){let e=[];this.links().forEach(t=>{t.nodes.forEach(o=>{o.node_id===this.node.node_id&&e.push(o)})}),this.ports=[],this.node.ports.forEach(t=>{let o=e.filter(r=>r.adapter_number===t.adapter_number);o.length===0||o.filter(r=>r.port_number===t.port_number).length===0?t.available=!0:t.available=!1,this.ports.push(t)})}chooseInterface(e){this.chooseInterfaceChange.emit({node:this.node,port:e})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-node-select-interface"]],viewQuery:function(t,o){t&1&&Xt(o.contextMenu,Fn,5),t&2&&Kt()},inputs:{links:[1,"links"]},outputs:{chooseInterfaceChange:"chooseInterfaceChange"},decls:1,vars:1,consts:[["selectInterfaceMenu","matMenu"],[1,"context-menu",3,"left","top"],[1,"context-menu"],[3,"matMenuTriggerFor"],["panelClass","interface-menu-panel"],["mat-menu-item","",3,"disabled"],["mat-menu-item","",3,"click","disabled"],[1,"interface-item"],["width","10","height","10",1,"status-icon"],[1,"port"],["x","0","y","0","width","10","height","10","fill","green"],["x","0","y","0","width","10","height","10","fill","red"]],template:function(t,o){t&1&&A(0,UMe,6,7,"div",1),t&2&&O(o.node?0:-1)},dependencies:[ne,Ge,Qn,Ze,Fn],styles:[".context-menu[_ngcontent-%COMP%]{position:absolute}.context-menu-items[_ngcontent-%COMP%]{min-height:0}.interface-item[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px}.status-icon[_ngcontent-%COMP%]{flex-shrink:0}.port[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})}return n})();var L2=(()=>{class n{links=le(void 0);nodeSelectInterfaceMenu=Nt(vg);nodeClicked$;drawingLineTool=f(Bf);nodesEventSource=f(Ml);linksEventSource=f(Da);mapNodeToNode=f(lp);nodeToMapNode=f(Tf);portToMapPort=f(kf);toasterService=f(te);cdr=f(Q);constructor(){}ngOnInit(){this.nodeClicked$=this.nodesEventSource.clicked.subscribe({next:e=>{let t=this.mapNodeToNode.convert(e.datum);this.nodeSelectInterfaceMenu().open(t,e.y,e.x)},error:e=>{let t=e.error?.message||e.message||"Failed to handle node click";this.toasterService.error(t),this.cdr.markForCheck()}})}ngOnDestroy(){this.drawingLineTool.isDrawing()&&this.drawingLineTool.stop(),this.nodeClicked$.unsubscribe()}onChooseInterface(e){let t=this.nodeToMapNode.convert(e.node),o=this.portToMapPort.convert(e.port);if(this.drawingLineTool.isDrawing()){let r=this.drawingLineTool.stop();this.linksEventSource.created.emit(new R2(r.node,r.port,t,o))}else this.drawingLineTool.start(t.x+t.width/2,t.y+t.height/2,{node:t,port:o})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-draw-link-tool"]],viewQuery:function(t,o){t&1&&Xt(o.nodeSelectInterfaceMenu,vg,5),t&2&&Kt()},inputs:{links:[1,"links"]},decls:1,vars:1,consts:[[3,"chooseInterfaceChange","links"]],template:function(t,o){t&1&&(s(0,"app-node-select-interface",0),g("chooseInterfaceChange",function(a){return o.onChooseInterface(a)}),l()),t&2&&C("links",o.links())},dependencies:[ne,vg],encapsulation:2,changeDetection:0})}return n})();var V2=(()=>{class n{project=le(void 0);controller=le(void 0);uploader;template;toasterService=f(te);dockerService=f(ds);qemuService=f(Kr);iouService=f(us);iosService=f(ps);cdr=f(Q);constructor(){}ngOnInit(){this.uploader=new $a({url:""}),this.uploader.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploader.onErrorItem=(e,t,o,r)=>{this.toasterService.error("An error has occured")},this.uploader.onCompleteItem=(e,t,o,r)=>{this.template.template_type==="qemu"?this.qemuService.addTemplate(this.controller(),this.template).subscribe({next:()=>this.onUploadComplete(),error:a=>{let c=a.error?.message||a.message||"Failed to add qemu template";this.toasterService.error(c),this.cdr.markForCheck()}}):this.template.template_type==="iou"?this.iouService.addTemplate(this.controller(),this.template).subscribe({next:()=>this.onUploadComplete(),error:a=>{let c=a.error?.message||a.message||"Failed to add iou template";this.toasterService.error(c),this.cdr.markForCheck()}}):this.template.template_type==="dynamips"?this.iosService.addTemplate(this.controller(),this.template).subscribe({next:()=>this.onUploadComplete(),error:a=>{let c=a.error?.message||a.message||"Failed to add ios template";this.toasterService.error(c),this.cdr.markForCheck()}}):this.template.template_type==="docker"&&this.dockerService.addTemplate(this.controller(),this.template).subscribe({next:()=>this.onUploadComplete(),error:a=>{let c=a.error?.message||a.message||"Failed to add docker template";this.toasterService.error(c),this.cdr.markForCheck()}})}}onUploadComplete(){this.toasterService.success("Appliance imported successfully"),this.uploader.queue=[],this.cdr.markForCheck()}uploadAppliance(e){let t=e.target.files[0],o=t.name,r=new FileReader,a;r.onloadend=()=>{let c=JSON.parse(r.result),p;if(c.qemu)a=new Am,a.template_type="qemu",a.adapter_type=c.qemu.adapter_type,a.adapters=c.qemu.adapters,a.ram=c.qemu.ram,a.options=c.qemu.options,a.console_type=c.qemu.console_type;else if(c.iou)a=new Im,a.template_type="iou",a.console_type=c.iou.console_type,a.console_auto_start=c.iou.console_auto_start,a.ethernet_adapters=c.iou.ethernet_adapters,a.l1_keepalives=c.iou.l1_keepalives,a.use_default_iou_values=c.iou.use_default_iou_values,a.nvram=c.iou.nvram,a.ram=c.iou.ram,a.serial_adapters=c.iou.serial_adapters;else if(c.dynamips)a=new Dm,a.template_type="dynamips",a.platform=c.dynamips.platform,a.ram=c.dynamips.ram,a.nvram=c.dynamips.nvram,a.startup_config=c.dynamips.startup_config,a.wic0=c.dynamips.wic0,a.wic1=c.dynamips.wic1,a.wic2=c.dynamips.wic2,a.slot0=c.dynamips.slot0,a.slot1=c.dynamips.slot1,a.slot2=c.dynamips.slot2,a.slot3=c.dynamips.slot3,a.slot4=c.dynamips.slot4,a.slot5=c.dynamips.slot5,a.slot6=c.dynamips.slot6,a.slot7=c.dynamips.slot7;else if(c.docker)a=new lg,a.template_type="docker",a.adapters=c.docker.adapters,a.console_type=c.docker.console_type,a.image=c.docker.image;else{this.toasterService.error("Template type not supported");return}a.name=c.name,a.category=c.category,a.builtin=!1,a.default_name_format="{name}-{0}",a.tags=c.tags||[],a.compute_id="vm",a.category==="guest"?a.symbol=":/symbols/computer.svg":a.symbol=`:/symbols/${a.category}_guest.svg`,this.template=a,this.cdr.markForCheck();let u=this.getUploadPath(this.controller(),o);this.uploader.queue.forEach(_=>_.url=u);let h=this.uploader.queue[0];this.uploader.uploadItem(h)},r.readAsText(t)}getUploadPath(e,t){return`${e.protocol}//${e.host}:${e.port}/${wi.current_version}/images/upload/${t}`}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-import-appliance"]],inputs:{project:[1,"project"],controller:[1,"controller"]},decls:0,vars:0,template:function(t,o){},dependencies:[ne],encapsulation:2,changeDetection:0})}return n})();var B2=(()=>{class n{data;dialogRef=f(Ie);confirmActionData={actionType:"start",isAction:!1};constructor(e){this.data=e}ngOnInit(){this.confirmActionData.actionType=this.data}confirmAction(){this.confirmActionData.isAction=!0,this.dialogRef.close(this.confirmActionData)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-nodes-menu-confirmation-dialog"]],decls:10,vars:2,consts:[["mat-dialog-title","",1,"nodes-menu-confirmation-dialog__title"],[1,"nodes-menu-confirmation-dialog__content"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-button","","cdkFocusInitial","",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),R(2,"mat-divider"),s(3,"mat-dialog-content",1),d(4),l(),s(5,"mat-dialog-actions",2)(6,"button",3),d(7,"No"),l(),s(8,"button",4),g("click",function(){return o.confirmAction()}),d(9,"Yes"),l()()),t&2&&(m(),ee("Confirm ",o.confirmActionData.actionType," All"),m(3),ee(" Are you sure you want to ",o.confirmActionData.actionType,` all devices?
`))},dependencies:[_e,pc,Ne,Fe,bt,W,pe,jr,ga],encapsulation:2,changeDetection:0})}return n})();var z2=(()=>{class n{nodeService=f(ut);nodeConsoleService=f(rr);nodesDataSource=f(di);toasterService=f(te);controllerService=f(Je);settingsService=f($r);mapSettingsService=f(go);dialog=f(nt);cdr=f(Q);project=le(void 0);controller=le(void 0);async startConsoleForAllNodes(){this.mapSettingsService.openConsolesInWidget?this.nodeConsoleService.openConsolesForAllNodesInWidget(this.nodesDataSource.getItems()):this.nodeConsoleService.openConsolesForAllNodesInNewTabs(this.nodesDataSource.getItems())}startNodes(){this.nodeService.startAll(this.controller(),this.project()).subscribe({next:()=>this.toasterService.success("All nodes successfully started"),error:e=>{let t=e.error?.message||e.message||"Failed to start nodes";this.toasterService.error(t),this.cdr.markForCheck()}})}stopNodes(){this.nodeService.stopAll(this.controller(),this.project()).subscribe({next:()=>this.toasterService.success("All nodes successfully stopped"),error:e=>{let t=e.error?.message||e.message||"Failed to stop nodes";this.toasterService.error(t),this.cdr.markForCheck()}})}suspendNodes(){this.nodeService.suspendAll(this.controller(),this.project()).subscribe({next:()=>this.toasterService.success("All nodes successfully suspended"),error:e=>{let t=e.error?.message||e.message||"Failed to suspend nodes";this.toasterService.error(t),this.cdr.markForCheck()}})}reloadNodes(){this.nodeService.reloadAll(this.controller(),this.project()).subscribe({next:()=>this.toasterService.success("All nodes successfully reloaded"),error:e=>{let t=e.error?.message||e.message||"Failed to reload nodes";this.toasterService.error(t),this.cdr.markForCheck()}})}resetNodes(){this.nodeService.resetAllNodes(this.controller(),this.project()).subscribe({next:()=>this.toasterService.success("Successfully reset all console connections"),error:e=>{let t=e.error?.message||e.message||"Failed to reset nodes";this.toasterService.error(t),this.cdr.markForCheck()}})}confirmControlsActions(e){this.dialog.open(B2,{panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],autoFocus:!1,disableClose:!0,data:e}).afterClosed().subscribe(o=>{!o||!o.isAction||(o.actionType=="start"?this.startNodes():o.actionType=="stop"?this.stopNodes():o.actionType=="reload"?this.reloadNodes():o.actionType=="suspend"?this.suspendNodes():o.actionType=="reset"&&this.resetNodes())})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-nodes-menu"]],inputs:{project:[1,"project"],controller:[1,"controller"]},decls:19,vars:0,consts:[[1,"menu-button-group"],["matTooltip","Console connect to all nodes","matTooltipClass","custom-tooltip","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Start/Resume all nodes","matTooltipClass","custom-tooltip","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Suspend all nodes","matTooltipClass","custom-tooltip","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Stop all nodes","matTooltipClass","custom-tooltip","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Reload all nodes","matTooltipClass","custom-tooltip","mat-icon-button","",1,"menu-button",3,"click"],["matTooltip","Reset all console connections","matTooltipClass","custom-tooltip","mat-icon-button","",1,"menu-button",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"button",1),g("click",function(){return o.startConsoleForAllNodes()}),s(2,"mat-icon"),d(3,"web_asset"),l()(),s(4,"button",2),g("click",function(){return o.confirmControlsActions("start")}),s(5,"mat-icon"),d(6,"play_arrow"),l()(),s(7,"button",3),g("click",function(){return o.confirmControlsActions("suspend")}),s(8,"mat-icon"),d(9,"pause"),l()(),s(10,"button",4),g("click",function(){return o.confirmControlsActions("stop")}),s(11,"mat-icon"),d(12,"stop"),l()(),s(13,"button",5),g("click",function(){return o.confirmControlsActions("reload")}),s(14,"mat-icon"),d(15,"replay"),l()(),s(16,"button",6),g("click",function(){return o.confirmControlsActions("reset")}),s(17,"mat-icon"),d(18,"compare_arrows"),l()()())},dependencies:[ne,_e,W,je,ie,de,wt,It],styles:[".marked[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.menu-button[_ngcontent-%COMP%]{margin:0 4px;transition:transform .1s ease}.menu-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}.menu-button[_ngcontent-%COMP%]:hover{transform:scale(1.2)}"],changeDetection:0})}return n})();var H9=(()=>{class n{transform(e,t){return e?t?(t=t.toLowerCase(),e.filter(o=>o.name.toLowerCase().includes(t))):e:[]}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"templatefilter",type:n,pure:!0})}return n})();var GMe=(n,i)=>i.name,WMe=(n,i)=>i.value;function qMe(n,i){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function QMe(n,i){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e.name," ")}}function XMe(n,i){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.display," ")}}function KMe(n,i){if(n&1){let e=z();s(0,"mat-form-field",12)(1,"mat-select",18),ac("valueChange",function(o){k(e);let r=v();return rc(r.selectedTemplate().compute_id,o)||(r.selectedTemplate().compute_id=o),T(o)}),Y(2,XMe,2,2,"mat-option",8,WMe),l()()}if(n&2){let e=v();m(),oc("value",e.selectedTemplate().compute_id),C("compareWith",e.compareControllers),m(),Z(e.nodeControllers)}}var j2=(()=>{class n{data;dialogRef=f(Ie);templateService=f(pl);computeService=f(ko);formBuilder=f(Vn);toasterService=f(te);nonNegativeValidator=f(up);cd=f(Q);controller;project;templateTypes=["cloud","ethernet_hub","ethernet_switch","docker","dynamips","vpcs","virtualbox","vmware","iou","qemu"];configurationForm;positionForm;templates=[];filteredTemplates=[];nodeControllers=[{display:"local",value:"local"}];searchText=U("");selectedType=U("");selectedTemplate=U(null);constructor(e){this.data=e,this.controller=e.controller,this.project=e.project,this.configurationForm=this.formBuilder.group({numberOfNodes:new Ye(1,[Ue.compose([Ue.required,this.nonNegativeValidator.get])])}),this.positionForm=this.formBuilder.group({top:new Ye(0,Ue.required),left:new Ye(0,Ue.required)})}ngOnInit(){this.templateService.list(this.controller).subscribe({next:e=>{this.filteredTemplates=e,this.templates=e,this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cd.markForCheck()}}),this.templateService.newTemplateCreated.subscribe(e=>{this.templates.push(e),this.filteredTemplates=[...this.templates],this.cd.markForCheck()}),this.computeService.getComputes(this.controller).subscribe({next:e=>{let t=e.filter(o=>o.compute_id!=="local").map(o=>{let r=o.compute_id.slice(-8);return{display:`${o.name||o.compute_id} (${r})`,value:o.compute_id}});this.nodeControllers=[{display:"local",value:"local"},...t],this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load computes";this.toasterService.error(t),this.nodeControllers=[{display:"local",value:"local"}],this.cd.markForCheck()}})}onNoClick(){this.dialogRef.close()}compareControllers(e,t){return e===t}filterTemplates(){let e=this.templates.filter(t=>t.name.toLowerCase().includes(this.searchText().toLowerCase()));this.selectedType()===""||this.selectedType()==="all"?this.filteredTemplates=e:this.filteredTemplates=e.filter(t=>t.template_type===this.selectedType())}chooseTemplate(){if(this.selectedTemplate()){let e=this.selectedTemplate();(e.template_type==="cloud"||e.template_type==="ethernet_hub"||e.template_type==="ethernet_switch")&&(e.compute_id="local")}}onAddClick(){if(!this.selectedTemplate()||this.filteredTemplates.length===0)this.toasterService.error("Please firstly choose template.");else if(!this.positionForm.valid||!this.configurationForm.valid||!this.selectedTemplate().compute_id)this.toasterService.error("Please fill all required fields.");else{let e=this.positionForm.get("left").value,t=this.positionForm.get("top").value;if(e>this.project.scene_width/2||e<-(this.project.scene_width/2)||t>this.project.scene_height/2||t<-this.project.scene_height)this.toasterService.error("Please set correct position values.");else{let o={template:this.selectedTemplate(),controller:this.selectedTemplate().compute_id,numberOfNodes:this.configurationForm.get("numberOfNodes").value,x:e,y:t};this.dialogRef.close(o)}}}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-template-list-dialog"]],inputs:{searchText:[1,"searchText"],selectedType:[1,"selectedType"],selectedTemplate:[1,"selectedTemplate"]},outputs:{searchText:"searchTextChange",selectedType:"selectedTypeChange",selectedTemplate:"selectedTemplateChange"},decls:42,vars:12,consts:[[1,"title-container"],["mat-dialog-title",""],["mat-button","","color","accent",1,"top-button",3,"click","routerLink"],["mat-dialog-content","",1,"content"],["floatPlaceholder","never",1,"form-field"],["matInput","","placeholder","Search by name",3,"input","value"],[1,"form-field"],["placeholder","Filter templates by type",3,"selectionChange","value"],[3,"value"],["placeholder","Choose template",3,"selectionChange","value","compareWith"],[3,"formGroup"],["type","number","matInput","","formControlName","numberOfNodes","placeholder","Enter number of nodes (default value is 1)"],[1,"form-field","compute-select"],["matInput","","type","number","formControlName","left"],["matInput","","type","number","formControlName","top"],["mat-dialog-actions","","align","end"],["mat-button","","tabindex","-1","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"addButton",3,"click"],["placeholder","Choose controller for node",3,"valueChange","value","compareWith"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"h1",1),d(2,"Add a node"),l(),s(3,"button",2),g("click",function(){return o.onNoClick()}),d(4," Go to template preferences "),l()(),s(5,"div",3)(6,"div",0)(7,"h6"),d(8,"Template"),l()(),s(9,"mat-form-field",4)(10,"input",5),g("input",function(a){return o.searchText.set(a.target.value),o.filterTemplates()}),l()(),s(11,"mat-form-field",6)(12,"mat-select",7),g("selectionChange",function(a){return o.selectedType.set(a.value),o.filterTemplates()}),Y(13,qMe,2,2,"mat-option",8,Ae),l()(),s(15,"mat-form-field",6)(16,"mat-select",9),g("selectionChange",function(a){return o.selectedTemplate.set(a.value),o.chooseTemplate()}),Y(17,QMe,2,2,"mat-option",8,GMe),en(19,"templatefilter"),l()(),s(20,"div",0)(21,"h6"),d(22,"Configuration"),l()(),s(23,"form",10)(24,"mat-form-field",6),R(25,"input",11),l()(),A(26,KMe,4,2,"mat-form-field",12),s(27,"div",0)(28,"h6"),d(29,"Position"),l()(),s(30,"form",10),d(31," Left:\xA0 "),s(32,"mat-form-field"),R(33,"input",13),l(),d(34," Top:\xA0 "),s(35,"mat-form-field"),R(36,"input",14),l()()(),s(37,"div",15)(38,"button",16),g("click",function(){return o.onNoClick()}),d(39,"Close"),l(),s(40,"button",17),g("click",function(){return o.onAddClick()}),d(41," Add "),l()()),t&2&&(m(3),C("routerLink",Ui("/controller/",o.controller==null?null:o.controller.id,"/preferences")),m(7),C("value",o.searchText()),m(2),C("value",o.selectedType()),m(),Z(o.templateTypes),m(3),C("value",o.selectedTemplate())("compareWith",o.compareControllers),m(),Z(na(19,9,o.filteredTemplates,o.searchText())),m(6),C("formGroup",o.configurationForm),m(3),O(o.selectedTemplate()?26:-1),m(4),C("formGroup",o.positionForm))},dependencies:[ne,Dt,at,Ft,_r,Pt,rt,Rt,zt,dt,vn,_e,Ne,Fe,bt,W,pe,we,Me,Se,Ee,vt,At,_t,H9],styles:[".header[_ngcontent-%COMP%]{min-height:64px;display:flex;align-items:baseline;padding:8px 24px 0;font-size:18px;justify-content:space-between}.mat-table[_ngcontent-%COMP%]{height:200px;overflow:scroll}.mat-form-field[_ngcontent-%COMP%]{font-size:14px;flex-grow:1}.form-field[_ngcontent-%COMP%]{width:100%}div[_ngcontent-%COMP%]{scrollbar-color:darkgrey var(--mat-sys-surface);scrollbar-width:thin}h6[_ngcontent-%COMP%]{margin-top:4px;margin-bottom:8px;color:var(--mat-sys-primary)}mat-table[_ngcontent-%COMP%]{scrollbar-color:darkgrey var(--mat-sys-surface);scrollbar-width:thin}.filterBox[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.title-container[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between}.compute-select[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var YMe=["selectorContainer"],ZMe=(n,i)=>i.compute_id;function JMe(n,i){n&1&&(s(0,"mat-icon",7),d(1,"check_circle"),l())}function eke(n,i){n&1&&(s(0,"mat-icon",8),d(1,"cancel"),l())}function tke(n,i){if(n&1){let e=z();s(0,"button",4),g("click",function(){let o=k(e).$implicit,r=v();return T(r.selectCompute(o.compute_id))}),s(1,"div",5)(2,"span",6),d(3),l(),A(4,JMe,2,0,"mat-icon",7)(5,eke,2,0,"mat-icon",8),l(),s(6,"div",9)(7,"span",10)(8,"span",11),d(9,"CPU:"),l(),s(10,"span"),d(11),l()(),s(12,"span",10)(13,"span",12),d(14,"MEM:"),l(),s(15,"span"),d(16),l()(),s(17,"span",10)(18,"span",13),d(19,"DISK:"),l(),s(20,"span"),d(21),l()()()()}if(n&2){let e=i.$implicit,t=i.$index,o=v();Be("compute-selector__item--even",t%2===1),m(3),j(o.getComputeDisplayName(e)),m(),O(e.connected?4:5),m(6),er(o.getUsageColorClass(e,"cpu")),m(),j(o.getCpuInfo(e)),m(4),er(o.getUsageColorClass(e,"mem")),m(),j(o.getMemoryInfo(e)),m(4),er(o.getUsageColorClass(e,"disk")),m(),j(o.getDiskInfo(e))}}var U9=(()=>{class n{cd=f(Q);selectorContainer;computes=le.required();x=le.required();y=le.required();MARGIN=10;actualWidth=ae(200);actualHeight=ae(120);resizeObserver;computeSelected=new ve;selectorX=Jt(()=>{let e=this.x(),t=window.innerWidth,o=this.actualWidth();return e+o+this.MARGIN>t?e-o-this.MARGIN:e+this.MARGIN});selectorY=Jt(()=>{let e=this.y(),t=window.innerHeight,o=this.actualHeight();return e+o+this.MARGIN>t?e-o-this.MARGIN:e+this.MARGIN});constructor(){this.resizeObserver=new ResizeObserver(e=>{for(let t of e)this.actualWidth.set(t.contentRect.width),this.actualHeight.set(t.contentRect.height);this.cd.markForCheck()})}ngAfterViewInit(){if(this.selectorContainer?.nativeElement){let e=this.selectorContainer.nativeElement.getBoundingClientRect();this.actualWidth.set(e.width),this.actualHeight.set(e.height),this.cd.markForCheck(),this.resizeObserver.observe(this.selectorContainer.nativeElement)}setTimeout(()=>{this.selectorContainer?.nativeElement&&this.selectorContainer.nativeElement.focus()},0)}ngOnDestroy(){this.resizeObserver&&this.resizeObserver.disconnect()}selectCompute(e){this.computeSelected.emit(e)}getComputeDisplayName(e){return e.compute_id==="local"?`${e.name} (controller)`:`${e.name} (${e.host}:${e.port})`}getCpuInfo(e){let t=e.capabilities?.cpus||0;return`${e.cpu_usage_percent||0}% / ${t}c`}getMemoryInfo(e){let t=e.capabilities?.memory||0,o=e.memory_usage_percent||0,r=this.bytesToGB(t);return`${(r*o/100).toFixed(1)}/${r.toFixed(0)} GB`}getDiskInfo(e){return`${e.disk_usage_percent||0}%`}getUsageColorClass(e,t){let o;switch(t){case"cpu":o=e.cpu_usage_percent||0;break;case"mem":o=e.memory_usage_percent||0;break;case"disk":o=e.disk_usage_percent||0;break}return o<60?"compute-selector__usage--low":o<85?"compute-selector__usage--medium":"compute-selector__usage--high"}bytesToGB(e){return e/(1024*1024*1024)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-compute-selector"]],viewQuery:function(t,o){if(t&1&&xn(YMe,5),t&2){let r;mt(r=pt())&&(o.selectorContainer=r.first)}},inputs:{computes:[1,"computes"],x:[1,"x"],y:[1,"y"]},outputs:{computeSelected:"computeSelected"},decls:5,vars:4,consts:[["selectorContainer",""],["tabindex","0",1,"compute-selector"],[1,"compute-selector__list"],["mat-button","",1,"compute-selector__item",3,"compute-selector__item--even"],["mat-button","",1,"compute-selector__item",3,"click"],[1,"compute-selector__item-main"],[1,"compute-selector__item-name"],[1,"compute-selector__status","compute-selector__status--connected"],[1,"compute-selector__status","compute-selector__status--disconnected"],[1,"compute-selector__item-info"],[1,"compute-selector__info-item"],[1,"compute-selector__label","compute-selector__label--cpu"],[1,"compute-selector__label","compute-selector__label--mem"],[1,"compute-selector__label","compute-selector__label--disk"]],template:function(t,o){t&1&&(s(0,"div",1,0)(2,"div",2),Y(3,tke,22,13,"button",3,ZMe),l()()),t&2&&(nn("left",o.selectorX(),"px")("top",o.selectorY(),"px"),m(3),Z(o.computes()))},dependencies:[ne,ie,de,W,pe],styles:[".compute-selector[_ngcontent-%COMP%]{position:fixed;width:fit-content;min-width:200px;max-width:400px;background:var(--mat-sys-surface);border:1px solid var(--mat-sys-outline-variant);border-radius:8px;box-shadow:var(--mat-sys-shadow);z-index:1000;overflow:hidden;padding:4px;outline:none}.compute-selector[_ngcontent-%COMP%]:focus{outline:none}.compute-selector__list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.compute-selector__item[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;width:100%;padding:8px 12px;border-radius:6px;text-align:left;transition:background-color .15s ease}.compute-selector__item-main[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px}.compute-selector__item-info[_ngcontent-%COMP%]{display:flex;gap:12px;width:100%}.compute-selector__info-item[_ngcontent-%COMP%]{display:flex;gap:4px;font-size:12px;color:var(--mat-sys-on-surface-variant);white-space:nowrap}.compute-selector__label[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-primary)}.compute-selector__usage[_ngcontent-%COMP%]{font-weight:500}.compute-selector__usage--low[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.compute-selector__usage--medium[_ngcontent-%COMP%]{color:var(--mat-sys-tertiary)}.compute-selector__usage--high[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.compute-selector__item[_ngcontent-%COMP%]:hover, .compute-selector__item--even[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-highest)}.compute-selector__item-name[_ngcontent-%COMP%]{flex:1;font-size:13px;color:var(--mat-sys-on-surface);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.compute-selector__status[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0}.compute-selector__status--connected[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.compute-selector__status--disconnected[_ngcontent-%COMP%]{color:var(--mat-sys-error)}"],changeDetection:0})}return n})();var nke=["menuTrigger"],G9=()=>({standalone:!0}),ike=(n,i)=>i.id;function oke(n,i){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function rke(n,i){if(n&1){let e=z();s(0,"div",16)(1,"div",17),g("dragStart",function(o){k(e);let r=v(2).$index,a=v();return T(a.dragStart(o,a.filteredTemplates[r]))})("dragEnd",function(o){k(e);let r=v(2).$index,a=v();return T(a.dragEnd(o,a.filteredTemplates[r+1]))}),R(2,"img",18),l(),s(3,"span",19),d(4),l()()}if(n&2){let e=v(2).$index,t=v();m(),C("ghostElementAppendTo",t.bodyElement),m(),C("src",t.getImageSourceForTemplate(t.filteredTemplates[e+1]),Ia),m(2),j(t.filteredTemplates[e+1].name)}}function ake(n,i){if(n&1){let e=z();s(0,"div",16)(1,"div",17),g("dragStart",function(o){k(e);let r=v(2).$index,a=v();return T(a.dragStart(o,a.filteredTemplates[r]))})("dragEnd",function(o){k(e);let r=v(2).$index,a=v();return T(a.dragEnd(o,a.filteredTemplates[r+2]))}),R(2,"img",18),l(),s(3,"span",19),d(4),l()()}if(n&2){let e=v(2).$index,t=v();m(),C("ghostElementAppendTo",t.bodyElement),m(),C("src",t.getImageSourceForTemplate(t.filteredTemplates[e+2]),Ia),m(2),j(t.filteredTemplates[e+2].name)}}function ske(n,i){if(n&1){let e=z();s(0,"div",16)(1,"div",17),g("dragStart",function(o){k(e);let r=v(2).$index,a=v();return T(a.dragStart(o,a.filteredTemplates[r]))})("dragEnd",function(o){k(e);let r=v(2).$index,a=v();return T(a.dragEnd(o,a.filteredTemplates[r+3]))}),R(2,"img",18),l(),s(3,"span",19),d(4),l()()}if(n&2){let e=v(2).$index,t=v();m(),C("ghostElementAppendTo",t.bodyElement),m(),C("src",t.getImageSourceForTemplate(t.filteredTemplates[e+3]),Ia),m(2),j(t.filteredTemplates[e+3].name)}}function lke(n,i){if(n&1){let e=z();s(0,"div",15)(1,"div",16)(2,"div",17),g("dragStart",function(o){k(e);let r=v().$index,a=v();return T(a.dragStart(o,a.filteredTemplates[r]))})("dragEnd",function(o){k(e);let r=v().$index,a=v();return T(a.dragEnd(o,a.filteredTemplates[r]))}),R(3,"img",18),l(),s(4,"span",19),d(5),l()(),A(6,rke,5,3,"div",16),A(7,ake,5,3,"div",16),A(8,ske,5,3,"div",16),l()}if(n&2){let e=v().$index,t=v();m(2),C("ghostElementAppendTo",t.bodyElement),m(),C("src",t.getImageSourceForTemplate(t.filteredTemplates[e]),Ia),m(2),j(t.filteredTemplates[e].name),m(),O(t.filteredTemplates[e+1]?6:-1),m(),O(t.filteredTemplates[e+2]?7:-1),m(),O(t.filteredTemplates[e+3]?8:-1)}}function cke(n,i){if(n&1&&A(0,lke,9,6,"div",15),n&2){let e=i.$index;O(e%4===0?0:-1)}}function dke(n,i){if(n&1){let e=z();s(0,"div",20),g("click",function(){k(e);let o=v();return T(o.onComputeSelectorCancelled())}),l()}}function mke(n,i){if(n&1){let e=z();s(0,"app-compute-selector",21),g("computeSelected",function(o){k(e);let r=v();return T(r.onComputeSelected(o))}),l()}if(n&2){let e=v();C("computes",e.availableComputes())("x",e.lastPageX())("y",e.lastPageY())}}function pke(n,i){n&1&&(s(0,"div",25)(1,"mat-icon",26),d(2,"error"),l()())}function uke(n,i){if(n&1&&(s(0,"div",22)(1,"div",23),d(2),l(),R(3,"img",24),A(4,pke,3,0,"div",25),l()),n&2){let e=i.$implicit,t=v(),o=t.getCreatingNodeScreenPosition(e),r=e.status==="success";nn("left",o.x,"px")("top",o.y,"px"),Be("template__ghost-icon--fading",r),m(2),j(e.template.name),m(),Be("template__ghost-icon-img--error",e.status==="error"),C("src",t.getImageSourceForTemplate(e.template),Ia),m(),O(e.status==="error"?4:-1)}}var Cg=(()=>{class n{document;dialog=f(nt);templateService=f(pl);symbolService=f(ml);domSanitizer=f(fr);themeService=f(ci);overlayContainer=f(qu);context=f(Eo);cd=f(Q);computeService=f(ko);notificationService=f(Ws);toasterService=f(te);controller=le(void 0);project=le(void 0);nodeCreationChange=new ve;menuTrigger;overlay;templates=[];filteredTemplates=[];templateSymbolBlobUrls=new Map;bodyElement;constructor(e){this.document=e,this.overlay=this.overlayContainer.getContainerElement(),this.bodyElement=this.document.body}templateTypes=["all","cloud","ethernet_hub","ethernet_switch","docker","dynamips","vpcs","iou","qemu"];searchText=U("");selectedType=U("all");lastPageX=ae(0);lastPageY=ae(0);isDragging=ae(!1);mouseOffsetX=0;mouseOffsetY=0;dragElement=null;showComputeSelector=ae(!1);availableComputes=ae([]);pendingNodePosition=ae(null);pendingTemplate=ae(null);cachedComputes=ae([]);creatingNodes=ae(new Map);pendingCreationId=ae(null);ghostIconScreenPosition=Jt(()=>{let e=this.pendingNodePosition();if(!e)return{x:0,y:0};let t=this.context.transformation.k,o=this.context.getZeroZeroTransformationPoint(),r=e.x*t+o.x+this.context.transformation.x,a=e.y*t+o.y+this.context.transformation.y;return{x:r,y:a}});subscription;themeSubscription;isLightThemeEnabled=!1;controllerWatcher=ha(()=>{let e=this.controller();e&&e.id&&this.templates.length===0&&this.loadTemplates()});ngOnInit(){this.subscription=this.templateService.newTemplateCreated.subscribe(e=>{this.templates.push(e),this.loadTemplateSymbolBlobs([e]),this.cd.markForCheck()}),this.subscription.add(this.notificationService.computeCacheUpdated.subscribe(e=>{this.cachedComputes.set(e),this.cd.markForCheck()})),this.notificationService.hasCachedData()&&this.cachedComputes.set(this.notificationService.getCachedComputes()),this.controller()&&this.controller().id&&this.loadTemplates(),this.symbolService.list(this.controller()),this.isLightThemeEnabled=this.themeService.getThemeType()==="light",this.themeSubscription=this.themeService.themeChanged.subscribe(()=>{this.isLightThemeEnabled=this.themeService.getThemeType()==="light"})}loadTemplates(){this.templateService.list(this.controller()).subscribe({next:e=>{this.filteredTemplates=e,this.sortTemplates(),this.templates=e,this.loadTemplateSymbolBlobs(e),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load templates";this.toasterService.error(t),this.cd.markForCheck()}})}loadTemplateSymbolBlobs(e){let t=new Map;e.forEach(r=>{let a=r.symbol,c;a.startsWith(":/")?c=`/symbols/${a}/raw`:c=`/symbols/${a}/raw`,t.set(a,c)});let o=Array.from(t.values());qi(o.map(r=>this.symbolService.getSymbolBlobUrl(this.controller(),r))).subscribe({next:r=>{o.forEach((a,c)=>{for(let[p,u]of t.entries())if(u===a){this.templateSymbolBlobUrls.set(p,r[c]);break}}),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to load template symbols";this.toasterService.error(a),this.cd.markForCheck()}})}sortTemplates(){this.filteredTemplates=this.filteredTemplates.sort((e,t)=>e.name<t.name?-1:1)}filterTemplates(){let e=this.templates.filter(t=>t.name.toLowerCase().includes(this.searchText().toLowerCase()));this.selectedType()==="all"||!this.selectedType()?this.filteredTemplates=e:this.filteredTemplates=e.filter(t=>t.template_type===this.selectedType()),this.sortTemplates()}dragStart(e,t){this.menuTrigger&&this.menuTrigger.closeMenu();let o=window.event,r=o?.clientX||0,a=o?.clientY||0,c=o?.target;if(c){let h=c.getBoundingClientRect();this.mouseOffsetX=r-h.left,this.mouseOffsetY=a-h.top,this.dragElement=c}this.isDragging.set(!0),this.lastPageX.set(r),this.lastPageY.set(a);let p=h=>{this.isDragging()&&(this.lastPageX.set(h.clientX),this.lastPageY.set(h.clientY))},u=()=>{this.isDragging.set(!1),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",u,{once:!0})}dragEnd(e,t){let o=this.lastPageX(),r=this.lastPageY(),a=this.context.getZeroZeroTransformationPoint(),c=this.context.size.width>0?a.x:this.project().scene_width/2,p=this.context.size.height>0?a.y:this.project().scene_height/2,u=(o-(c+this.context.transformation.x))/this.context.transformation.k,h=(r-(p+this.context.transformation.y))/this.context.transformation.k,_=Math.round(u-this.mouseOffsetX),S=Math.round(h-this.mouseOffsetY),x=this.cachedComputes();x.length===0?this.computeService.getComputes(this.controller()).subscribe({next:b=>{this.notificationService.setInitialComputes(b),this.cachedComputes.set(b),this.processNodeCreation(t,_,S,b)},error:b=>{let M=b.error?.message||b.message||"Failed to load computes";this.toasterService.error(M),this.cd.markForCheck();let w={template:t,controller:"local",numberOfNodes:1,x:_,y:S};this.nodeCreationChange.emit(w)}}):this.processNodeCreation(t,_,S,x)}processNodeCreation(e,t,o,r){let a=r.filter(u=>u.connected);if(a.length===0){this.toasterService.error("No reachable compute nodes available. Please check your compute nodes connection status.");return}let c=this.generateUniqueId(),p={id:c,template:e,x:t,y:o,computeId:null,status:"waiting_for_compute"};if(this.addCreatingNode(p),a.length===1)this.startNodeCreation(c,a[0].compute_id);else{this.pendingCreationId.set(c);let u=[...a].sort((h,_)=>h.compute_id==="local"?-1:_.compute_id==="local"?1:(h.name||"").localeCompare(_.name||""));this.availableComputes.set(u),this.showComputeSelector.set(!0),this.cd.markForCheck()}}closeComputeSelector(){this.showComputeSelector.set(!1),this.pendingCreationId.set(null)}onComputeSelected(e){let t=this.pendingCreationId();t&&(this.updateCreatingNodeCompute(t,e),this.startNodeCreation(t,e),this.closeComputeSelector())}onComputeSelectorCancelled(){let e=this.pendingCreationId();e&&this.removeCreatingNode(e),this.closeComputeSelector()}generateUniqueId(){return`creation-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}addCreatingNode(e){let t=new Map(this.creatingNodes());t.set(e.id,e),this.creatingNodes.set(t),this.cd.markForCheck()}updateCreatingNodeCompute(e,t){let o=new Map(this.creatingNodes()),r=o.get(e);r&&(r.computeId=t,r.status="creating",o.set(e,r),this.creatingNodes.set(o),this.cd.markForCheck())}updateCreatingNodeStatus(e,t,o){let r=new Map(this.creatingNodes()),a=r.get(e);a&&(a.status=t,a.errorMessage=o,r.set(e,a),this.creatingNodes.set(r),this.cd.markForCheck())}removeCreatingNode(e){let t=new Map(this.creatingNodes());t.delete(e),this.creatingNodes.set(t),this.cd.markForCheck()}getCreatingNodeScreenPosition(e){let t=this.context.transformation.k,o=this.context.getZeroZeroTransformationPoint(),r=e.x*t+o.x+this.context.transformation.x,a=e.y*t+o.y+this.context.transformation.y;return{x:r,y:a}}startNodeCreation(e,t){let o=this.creatingNodes().get(e);if(!o)return;let r={template:o.template,controller:t,numberOfNodes:1,x:o.x,y:o.y,creationId:e};this.nodeCreationChange.emit(r)}onNodeCreated(e,t,o){this.updateCreatingNodeStatus(e,t?"success":"error",o),setTimeout(()=>{this.removeCreatingNode(e)},t?1e3:3e3)}openDialog(){this.dialog.open(j2,{panelClass:["base-dialog-panel","template-dialog-panel"],data:{controller:this.controller(),project:this.project()},autoFocus:!1}).afterClosed().subscribe(t=>{t!==null&&this.nodeCreationChange.emit(t)})}getImageSourceForTemplate(e){return this.templateSymbolBlobUrls.get(e.symbol)||""}onMenuClosed(){}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)(ot(Xi))};static \u0275cmp=F({type:n,selectors:[["app-template"]],viewQuery:function(t,o){if(t&1&&xn(nke,5),t&2){let r;mt(r=pt())&&(o.menuTrigger=r.first)}},inputs:{controller:[1,"controller"],project:[1,"project"],searchText:[1,"searchText"],selectedType:[1,"selectedType"]},outputs:{nodeCreationChange:"nodeCreationChange",searchText:"searchTextChange",selectedType:"selectedTypeChange"},decls:25,vars:9,consts:[["menuTrigger","matMenuTrigger"],["mainMenu","matMenu"],["matTooltip","Add a node","matTooltipClass","custom-tooltip","mat-icon-button","",1,"template__add-btn",3,"matMenuTriggerFor"],[1,"template-menu",3,"closed"],["mat-menu-item","",1,"template__dialog-btn",3,"click"],[1,"template__filters"],["floatPlaceholder","never",1,"template__search-field",3,"click"],["matInput","","placeholder","Search template by name",3,"keyup","ngModelChange","ngModel","ngModelOptions"],[1,"template__select-field",3,"click"],["placeholder","Filter templates by type",3,"selectionChange","ngModelOptions","ngModel"],[3,"value"],[1,"template__list"],[1,"template__selector-backdrop"],[3,"computes","x","y"],[1,"template__ghost-icon",3,"template__ghost-icon--fading","left","top"],[1,"template__row"],[1,"template__item"],["mwlDraggable","",1,"template__icon-wrapper",3,"dragStart","dragEnd","ghostElementAppendTo"],["draggable","false",1,"template__icon",3,"src"],[1,"template__name"],[1,"template__selector-backdrop",3,"click"],[3,"computeSelected","computes","x","y"],[1,"template__ghost-icon"],[1,"template__ghost-name"],["draggable","false",1,"template__ghost-icon-img",3,"src"],[1,"template__ghost-icon-status"],[1,"template__status-icon--error"]],template:function(t,o){if(t&1){let r=z();s(0,"button",2,0)(2,"mat-icon"),d(3,"add"),l()(),s(4,"mat-menu",3,1),g("closed",function(){return o.onMenuClosed()}),s(6,"button",4),g("click",function(){return o.openDialog()}),s(7,"mat-icon"),d(8,"add_to_queue"),l(),s(9,"span"),d(10,"Open dialog to configure"),l()(),s(11,"div",5)(12,"mat-form-field",6),g("click",function(c){return c.stopPropagation()}),s(13,"input",7),g("keyup",function(){return o.filterTemplates()})("ngModelChange",function(c){return o.searchText.set(c)}),l()(),s(14,"mat-form-field",8),g("click",function(c){return c.stopPropagation()}),s(15,"mat-select",9),g("selectionChange",function(c){return k(r),o.selectedType.set(c.value),T(o.filterTemplates())}),Y(16,oke,2,2,"mat-option",10,Ae),l()()(),s(18,"div",11),Y(19,cke,1,1,null,null,Hi),l()(),A(21,dke,1,0,"div",12),A(22,mke,1,3,"app-compute-selector",13),Y(23,uke,5,11,"div",14,ike)}if(t&2){let r=Pe(5);C("matMenuTriggerFor",r),m(13),C("ngModel",o.searchText())("ngModelOptions",Bt(7,G9)),m(2),C("ngModelOptions",Bt(8,G9))("ngModel",o.selectedType()),m(),Z(o.templateTypes),m(3),Z(o.filteredTemplates),m(2),O(o.showComputeSelector()?21:-1),m(),O(o.showComputeSelector()?22:-1),m(),Z(o.creatingNodes().values())}},dependencies:[ne,Xe,Ft,Pt,r4,_e,ie,de,W,je,Ge,Qn,Ze,Fn,we,Me,Se,Ee,vt,At,_t,Fo,Zi,Bb,KR,U9],styles:["[_nghost-%COMP%]{--mat-menu-container-max-width: 500px;--mat-menu-container-width: 500px}.template__menu[_ngcontent-%COMP%]{max-width:500px;max-height:520px}.template__add-btn[_ngcontent-%COMP%]{transition:transform .1s ease}.template__add-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}.template__add-btn[_ngcontent-%COMP%]:hover{transform:scale(1.1)}.template__dialog-btn[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.template__filters[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-bottom:1px solid var(--mat-sys-outline-variant)}.template__search-field[_ngcontent-%COMP%], .template__select-field[_ngcontent-%COMP%]{width:100%}.template__search-field[_ngcontent-%COMP%] .mat-mdc-form-field-subscript-wrapper[_ngcontent-%COMP%]{display:none}.template__list[_ngcontent-%COMP%]{padding:12px 8px;max-height:380px;overflow-y:auto;scrollbar-color:var(--mat-sys-on-surface-variant) transparent;scrollbar-width:thin}.template__row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin-bottom:12px}.template__row[_ngcontent-%COMP%]:last-child{margin-bottom:0}.template__item[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;width:90px;padding:8px;border-radius:8px;transition:background-color .2s ease;cursor:grab;user-select:none;-webkit-user-select:none}.template__item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 10%,transparent)}.template__item[_ngcontent-%COMP%]:active{cursor:grabbing}.template__icon-wrapper[_ngcontent-%COMP%]{width:65px;height:65px;display:flex;align-items:center;justify-content:center;margin-bottom:6px}.template__icon[_ngcontent-%COMP%]{width:65px;height:65px;object-fit:contain;filter:drop-shadow(0 2px 4px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent));transition:transform .2s ease}.template__item[_ngcontent-%COMP%]:hover .template__icon[_ngcontent-%COMP%]{transform:scale(1.05)}.template__name[_ngcontent-%COMP%]{font-size:15px;font-weight:500;color:var(--mat-sys-on-surface);text-align:center;word-break:break-word;max-width:85px;line-height:1.3}@media(max-width:480px){.template__menu[_ngcontent-%COMP%]{max-width:320px;max-height:450px}.template__item[_ngcontent-%COMP%]{width:75px;padding:6px}.template__icon-wrapper[_ngcontent-%COMP%], .template__icon[_ngcontent-%COMP%]{width:55px;height:55px}.template__name[_ngcontent-%COMP%]{font-size:10px;max-width:70px}}.template__ghost-icon[_ngcontent-%COMP%]{position:fixed;pointer-events:none;z-index:999;animation:_ngcontent-%COMP%_pulse 2s ease-in-out infinite}.template__ghost-icon--fading[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeOut .5s ease-out forwards}.template__ghost-name[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:50%;transform:translate(-50%);margin-bottom:8px;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface);background:var(--mat-sys-surface);padding:4px 8px;border-radius:4px;white-space:nowrap;box-shadow:0 2px 4px var(--mat-sys-shadow);pointer-events:none}.template__ghost-icon-img[_ngcontent-%COMP%]{width:60px;height:60px;opacity:.6;filter:drop-shadow(0 4px 8px var(--mat-sys-shadow))}.template__ghost-icon-img--error[_ngcontent-%COMP%]{opacity:.4;filter:grayscale(100%) drop-shadow(0 4px 8px var(--mat-sys-shadow))}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.6;transform:scale(1)}50%{opacity:.8;transform:scale(1.02)}}@keyframes _ngcontent-%COMP%_fadeOut{0%{opacity:.8;transform:scale(1)}to{opacity:0;transform:scale(.3)}}.template__ghost-icon-status[_ngcontent-%COMP%]{position:absolute;top:-8px;right:-8px;background:var(--mat-sys-surface);border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px var(--mat-sys-shadow)}.template__ghost-icon-status[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:20px;height:20px;font-size:20px}.template__ghost-icon-status[_ngcontent-%COMP%] .template__status-icon--success[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.template__ghost-icon-status[_ngcontent-%COMP%] .template__status-icon--error[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.template__selector-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:998;cursor:default}"],changeDetection:0})}return n})();var bg=(()=>{class n{httpController;constructor(e){this.httpController=e}create(e,t,o){return this.httpController.post(e,`/projects/${t}/snapshots`,o)}delete(e,t,o){return this.httpController.delete(e,`/projects/${t}/snapshots/${o}`)}list(e,t){return this.httpController.get(e,`/projects/${t}/snapshots`)}restore(e,t,o){return this.httpController.post(e,`/projects/${t}/snapshots/${o}/restore`,{})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var xg=(()=>{class n{data;dialogRef=f(Ie);static CANCELLED;value=ae(50);constructor(e){this.data=e}onCancelClick(){this.dialogRef.close(n.CANCELLED)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-progress-dialog"]],decls:7,vars:1,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["color","primary","mode","determinate",3,"value"],["mat-dialog-actions",""],["mat-button","","tabindex","-1","color","accent",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Operation in progress"),l(),s(2,"div",1),R(3,"mat-progress-bar",2),l(),s(4,"div",3)(5,"button",4),g("click",function(){return o.onCancelClick()}),d(6,"Cancel"),l()()),t&2&&(m(3),C("value",o.value()))},dependencies:[_e,Ne,Fe,bt,W,pe,pn,ms,Rc],encapsulation:2,changeDetection:0})}return n})();var $2=(()=>{class n{dialog;constructor(e){this.dialog=e}open(){return this.dialog.open(xg,{width:"250px",autoFocus:!1,disableClose:!0})}static \u0275fac=function(t){return new(t||n)(ge(nt))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var H2=class{snapshot_id;name;created_at;project_id};var U2=(()=>{class n{data;dialogRef=f(Ie);formBuilder=f(Vn);toasterService=f(te);snapshotService=f(bg);cd=f(Q);controller;project;snapshot=new H2;inputForm;existingSnapshotNames=[];constructor(e){this.data=e,this.controller=e.controller,this.project=e.project,this.inputForm=this.formBuilder.group({snapshotName:new Ye("",Ue.required)}),this.project?.project_id&&this.snapshotService.list(this.controller,this.project.project_id).subscribe({next:t=>{this.existingSnapshotNames=t.map(o=>o.name),this.cd.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to load snapshots";this.toasterService.error(o),this.cd.markForCheck()}})}onAddClick(){let e=this.inputForm.get("snapshotName").value?.trim();this.inputForm.invalid||!e?this.toasterService.error("Fill all required fields"):this.existingSnapshotNames.includes(e)?this.toasterService.error("Snapshot with this name already exists"):(this.snapshot.name=e,this.dialogRef.close(this.snapshot))}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-create-snapshot-dialog"]],decls:11,vars:1,consts:[["mat-dialog-title",""],["mat-dialog-content",""],[3,"formGroup"],[1,"name-input"],["matInput","","tabindex","1","formControlName","snapshotName","placeholder","Name"],["mat-dialog-actions",""],["mat-button","","mat-dialog-close",""],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Create snapshot"),l(),s(2,"div",1)(3,"form",2)(4,"mat-form-field",3),R(5,"input",4),l()()(),s(6,"div",5)(7,"button",6),d(8,"Cancel"),l(),s(9,"button",7),g("click",function(){return o.onAddClick()}),d(10,"Add"),l()()),t&2&&(m(3),C("formGroup",o.inputForm))},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,_e,pc,Ne,Fe,bt,W,pe,Se,Ee,Me,we,pn],styles:[".name-input[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var Vd=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}onNoClick(){this.dialogRef.close(!1)}onYesClick(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-question-dialog"]],decls:10,vars:2,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["mat-dialog-actions",""],["mat-button","",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1)(3,"p"),d(4),l()(),s(5,"div",2)(6,"button",3),g("click",function(){return o.onNoClick()}),d(7,"No"),l(),s(8,"button",3),g("click",function(){return o.onYesClick()}),d(9,"Yes"),l()()),t&2&&(m(),j(o.data.title),m(3),j(o.data.question))},dependencies:[_e,Ne,Fe,bt,W,pe],encapsulation:2,changeDetection:0})}return n})();var W9=(()=>{class n{transform(e){let t=new Date(+e*1e3),o=t.getHours(),r="0"+t.getMinutes(),a="0"+t.getSeconds(),c=t.getFullYear(),p=t.getMonth()+1,u=t.getDate();return o+":"+r.substr(-2)+":"+a.substr(-2)+" "+u+"/"+p+"/"+c}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"datefilter",type:n,pure:!0})}return n})();function hke(n,i){n&1&&(s(0,"mat-header-cell",23),d(1,"Name"),l())}function fke(n,i){if(n&1&&(s(0,"mat-cell",23),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function gke(n,i){n&1&&(s(0,"mat-header-cell",24),d(1,"Date"),l())}function _ke(n,i){if(n&1&&(s(0,"mat-cell",24),d(1),en(2,"datefilter"),l()),n&2){let e=i.$implicit;m(),j(jn(2,1,e.created_at))}}function vke(n,i){n&1&&(s(0,"mat-header-cell",25),d(1,"Actions"),l())}function Cke(n,i){if(n&1){let e=z();s(0,"mat-cell",25)(1,"div",26)(2,"button",27),g("click",function(){let o=k(e).$implicit,r=v();return T(r.restoreSnapshot(o))}),s(3,"mat-icon"),d(4,"restore"),l()(),s(5,"button",28),g("click",function(){let o=k(e).$implicit,r=v();return T(r.deleteSnapshot(o))}),s(6,"mat-icon"),d(7,"delete"),l()()()()}}function bke(n,i){n&1&&R(0,"mat-header-row")}function xke(n,i){n&1&&R(0,"mat-row")}function yke(n,i){n&1&&(s(0,"div",20),d(1,"No snapshots available"),l())}var q9=(()=>{class n{data;dialogRef=f(Ie);snapshotService=f(bg);progressDialogService=f($2);toaster=f(te);dialog=f(nt);cd=f(Q);controller;project;snapshots=U([]);searchText=U("");displayedColumns=["name","created_at","actions"];constructor(e){this.data=e,this.controller=e.controller,this.project=e.project,this.loadSnapshots()}filteredSnapshots=Jt(()=>{let e=this.searchText().toLowerCase();return e?this.snapshots().filter(t=>t.name.toLowerCase().includes(e)):this.snapshots()});openCreateDialog(){this.dialog.open(U2,{panelClass:["base-dialog-panel","simple-dialog-panel"],data:{controller:this.controller,project:this.project},autoFocus:!1}).afterClosed().subscribe(t=>{if(t){let o=this.progressDialogService.open();this.snapshotService.create(this.controller,this.project.project_id,t).subscribe({next:()=>{o.close(),this.loadSnapshots(),this.toaster.success(`Snapshot '${t.name}' has been created.`)},error:r=>{o.close();let a=r.error?.message||r.message||"Unknown error";this.toaster.error(`Failed to create snapshot: ${a}`),this.cd.markForCheck()}})}})}restoreSnapshot(e){this.dialog.open(Vd,{panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],data:{title:"Restore snapshot",question:`Are you sure you want to restore snapshot "${e.name}"? This will replace your current topology.`}}).afterClosed().subscribe(o=>{if(!o)return;let r=this.progressDialogService.open(),a=this.snapshotService.restore(this.controller,this.project.project_id,e.snapshot_id).subscribe({next:()=>{this.toaster.success(`Snapshot "${e.name}" has been restored.`),r.close(),this.cd.markForCheck()},error:c=>{r.close();let p=c.error?.message||c.message||"Unknown error";this.toaster.error(`Failed to restore snapshot: ${p}`),this.cd.markForCheck()}});r.afterClosed().subscribe(c=>{c===xg.CANCELLED&&a.unsubscribe()})})}deleteSnapshot(e){this.dialog.open(Vd,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{title:"Delete snapshot",question:`Are you sure you want to delete snapshot "${e.name}"?`}}).afterClosed().subscribe(o=>{o&&this.snapshotService.delete(this.controller,this.project.project_id,e.snapshot_id).subscribe({next:()=>{this.loadSnapshots(),this.toaster.success(`Snapshot "${e.name}" has been deleted.`),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Unknown error";this.toaster.error(`Failed to delete snapshot: ${a}`),this.cd.markForCheck()}})})}loadSnapshots(){this.snapshotService.list(this.controller,this.project.project_id).subscribe({next:e=>{this.snapshots.set(e),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Unknown error";this.toaster.error(`Failed to load snapshots: ${t}`),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-snapshot-dialog"]],inputs:{snapshots:[1,"snapshots"],searchText:[1,"searchText"]},outputs:{snapshots:"snapshotsChange",searchText:"searchTextChange"},decls:29,vars:5,consts:[["mat-dialog-title",""],["mat-dialog-content",""],[1,"snapshot-dialog__toolbar"],["appearance","fill",1,"snapshot-dialog__search"],["matPrefix",""],["matInput","","placeholder","Filter snapshots",3,"input","value"],["mat-button","","matTooltip","Create snapshot","matTooltipClass","custom-tooltip",3,"click"],[1,"snapshot-dialog__table-container"],[1,"snapshot-dialog__table",3,"dataSource"],["matColumnDef","name"],["class","snapshot-dialog__column-name",4,"matHeaderCellDef"],["class","snapshot-dialog__column-name",4,"matCellDef"],["matColumnDef","created_at"],["class","snapshot-dialog__column-date",4,"matHeaderCellDef"],["class","snapshot-dialog__column-date",4,"matCellDef"],["matColumnDef","actions"],["class","snapshot-dialog__column-actions",4,"matHeaderCellDef"],["class","snapshot-dialog__column-actions",4,"matCellDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],[1,"snapshot-dialog__empty"],["mat-dialog-actions",""],["mat-button","","mat-dialog-close",""],[1,"snapshot-dialog__column-name"],[1,"snapshot-dialog__column-date"],[1,"snapshot-dialog__column-actions"],[1,"snapshot-dialog__actions"],["mat-icon-button","","matTooltip","Restore snapshot","matTooltipClass","custom-tooltip",3,"click"],["mat-icon-button","","matTooltip","Delete snapshot","matTooltipClass","custom-tooltip",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Snapshots"),l(),s(2,"div",1)(3,"div",2)(4,"mat-form-field",3)(5,"mat-icon",4),d(6,"search"),l(),s(7,"input",5),g("input",function(a){return o.searchText.set(a.target.value)}),l()(),s(8,"button",6),g("click",function(){return o.openCreateDialog()}),s(9,"mat-icon"),d(10,"add_circle_outline"),l(),d(11," Create snapshot "),l()(),s(12,"div",7)(13,"mat-table",8),Le(14,9),xe(15,hke,2,0,"mat-header-cell",10)(16,fke,2,1,"mat-cell",11),Ve(),Le(17,12),xe(18,gke,2,0,"mat-header-cell",13)(19,_ke,3,3,"mat-cell",14),Ve(),Le(20,15),xe(21,vke,2,0,"mat-header-cell",16)(22,Cke,8,0,"mat-cell",17),Ve(),xe(23,bke,1,0,"mat-header-row",18)(24,xke,1,0,"mat-row",19),l(),A(25,yke,2,0,"div",20),l()(),s(26,"div",21)(27,"button",22),d(28,"Close"),l()()),t&2&&(m(7),C("value",o.searchText()),m(6),C("dataSource",o.filteredSnapshots()),m(10),C("matHeaderRowDef",o.displayedColumns),m(),C("matRowDefColumns",o.displayedColumns),m(),O(o.snapshots().length===0?25:-1))},dependencies:[ne,_e,pc,Ne,Fe,bt,W,pe,je,ie,de,wt,It,we,Me,Gs,Se,Ee,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W9],styles:[".snapshot-dialog__toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px}.snapshot-dialog__search[_ngcontent-%COMP%]{flex:1;max-width:300px}.snapshot-dialog__search[_ngcontent-%COMP%] .mat-mdc-form-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant)}.snapshot-dialog__table-container[_ngcontent-%COMP%]{max-height:400px;overflow-y:auto;border-radius:12px;background:var(--mat-sys-surface-container-low)}.snapshot-dialog__table[_ngcontent-%COMP%]{width:100%}.snapshot-dialog__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px}.snapshot-dialog__empty[_ngcontent-%COMP%]{padding:32px;text-align:center;color:var(--mat-sys-on-surface-variant)}mat-header-cell.snapshot-dialog__column-name[_ngcontent-%COMP%], mat-cell.snapshot-dialog__column-name[_ngcontent-%COMP%]{flex:2;min-width:200px}mat-header-cell.snapshot-dialog__column-date[_ngcontent-%COMP%], mat-cell.snapshot-dialog__column-date[_ngcontent-%COMP%]{flex:1;min-width:140px}mat-header-cell.snapshot-dialog__column-actions[_ngcontent-%COMP%], mat-cell.snapshot-dialog__column-actions[_ngcontent-%COMP%]{flex:0 0 100px;min-width:100px;justify-content:flex-end}"],changeDetection:0})}return n})();var G2=(()=>{class n{project=le(void 0);controller=le(void 0);dialog=f(nt);openSnapshotDialog(){let e=this.project(),t=this.controller();!e||!t||this.dialog.open(q9,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:{controller:t,project:e},autoFocus:!1})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-snapshot-menu-item"]],inputs:{project:[1,"project"],controller:[1,"controller"]},decls:3,vars:0,consts:[["matTooltip","Manage snapshots","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"snapshot-button","menu-button",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.openSnapshotDialog()}),s(1,"mat-icon"),d(2,"filter_none"),l()())},dependencies:[ne,_e,wt,It,ie,de,W,je],styles:[".snapshot-button[_ngcontent-%COMP%]{transition:transform .1s ease}.snapshot-button[_ngcontent-%COMP%]:hover{transform:scale(1.3)}"],changeDetection:0})}return n})();var Q9=(()=>{class n{controller=le(void 0);project=le(void 0);drawingDragged;drawingService=f(Ri);drawingsDataSource=f(Ei);drawingsEventSource=f(Uo);toasterService=f(te);cdr=f(Q);ngOnInit(){this.drawingDragged=this.drawingsEventSource.dragged.subscribe(e=>this.onDrawingDragged(e))}onDrawingDragged(e){let t=this.drawingsDataSource.get(e.datum.id);t.x+=e.dx,t.y+=e.dy,this.drawingService.updatePosition(this.controller(),this.project(),t,t.x,t.y).subscribe({next:o=>{this.drawingsDataSource.update(o)},error:o=>{let r=o.error?.message||o.message||"Failed to update drawing position";this.toasterService.error(r),this.cdr.markForCheck()}})}ngOnDestroy(){this.drawingDragged.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-drawing-dragged"]],inputs:{controller:[1,"controller"],project:[1,"project"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var X9=(()=>{class n{controller=le(void 0);drawingResized;drawingService=f(Ri);drawingsDataSource=f(Ei);drawingsEventSource=f(Uo);mapDrawingToSvgConverter=f(vs);toasterService=f(te);cdr=f(Q);ngOnInit(){this.drawingResized=this.drawingsEventSource.resized.subscribe(e=>this.onDrawingResized(e))}onDrawingResized(e){let t=this.drawingsDataSource.get(e.datum.id);if(e.rotation!==void 0){t.rotation=e.rotation;let r=this.mapDrawingToSvgConverter.convert(e.datum);t.svg=r,this.drawingService.update(this.controller(),t).subscribe({next:a=>{this.drawingsDataSource.update(a)},error:a=>{let c=a.error?.message||a.message||"Failed to update drawing rotation";this.toasterService.error(c),this.cdr.markForCheck()}})}else{let r=this.mapDrawingToSvgConverter.convert(e.datum);this.drawingService.updateSizeAndPosition(this.controller(),t,e.x,e.y,r).subscribe({next:a=>{this.drawingsDataSource.update(a)},error:a=>{let c=a.error?.message||a.message||"Failed to update drawing size";this.toasterService.error(c),this.cdr.markForCheck()}})}}ngOnDestroy(){this.drawingResized.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-drawing-resized"]],inputs:{controller:[1,"controller"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var K9=(()=>{class n{controller=le(void 0);interfaceDragged;linkService=f(Fi);linksDataSource=f(zo);linksEventSource=f(Da);toasterService=f(te);cdr=f(Q);ngOnInit(){this.interfaceDragged=this.linksEventSource.interfaceDragged.subscribe(e=>this.onInterfaceLabelDragged(e))}onInterfaceLabelDragged(e){let t=this.linksDataSource.get(e.datum.linkId);t.nodes[0].node_id===e.datum.nodeId&&(t.nodes[0].label.x+=e.dx,t.nodes[0].label.y+=e.dy),t.nodes[1].node_id===e.datum.nodeId&&(t.nodes[1].label.x+=e.dx,t.nodes[1].label.y+=e.dy),this.linkService.updateNodes(this.controller(),t,t.nodes).subscribe({next:o=>{this.linksDataSource.update(o)},error:o=>{let r=o.error?.message||o.message||"Failed to update interface label position";this.toasterService.error(r),this.cdr.markForCheck()}})}ngOnDestroy(){this.interfaceDragged.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-interface-label-dragged"]],inputs:{controller:[1,"controller"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var Y9=(()=>{class n{controller=le(void 0);project;linkCreated;projectService=f(ki);linkService=f(Fi);linksDataSource=f(zo);linksEventSource=f(Da);mapNodeToNode=f(lp);mapPortToPort=f(Gf);toasterService=f(te);cdr=f(Q);ngOnInit(){this.linkCreated=this.linksEventSource.created.subscribe(e=>this.onLinkCreated(e))}onLinkCreated(e){let t=Math.abs(e.sourceNode.x-e.targetNode.x),o=Math.abs(e.sourceNode.y-e.targetNode.y),r=Math.sqrt(Math.pow(t,2)+Math.pow(o,2)),a=o/r,c=45/r*t,p=45/r*o,u=0,h=0,_=0,S=0;e.sourceNode.x<=e.targetNode.x&&e.sourceNode.y<=e.targetNode.y?(u=Math.floor(e.sourceNode.width/2)+Math.round(c)+5,h=Math.floor(e.sourceNode.height/2)+Math.round(p)+5,_=Math.floor(e.targetNode.width/2)-Math.round(c)-5-Math.round(20*a),S=Math.floor(e.targetNode.height/2)-Math.round(p)+5-Math.round(20*a)):e.sourceNode.x>e.targetNode.x&&e.sourceNode.y<e.targetNode.y?(u=Math.floor(e.sourceNode.width/2)-Math.round(c)-5-Math.round(20*a),h=Math.floor(e.sourceNode.height/2)+Math.round(p)+5-Math.round(20*a),_=Math.floor(e.targetNode.width/2)+Math.round(c)+5,S=Math.floor(e.targetNode.height/2)-Math.round(p)-5):e.sourceNode.x<e.targetNode.x&&e.sourceNode.y>e.targetNode.y?(u=Math.floor(e.sourceNode.width/2)+Math.round(c)+5-Math.round(20*a),h=Math.floor(e.sourceNode.height/2)-Math.round(p)-5-Math.round(20*a),_=Math.floor(e.targetNode.width/2)-Math.round(c)-5,S=Math.floor(e.targetNode.height/2)+Math.round(p)+5):e.sourceNode.x>=e.targetNode.x&&e.sourceNode.y>=e.targetNode.y&&(u=Math.floor(e.sourceNode.width/2)-Math.round(c)-5-Math.round(20*a),h=Math.floor(e.sourceNode.height/2)-Math.round(p)+5-Math.round(20*a),_=Math.floor(e.targetNode.width/2)+Math.round(c)+5,S=Math.floor(e.targetNode.height/2)+Math.round(p)+5);let x=this.mapNodeToNode.convert(e.sourceNode),b=this.mapPortToPort.convert(e.sourcePort),M=this.mapNodeToNode.convert(e.targetNode),w=this.mapPortToPort.convert(e.targetPort);this.linkService.createLink(this.controller(),x,b,M,w,u,h,_,S).subscribe({next:()=>{this.projectService.links(this.controller(),this.project.project_id).subscribe(y=>{this.linksDataSource.set(y)})},error:y=>{let E=y.error?.message||y.message||"Failed to create link";this.toasterService.error(E),this.cdr.markForCheck()}})}ngOnDestroy(){this.linkCreated.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-link-created"]],inputs:{controller:[1,"controller"],project:"project"},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var Z9=(()=>{class n{controller=le(void 0);project=le(void 0);nodeDragged;nodesDataSource=f(di);nodeService=f(ut);nodesEventSource=f(Ml);toasterService=f(te);cdr=f(Q);ngOnInit(){this.nodeDragged=this.nodesEventSource.dragged.subscribe(e=>this.onNodeDragged(e))}onNodeDragged(e){let t=this.nodesDataSource.get(e.datum.id);t.x+=e.dx,t.y+=e.dy,this.nodeService.updatePosition(this.controller(),this.project(),t,t.x,t.y).subscribe({next:o=>{this.nodesDataSource.update(o)},error:o=>{let r=o.error?.message||o.message||"Failed to update node position";this.toasterService.error(r),this.cdr.markForCheck()}})}ngOnDestroy(){this.nodeDragged.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-node-dragged"]],inputs:{controller:[1,"controller"],project:[1,"project"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var J9=(()=>{class n{controller=le(void 0);nodeLabelDragged;nodesDataSource=f(di);nodeService=f(ut);nodesEventSource=f(Ml);mapLabelToLabel=f(Jc);toasterService=f(te);cdr=f(Q);ngOnInit(){this.nodeLabelDragged=this.nodesEventSource.labelDragged.subscribe(e=>this.onNodeLabelDragged(e))}onNodeLabelDragged(e){let t=this.nodesDataSource.get(e.datum.nodeId),o=e.datum,r=this.mapLabelToLabel.convert(o);t.label=r,this.nodeService.updateLabel(this.controller(),t,t.label).subscribe({next:a=>{this.nodesDataSource.update(a)},error:a=>{let c=a.error?.message||a.message||"Failed to update node label position";this.toasterService.error(c),this.cdr.markForCheck()}})}ngOnDestroy(){this.nodeLabelDragged.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-node-label-dragged"]],inputs:{controller:[1,"controller"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var ej=(()=>{class n{controller=le(void 0);project;drawingSaved=new ve;textAdded;drawingService=f(Ri);drawingsDataSource=f(Ei);drawingsEventSource=f(Uo);drawingsFactory=f(dg);mapDrawingToSvgConverter=f(vs);context=f(Eo);toasterService=f(te);cdr=f(Q);ngOnInit(){this.textAdded=this.drawingsEventSource.textAdded.subscribe(e=>this.onTextAdded(e))}onTextAdded(e){let t=this.drawingsFactory.getDrawingMock("text");t.element.text=e.savedText;let o=this.mapDrawingToSvgConverter.convert(t);this.drawingService.add(this.controller(),this.project.project_id,e.x,e.y,o).subscribe({next:r=>{this.drawingsDataSource.add(r),this.drawingSaved.emit(!0)},error:r=>{let a=r.error?.message||r.message||"Failed to create text drawing";this.toasterService.error(a),this.cdr.markForCheck()}})}ngOnDestroy(){this.textAdded.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-text-added"]],inputs:{controller:[1,"controller"],project:"project"},outputs:{drawingSaved:"drawingSaved"},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var tj=(()=>{class n{controller=le(void 0);textEdited;drawingService=f(Ri);drawingsDataSource=f(Ei);drawingsEventSource=f(Uo);mapDrawingToSvgConverter=f(vs);toasterService=f(te);cdr=f(Q);ngOnInit(){this.textEdited=this.drawingsEventSource.textEdited.subscribe(e=>this.onTextEdited(e))}onTextEdited(e){let t=new Ea;t.element=e.textElement,t.element.text=e.editedText;let o=this.mapDrawingToSvgConverter.convert(t),r=this.drawingsDataSource.get(e.textDrawingId);this.drawingService.updateText(this.controller(),r,o).subscribe({next:a=>{this.drawingsDataSource.update(a),this.drawingsEventSource.textSaved.emit(!0)},error:a=>{let c=a.error?.message||a.message||"Failed to update text drawing";this.toasterService.error(c),this.cdr.markForCheck()}})}ngOnDestroy(){this.textEdited.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-text-edited"]],inputs:{controller:[1,"controller"]},decls:0,vars:0,template:function(t,o){},encapsulation:2,changeDetection:0})}return n})();var Ske=["topologySummaryContainer"],wke=()=>["/controllers"],Mke=n=>["/controller",n,"projects"],kke=n=>["/controller",n,"image-manager"],Tke=n=>({visible:n}),Eke=n=>({selected:n}),ij=(n,i)=>i.link_id,W2=(n,i)=>i.node_id,nj=(n,i)=>e=>e.id==="console",Dke=(n,i)=>e=>{let t=k(i).$implicit;return T(e.id==="wireshark-"+t.link_id)},Pke=(n,i)=>e=>{let t=k(i).$implicit;return T(e.id==="console-"+t.node_id)};function Ike(n,i){if(n&1){let e=z();s(0,"div",10)(1,"app-template",38),g("nodeCreationChange",function(o){k(e);let r=v();return T(r.onNodeCreation(o))}),l(),s(2,"button",39),g("click",function(){k(e);let o=v();return T(o.toggleDrawLineMode())}),s(3,"mat-icon"),d(4,"timeline"),l()()()}if(n&2){let e=v();m(),C("controller",e.controller)("project",e.project),m(),C("ngClass",dn(4,Eke,e.tools.draw_link))("color",e.tools.draw_link?"primary":"basic")}}function Ake(n,i){if(n&1&&(s(0,"div",23),R(1,"app-snapshot-menu-item",12),l()),n&2){let e=v();m(),C("controller",e.controller)("project",e.project)}}function Oke(n,i){if(n&1&&R(0,"app-draw-link-tool",30),n&2){let e=v();C("links",e.links)}}function Nke(n,i){if(n&1){let e=z();s(0,"app-console-wrapper",40),g("closeConsole",function(o){k(e);let r=v();return T(r.toggleShowConsole(o))})("windowFocused",function(){k(e);let o=v();return T(o.bringConsoleToFront())}),l()}if(n&2){let e=v();C("controller",e.controller)("project",e.project)("zIndex",e.consoleZIndex)}}function Fke(n,i){if(n&1){let e=z();s(0,"app-ai-chat",41),g("closed",function(){k(e);let o=v();return T(o.closeAIChat())})("windowFocused",function(){k(e);let o=v();return T(o.bringAIChatToFront())}),l()}if(n&2){let e=v();C("project",e.project)("controller",e.controller)("zIndex",e.aiChatZIndex)}}function Rke(n,i){if(n&1){let e=z();s(0,"app-web-wireshark-inline",43),g("closeWindow",function(){let o=k(e).$implicit,r=v(2);return T(r.closeWebWiresharkInline(o.link_id))})("windowFocused",function(){let o=k(e).$implicit,r=v(2);return T(r.bringWebWiresharkWindowToFront(o.link_id))}),l()}if(n&2){let e=i.$implicit,t=v(2);C("link",e)("controller",t.controller)("project",t.project)("zIndex",t.getWebWiresharkWindowZIndex(e.link_id))}}function Lke(n,i){if(n&1&&Y(0,Rke,1,4,"app-web-wireshark-inline",42,ij),n&2){let e=v();Z(e.getWebWiresharkInlineWindows())}}function Vke(n,i){if(n&1){let e=z();s(0,"app-web-console-inline",45),g("closeWindow",function(){let o=k(e).$implicit,r=v(2);return T(r.closeWebConsoleInline(o.node_id))})("windowFocused",function(){let o=k(e).$implicit,r=v(2);return T(r.bringWebConsoleWindowToFront(o.node_id))}),l()}if(n&2){let e=i.$implicit,t=v(2);C("node",e)("controller",t.controller)("project",t.project)("zIndex",t.getWebConsoleWindowZIndex(e.node_id))}}function Bke(n,i){if(n&1&&Y(0,Vke,1,4,"app-web-console-inline",44,W2),n&2){let e=v();Z(e.getWebConsoleInlineWindows())}}function zke(n,i){if(n&1){let e=z();s(0,"app-node-file-manager-inline",47),g("closeWindow",function(){let o=k(e).$implicit,r=v(2);return T(r.closeFileManagerInline(o.node_id))})("windowFocused",function(){let o=k(e).$implicit,r=v(2);return T(r.bringFileManagerToFront(o.node_id))}),l()}if(n&2){let e=i.$implicit,t=v(2);C("node",e)("controller",t.controller)("zIndex",t.getFileManagerZIndex(e.node_id))}}function jke(n,i){if(n&1&&Y(0,zke,1,3,"app-node-file-manager-inline",46,W2),n&2){let e=v();Z(e.getFileManagerInlineWindows())}}function $ke(n,i){if(n&1){let e=z();s(0,"div",48),g("click",function(){k(e);let o=v();return T(o.toggleConsoleMinimize())}),s(1,"mat-icon",49),d(2,"terminal"),l(),s(3,"span",50),d(4,"Console"),l()()}if(n&2){let e=v();nn("left",e.getConsoleTaskbarLeft(),"px"),Be("inline-taskbar__icon--minimized",e.windowManagement.minimizedWindows().some(Fg(5,nj,i))),C("title",e.windowManagement.minimizedWindows().some(Fg(6,nj,i))?"Console - Click to restore":"Console - Click to minimize")}}function Hke(n,i){if(n&1){let e=z();s(0,"div",48),g("click",function(){let o=k(e).$implicit,r=v();return T(r.toggleWiresharkMinimize(o.link_id))}),s(1,"mat-icon",49),d(2,"analytics"),l(),s(3,"span",50),d(4),l()()}if(n&2){let e=i.$implicit,t=v();nn("left",t.getWiresharkTaskbarLeft(e.link_id),"px"),Be("inline-taskbar__icon--minimized",t.windowManagement.minimizedWindows().some(Fg(6,Dke,i))),C("title",e.capture_file_name),m(4),j(e.capture_file_name)}}function Uke(n,i){if(n&1){let e=z();s(0,"div",48),g("click",function(){let o=k(e).$implicit,r=v();return T(r.toggleWebConsoleMinimize(o.node_id))}),s(1,"mat-icon",49),d(2,"web"),l(),s(3,"span",50),d(4),l()()}if(n&2){let e=i.$implicit,t=v();nn("left",t.getWebConsoleTaskbarLeft(e.node_id),"px"),Be("inline-taskbar__icon--minimized",t.windowManagement.minimizedWindows().some(Fg(6,Pke,i))),C("title",e.name),m(4),j(e.name)}}function Gke(n,i){if(n&1){let e=z();s(0,"div",48),g("click",function(){let o=k(e).$implicit,r=v();return T(r.toggleFileManagerMinimize(o.node_id))}),s(1,"mat-icon",49),d(2,"folder"),l(),s(3,"span",50),d(4),l()()}if(n&2){let e=i.$implicit,t=v();nn("left",t.getFileManagerTaskbarLeft(e.node_id),"px"),Be("inline-taskbar__icon--minimized",t.isFileManagerMinimized(e.node_id)),C("title","File Manager - "+e.name),m(4),j(e.name)}}function Wke(n,i){}var q2=(()=>{class n{nodes=ae([]);links=[];drawings=[];symbols=[];project={};controller={};projectws;ws;isProjectMapMenuVisible=!1;isConsoleVisible=!0;isTopologySummaryVisible=!0;isInterfaceLabelVisible=!1;notificationsVisibility=!1;layersVisibility=!1;itemLockStatusVisibility=!1;gridVisibility=!1;toolbarVisibility=!0;symbolScaling=!0;isAIChatVisible=!1;webWiresharkInlineWindows=new Map;webWiresharkInlineZIndex=new Map;webConsoleInlineWindows=new Map;webConsoleInlineZIndex=new Map;baseZIndex=1e3;fileManagerInlineWindows=new Map;fileManagerInlineZIndex=new Map;zIndexCounter=0;consoleZIndex=this.baseZIndex;aiChatZIndex=this.baseZIndex;TASKBAR_BASE_LEFT=20;TASKBAR_ICON_WIDTH=180;TASKBAR_ICON_GAP=8;mapBgClass=Jt(()=>{let e=this.themeService.savedMapTheme,t=e==="auto"?this.themeService.isDarkMode():e.startsWith("dark-");return e==="auto"?{[`gns3-map-bg-${this.themeService.isDarkMode()?"dark":"light"}`]:!0,"project-map--light-bg":!t,"project-map--dark-bg":t}:{[`gns3-map-bg-${e}`]:!0,"project-map--light-bg":!t,"project-map--dark-bg":t}});instance;tools={selection:!0,moving:!1,draw_link:!1,text_editing:!0};settings;inReadOnlyMode=!1;contextMenu=Nt(ag);mapChild=Nt(AS);projectMapMenuComponent=Nt.required(pg);topologySummaryContainer=Nt.required("topologySummaryContainer",{read:oo});templateComponent=Nt(Cg);projectMapSubscription=new So;startedNodeIds=new Set;route=f(lt);controllerService=f(Je);projectService=f(ki);nodeService=f(ut);linkService=f(Fi);drawingService=f(Ri);progressService=f(no);projectWebServiceHandler=f(Wf);mapChangeDetectorRef=f(Km);nodeWidget=f(Vf);drawingsWidget=f(Zc);linkWidget=f(Hf);labelWidget=f(ip);interfaceLabelWidget=f(Xc);mapNodeToNode=f(lp);mapDrawingToDrawing=f(NS);mapLabelToLabel=f(Jc);mapLinkToLink=f(VS);mapLinkNodeToLinkNode=f(Uf);nodesDataSource=f(di);linksDataSource=f(zo);drawingsDataSource=f(Ei);settingsService=f($r);toolsService=f(gl);selectionManager=f(Ho);selectionTool=f(tp);recentlyOpenedProjectService=f(qd);movingEventSource=f(sp);mapScaleService=f(zc);nodeCreatedLabelStylesFixer=f(c2);toasterService=f(te);dialog=f(nt);router=f(ht);mapNodesDataSource=f(rf);mapLinksDataSource=f(jc);mapDrawingsDataSource=f(af);mapSymbolsDataSource=f(sf);mapSettingsService=f(go);ethernetLinkWidget=f(jf);serialLinkWidget=f($f);bottomSheet=f(Gl);notificationService=f(Ws);title=f(Hu);nodeConsoleService=f(rr);symbolService=f(ml);themeService=f(ci);cd=f(Q);aiChatStore=f(mg);windowManagement=f(ed);viewContainerRef=f(oo);ngOnInit(){this.getSettings(),this.progressService.activate(),this.controllerService.isServiceInitialized?this.getData():this.projectMapSubscription.add(this.controllerService.serviceInitialized.subscribe(e=>{e&&this.getData()})),this.addSubscriptions(),this.addKeyboardListeners()}getSettings(){this.settings=this.settingsService.getAll(),this.symbolScaling=this.mapSettingsService.getSymbolScaling(),this.cd.markForCheck(),this.isConsoleVisible=this.mapSettingsService.isLogConsoleVisible,this.mapSettingsService.logConsoleSubject.subscribe(e=>this.isConsoleVisible=e),this.notificationsVisibility=localStorage.getItem("notificationsVisibility")==="true",this.layersVisibility=localStorage.getItem("layersVisibility")==="true",this.gridVisibility=localStorage.getItem("gridVisibility")==="true"}async lazyLoadTopologySummary(){if(this.isTopologySummaryVisible){let{TopologySummaryComponent:e}=await import("./chunk-HJ5XTV4X.js");this.instance=this.topologySummaryContainer().createComponent(e),this.instance.instance.controller=this.controller,this.instance.instance.project=this.project,this.instance.changeDetectorRef.detectChanges()}else this.instance&&this.instance.instance&&(this.instance.instance.ngOnDestroy(),this.instance.destroy(),this.instance=null)}addSubscriptions(){this.projectMapSubscription.add(this.drawingsDataSource.changes.subscribe(t=>{this.drawings=t,this.mapChangeDetectorRef.detectChanges()}));let e=new Map;this.projectMapSubscription.add(this.nodesDataSource.changes.subscribe(t=>{if(!this.controller)return;for(let c of t){let p=e.get(c.node_id);p!==void 0&&p!==c.symbol&&(c.symbol_url=null),e.set(c.node_id,c.symbol)}let o=t.filter(c=>!c.symbol_url);if(o.forEach(c=>{c.width==0&&c.height==0&&this.symbolService.getDimensions(this.controller,c.symbol).subscribe({next:p=>{c.width=p.width,c.height=p.height},error:p=>{console.error("Failed to get symbol dimensions:",p)}})}),o.length===0){this.nodes.set(t),this.mapSettingsService.getSymbolScaling()&&this.applyScalingOfNodeSymbols(),this.mapChangeDetectorRef.detectChanges();return}let r=new Map;o.forEach(c=>{r.set(c,`/symbols/${c.symbol}/raw`)});let a=Array.from(new Set(r.values()));qi(a.map(c=>this.symbolService.getSymbolBlobUrl(this.controller,c))).subscribe(c=>{let p=new Map(a.map((u,h)=>[u,c[h]]));o.forEach(u=>{u.symbol_url=p.get(r.get(u))}),this.nodes.set(t),this.mapSettingsService.getSymbolScaling()&&this.applyScalingOfNodeSymbols(),this.mapChangeDetectorRef.detectChanges()},()=>{o.forEach(c=>{c.symbol_url=`${this.controller.protocol}//${this.controller.host}:${this.controller.port}/${wi.current_version}${r.get(c)}`}),this.nodes.set(t),this.mapSettingsService.getSymbolScaling()&&this.applyScalingOfNodeSymbols(),this.mapChangeDetectorRef.detectChanges()})})),this.projectMapSubscription.add(this.linksDataSource.changes.subscribe(t=>{this.links=t,this.mapChangeDetectorRef.detectChanges()})),this.projectMapSubscription.add(this.projectWebServiceHandler.errorNotificationEmitter.subscribe(t=>{this.showMessage({type:"error",message:t})})),this.projectMapSubscription.add(this.projectWebServiceHandler.warningNotificationEmitter.subscribe(t=>{this.showMessage({type:"warning",message:t})})),this.projectMapSubscription.add(this.mapSettingsService.symbolScalingSubject.subscribe(t=>{t&&this.applyScalingOfNodeSymbols()})),this.projectMapSubscription.add(this.projectWebServiceHandler.nodeNotificationEmitter.subscribe(t=>{if(t.action!=="node.updated")return;let o=t.event,r=this.startedNodeIds.has(o.node_id);o.status==="started"?this.startedNodeIds.add(o.node_id):this.startedNodeIds.delete(o.node_id),!(r||o.status!=="started"||!o.console_auto_start||o.console_type==="none")&&(o.console_type==="vnc"?setTimeout(()=>this.onOpenWebConsoleInline({node:o,controller:this.controller,project:this.project}),500):(this.mapSettingsService.logConsoleSubject.next(!0),setTimeout(()=>this.nodeConsoleService.openConsoleForNode(o),500)))}))}applyScalingOfNodeSymbols(){this.nodesDataSource.getItems().forEach(e=>{if(e.height>this.symbolService.getMaximumSymbolSize()){let t=this.symbolService.scaleDimensionsForNode(e);e.width=t.width,e.height=t.height}})}getData(){let e=this.route.paramMap.subscribe(t=>{let o=parseInt(t.get("controller_id"),10),r=t.get("project_id");if(!r){this.router.navigate(["/controllers"]);return}Vu(this.controllerService.get(o)).pipe(ic(a=>(a||this.router.navigate(["/controllers"]),this.controller=a,this.cd.markForCheck(),this.projectService.get(a,r).pipe(Lt(c=>c)))),ic(a=>{if(this.project=a,this.cd.markForCheck(),!a||!a.project_id)return this.router.navigate(["/controllers"]),new Dr(p=>p.complete());this.projectService.open(this.controller,this.project.project_id),this.title.setTitle(this.project.name),this.isInterfaceLabelVisible=this.project.show_interface_labels??this.mapSettingsService.showInterfaceLabels??!0,this.layersVisibility=this.project.show_layers??localStorage.getItem("layersVisibility")==="true",this.gridVisibility=this.project.show_grid??localStorage.getItem("gridVisibility")==="true",this.toggleShowTopologySummary(this.mapSettingsService.isTopologySummaryVisible);let c=`itemLockStatusVisibility_${this.project.project_id}`;return this.itemLockStatusVisibility=localStorage.getItem(c)==="true",this.mapSettingsService.toggleItemLockStatus(this.itemLockStatusVisibility),this.recentlyOpenedProjectService.setcontrollerId(this.controller.id.toString()),this.project.status==="opened"?new Dr(p=>{p.next(this.project)}):this.projectService.open(this.controller,this.project.project_id)})).subscribe(a=>{a&&a.project_id&&this.onProjectLoad(a),this.cd.markForCheck(),this.mapSettingsService.openReadme&&this.showReadme()},a=>{this.progressService.setError(a);let c=a?.message||a?.originalError?.message||"Failed to load project";a?.originalError?.status===404?this.router.navigate(["/controller",o,"projects"],{queryParams:{error:c}}):this.toasterService.error(c),this.cd.markForCheck()},()=>{this.progressService.deactivate(),this.cd.markForCheck()})});this.projectMapSubscription.add(e)}addKeyboardListeners(){Bd.bind("ctrl++",e=>{e.preventDefault(),this.zoomIn()}),Bd.bind("ctrl+-",e=>{e.preventDefault(),this.zoomOut()}),Bd.bind("ctrl+0",e=>{e.preventDefault(),this.resetZoom()}),Bd.bind("ctrl+a",e=>{e.preventDefault();let t=this.mapNodesDataSource.getItems(),o=this.mapDrawingsDataSource.getItems(),r=this.mapLinksDataSource.getItems(),a=this.mapSymbolsDataSource.getItems();this.selectionManager.setSelected(t.concat(o).concat(r).concat(a))}),Bd.bind("ctrl+h",e=>{e.preventDefault(),this.toolbarVisibility=!this.toolbarVisibility}),Bd.bind("ctrl+shift+a",e=>{e.preventDefault(),this.selectionManager.setSelected([])}),Bd.bind("ctrl+shift+s",e=>{e.preventDefault(),this.router.navigate(["/controller",this.controller.id,"preferences"])}),Bd.bind("del",e=>{e.preventDefault(),this.deleteItems()})}deleteItems(){let t=this.bottomSheet.open(Wa,{data:{message:"Do you want to delete all selected objects?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(o=>{if(o){let r=this.selectionManager.getSelected();r.filter(a=>a instanceof _l).forEach(a=>{let c=this.mapNodeToNode.convert(a);this.nodeService.delete(this.controller,c).subscribe({next:()=>this.toasterService.success("Node has been deleted"),error:p=>{let u=p.error?.message||p.message||"Failed to delete node";this.toasterService.error(u),this.cd.markForCheck()}})}),r.filter(a=>a instanceof Cu).forEach(a=>{let c=this.mapLinkToLink.convert(a);this.linkService.deleteLink(this.controller,c).subscribe({next:()=>this.toasterService.success("Link has been deleted"),error:p=>{let u=p.error?.message||p.message||"Failed to delete link";this.toasterService.error(u),this.cd.markForCheck()}})}),r.filter(a=>a instanceof Ea).forEach(a=>{let c=this.mapDrawingToDrawing.convert(a);this.drawingService.delete(this.controller,c).subscribe({next:()=>this.toasterService.success("Drawing has been deleted"),error:p=>{let u=p.error?.message||p.message||"Failed to delete drawing";this.toasterService.error(u),this.cd.markForCheck()}})})}})}onProjectLoad(e){if(!e||!e.project_id){this.progressService.setError("Invalid project data"),this.router.navigate(["/controllers"]);return}this.readonly=this.projectService.isReadOnly(e),this.recentlyOpenedProjectService.setProjectId(this.project.project_id);let t=this.projectService.nodes(this.controller,e.project_id).pipe(ic(o=>(this.nodesDataSource.set(o),o.filter(r=>r.status==="started").forEach(r=>this.startedNodeIds.add(r.node_id)),this.projectService.links(this.controller,e.project_id))),ic(o=>(this.linksDataSource.set(o),this.projectService.drawings(this.controller,e.project_id)))).subscribe({next:o=>{this.drawingsDataSource.set(o),this.setUpMapCallbacks(),this.setUpProjectWS(e),this.progressService.deactivate()},error:o=>{this.toasterService.error("Failed to load project data: "+(o.error?.message||o.message||"Unknown error")),this.progressService.deactivate(),this.cd.markForCheck()}});this.projectMapSubscription.add(t)}setUpProjectWS(e){this.projectws=new WebSocket(this.notificationService.projectNotificationsPath(this.controller,e.project_id)),this.projectws.onmessage=t=>{this.projectWebServiceHandler.handleMessage(JSON.parse(t.data))},this.projectws.onerror=t=>{this.toasterService.error(`Connection to host lost. Error: ${t.data}`)}}setUpWS(){this.ws=new WebSocket(this.notificationService.notificationsPath(this.controller))}setUpMapCallbacks(){this.mapChild()&&this.mapChild().gridVisibility.set(this.gridVisibility?1:0),this.readonly||this.toolsService.selectionToolActivation(!0);let e=this.linkWidget.onContextMenu.subscribe(h=>{let _=this.mapLinkToLink.convert(h.link);this.contextMenu().openMenuForListOfElements([],[],[],[_],h.event.clientY,h.event.clientX)}),t=this.ethernetLinkWidget.onContextMenu.subscribe(h=>{let _=this.mapLinkToLink.convert(h.link);this.contextMenu().openMenuForListOfElements([],[],[],[_],h.event.clientY,h.event.clientX)}),o=this.serialLinkWidget.onContextMenu.subscribe(h=>{let _=this.mapLinkToLink.convert(h.link);this.contextMenu().openMenuForListOfElements([],[],[],[_],h.event.clientY,h.event.clientX)}),r=this.nodeWidget.onContextMenu.subscribe(h=>{let _=this.mapNodeToNode.convert(h.node);this.contextMenu().openMenuForNode(_,h.event.clientY,h.event.clientX)}),a=this.drawingsWidget.onContextMenu.subscribe(h=>{let _=this.mapDrawingToDrawing.convert(h.drawing);this.contextMenu().openMenuForDrawing(_,h.event.clientY,h.event.clientX)}),c=this.labelWidget.onContextMenu.subscribe(h=>{let _=this.mapLabelToLabel.convert(h.label),S=this.nodes().find(x=>x.node_id===h.label.nodeId);this.contextMenu().openMenuForLabel(_,S,h.event.clientY,h.event.clientX)}),p=this.interfaceLabelWidget.onContextMenu.subscribe(h=>{let _=this.mapLinkNodeToLinkNode.convert(h.interfaceLabel),S=this.links.find(x=>x.link_id===h.interfaceLabel.linkId);this.contextMenu().openMenuForInterfaceLabel(_,S,h.event.clientY,h.event.clientX)}),u=this.selectionTool.contextMenuOpened.subscribe(h=>{let _=this.selectionManager.getSelected();if(_.length<2||!(h instanceof MouseEvent))return;let S=[],x=[],b=[],M=[];_.forEach(w=>{w instanceof Ea?S.push(this.mapDrawingToDrawing.convert(w)):w instanceof _l?x.push(this.mapNodeToNode.convert(w)):w instanceof Wl?b.push(this.mapLabelToLabel.convert(w)):w instanceof Cu&&M.push(this.mapLinkToLink.convert(w))}),this.contextMenu().openMenuForListOfElements(S,x,b,M,h.clientY,h.clientX)});this.projectMapSubscription.add(e),this.projectMapSubscription.add(t),this.projectMapSubscription.add(o),this.projectMapSubscription.add(r),this.projectMapSubscription.add(a),this.projectMapSubscription.add(u),this.projectMapSubscription.add(c),this.projectMapSubscription.add(p),this.mapChangeDetectorRef.detectChanges()}onNodeCreation(e){if(!e)return;let t=e.creationId;this.nodeService.createFromTemplate(this.controller,this.project,e.template,e.x,e.y,e.controller).subscribe(o=>{t&&this.templateComponent()&&this.templateComponent().onNodeCreated(t,!0),this.toasterService.success(`Node "${o.name}" created successfully`),this.projectService.nodes(this.controller,this.project.project_id).subscribe({next:r=>{r.filter(a=>a.label.style===null).forEach(a=>{let c=this.nodeCreatedLabelStylesFixer.fix(a);this.nodeService.updateLabel(this.controller,a,c.label).subscribe({next:()=>{},error:p=>{console.error("Failed to update node label:",p)}})}),this.nodesDataSource.set(r),e.numberOfNodes--,e.numberOfNodes>0&&(e.x=e.x+50<this.project.scene_width/2?e.x+50:e.x,e.y=e.y+50<this.project.scene_height/2?e.y+50:e.y,this.onNodeCreation(e))},error:r=>{this.toasterService.error("Failed to load nodes: "+(r.error?.message||r.message||"Unknown error")),this.cd.markForCheck()}})},o=>{if(t&&this.templateComponent()){let r=o.error?.message||o.message||"Unknown error";this.templateComponent().onNodeCreated(t,!1,r)}this.toasterService.error(o.error?.message||o.message||"Failed to create node from template")})}centerView(){if(this.project){let e=this.mapChild()?.context,t=document.documentElement.clientWidth,o=document.documentElement.clientHeight,r=e?e.centerX!==null?e.centerX:e.size.width/2:this.project.scene_width/2,a=e?e.centerY!==null?e.centerY:e.size.height/2:this.project.scene_height/2,c=Math.max(0,r-t/2),p=Math.max(0,a-o/2);window.scrollTo(c,p)}else this.toasterService.error("Please wait until all components are loaded.")}onDrawingSaved(){this.projectMapMenuComponent().resetDrawToolChoice()}set readonly(e){this.inReadOnlyMode=e,e?(this.tools.selection=!1,this.toolsService.selectionToolActivation(!1)):(this.tools.selection=!0,this.toolsService.selectionToolActivation(!0))}get readonly(){return this.inReadOnlyMode}toggleSymbolScaling(e){this.symbolScaling=e,this.mapSettingsService.setSymbolScaling(e)}toggleMovingMode(){this.tools.moving=!this.tools.moving,this.movingEventSource.movingModeState.emit(this.tools.moving),this.readonly||(this.tools.selection=!this.tools.moving,this.toolsService.selectionToolActivation(this.tools.selection))}toggleDrawLineMode(){this.tools.draw_link=!this.tools.draw_link,this.toolsService.drawLinkToolActivation(this.tools.draw_link)}toggleShowInterfaceLabels(e){let t=this.project.show_interface_labels;this.project.show_interface_labels=e,this.isInterfaceLabelVisible=e,this.mapSettingsService.toggleShowInterfaceLabels(this.isInterfaceLabelVisible),this.mapSettingsService.mapRenderedEmitter.emit(!0),this.projectService.update(this.controller,this.project).subscribe(o=>{this.project.show_interface_labels=o.show_interface_labels,this.isInterfaceLabelVisible=o.show_interface_labels,this.cd.markForCheck()},()=>{this.project.show_interface_labels=t,this.isInterfaceLabelVisible=t,this.mapSettingsService.toggleShowInterfaceLabels(this.isInterfaceLabelVisible),this.mapSettingsService.mapRenderedEmitter.emit(!0),this.toasterService.error("Cannot update project settings")})}toggleShowConsole(e){this.isConsoleVisible=e,this.mapSettingsService.toggleLogConsole(this.isConsoleVisible)}onAIChatOpened(){let e=this.aiChatStore.getPanelStateValue();this.aiChatStore.openPanel(),this.isAIChatVisible&&e.isMinimized&&this.aiChatStore.restorePanel(),this.isAIChatVisible=!0}onLeaveProject(){this.closeAIChat(),this.aiChatStore.setPanelState({isOpen:!1,isMinimized:!1,isMaximized:!1})}closeAIChat(){this.isAIChatVisible=!1}openWebWiresharkInline(e){if(this.webWiresharkInlineWindows.has(e.link.link_id)){this.bringWebWiresharkWindowToFront(e.link.link_id),this.toasterService.warning("Web Wireshark is already open for this link");return}this.zIndexCounter++;let t=this.baseZIndex+this.zIndexCounter;this.webWiresharkInlineWindows.set(e.link.link_id,e.link),this.webWiresharkInlineZIndex.set(e.link.link_id,t),this.cd.markForCheck()}closeWebWiresharkInline(e){this.webWiresharkInlineWindows.delete(e),this.webWiresharkInlineZIndex.delete(e),this.cd.markForCheck()}bringWebWiresharkWindowToFront(e){if(!this.webWiresharkInlineWindows.has(e))return;this.zIndexCounter++;let t=this.baseZIndex+this.zIndexCounter;this.webWiresharkInlineZIndex.set(e,t),this.cd.markForCheck()}getWebWiresharkWindowZIndex(e){return this.webWiresharkInlineZIndex.get(e)||this.baseZIndex}getWebWiresharkInlineWindows(){return Array.from(this.webWiresharkInlineWindows.values())}onOpenWebConsoleInline(e){if(this.webConsoleInlineWindows.has(e.node.node_id)){this.bringWebConsoleWindowToFront(e.node.node_id),this.toasterService.warning("Web Console is already open for this node");return}this.zIndexCounter++;let t=this.baseZIndex+this.zIndexCounter;this.webConsoleInlineWindows.set(e.node.node_id,e.node),this.webConsoleInlineZIndex.set(e.node.node_id,t),this.cd.markForCheck()}closeWebConsoleInline(e){this.webConsoleInlineWindows.delete(e),this.webConsoleInlineZIndex.delete(e),this.cd.markForCheck()}bringWebConsoleWindowToFront(e){if(!this.webConsoleInlineWindows.has(e))return;this.zIndexCounter++;let t=this.baseZIndex+this.zIndexCounter;this.webConsoleInlineZIndex.set(e,t),this.cd.markForCheck()}getWebConsoleWindowZIndex(e){return this.webConsoleInlineZIndex.get(e)||this.baseZIndex}getWebConsoleInlineWindows(){return Array.from(this.webConsoleInlineWindows.values())}bringConsoleToFront(){this.zIndexCounter++,this.consoleZIndex=this.baseZIndex+this.zIndexCounter,this.cd.markForCheck()}bringAIChatToFront(){this.zIndexCounter++,this.aiChatZIndex=this.baseZIndex+this.zIndexCounter,this.cd.markForCheck()}restoreConsole(){this.windowManagement.restoreWindow("console"),this.cd.markForCheck()}restoreWiresharkWindow(e){this.windowManagement.restoreWindow(`wireshark-${e}`),this.cd.markForCheck()}getConsoleTaskbarLeft(){return this.TASKBAR_BASE_LEFT}getWiresharkTaskbarLeft(e){if(!e)return this.TASKBAR_BASE_LEFT;let o=this.getWebWiresharkInlineWindows().findIndex(a=>a.link_id===e),r=this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP;return this.TASKBAR_BASE_LEFT+r+o*(this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP)}getFileManagerTaskbarLeft(e){let t=Array.from(this.fileManagerInlineWindows.keys()).indexOf(e),o=this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP,r=this.webWiresharkInlineWindows.size,a=this.webConsoleInlineWindows.size,c=this.fileManagerInlineWindows.size,p=this.TASKBAR_BASE_LEFT;return this.isConsoleVisible&&(p+=o),p+=r*o,p+=a*o,p+t*o}getWebConsoleTaskbarLeft(e){if(!e)return this.TASKBAR_BASE_LEFT;let o=this.getWebConsoleInlineWindows().findIndex(c=>c.node_id===e),r=this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP,a=this.webWiresharkInlineWindows.size;return r+=a*(this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP),this.TASKBAR_BASE_LEFT+r+o*(this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP)}toggleWebConsoleMinimize(e){let t=`console-${e}`;this.windowManagement.minimizedWindows().some(r=>r.id===t)?this.windowManagement.restoreWindow(t):this.windowManagement.minimizeWindow(t,"console",e),this.cd.markForCheck()}toggleConsoleMinimize(){this.windowManagement.minimizedWindows().some(t=>t.id==="console")?this.windowManagement.restoreWindow("console"):this.windowManagement.minimizeWindow("console","console"),this.cd.markForCheck()}toggleWiresharkMinimize(e){let t=`wireshark-${e}`;this.windowManagement.minimizedWindows().some(r=>r.id===t)?this.windowManagement.restoreWindow(t):this.windowManagement.minimizeWindow(t,"wireshark",e),this.cd.markForCheck()}toggleShowTopologySummary(e){this.isTopologySummaryVisible=e,this.mapSettingsService.toggleTopologySummary(this.isTopologySummaryVisible),this.lazyLoadTopologySummary(),this.cd.markForCheck()}toggleNotifications(e){this.notificationsVisibility=e,this.notificationsVisibility?localStorage.setItem("notificationsVisibility","true"):localStorage.removeItem("notificationsVisibility")}toggleLayers(e){let t=this.project.show_layers;this.project.show_layers=e,this.layersVisibility=e,this.mapSettingsService.toggleLayers(e),e?localStorage.setItem("layersVisibility","true"):localStorage.removeItem("layersVisibility"),this.mapChild().applyMapSettingsChanges(),this.projectService.update(this.controller,this.project).subscribe(o=>{this.project.show_layers=o.show_layers,this.layersVisibility=o.show_layers,this.cd.markForCheck()},()=>{this.project.show_layers=t,this.layersVisibility=t,this.mapSettingsService.toggleLayers(this.layersVisibility),this.mapChild().applyMapSettingsChanges(),this.toasterService.error("Cannot update project settings")})}toggleItemLockStatus(e){this.itemLockStatusVisibility=e,this.mapSettingsService.toggleItemLockStatus(e);let t=this.project?.project_id;if(t!=null){let o=`itemLockStatusVisibility_${t}`;e?localStorage.setItem(o,"true"):localStorage.removeItem(o)}this.mapChild()?.applyMapSettingsChanges()}toggleGrid(e){let t=this.project.show_grid;this.project.show_grid=e,this.gridVisibility=e,e?localStorage.setItem("gridVisibility","true"):localStorage.removeItem("gridVisibility"),this.mapChild().gridVisibility.set(e?1:0),this.mapChild().applyMapSettingsChanges(),this.projectService.update(this.controller,this.project).subscribe(o=>{this.project.show_grid=o.show_grid,this.gridVisibility=o.show_grid,this.cd.markForCheck()},()=>{this.project.show_grid=t,this.gridVisibility=t,this.mapChild().gridVisibility.set(t?1:0),this.mapChild().applyMapSettingsChanges(),this.toasterService.error("Cannot update project settings")})}toggleSnapToGrid(e){let t=this.project.snap_to_grid;this.project.snap_to_grid=e,this.projectService.update(this.controller,this.project).subscribe(o=>{this.project.snap_to_grid=o.snap_to_grid},()=>{this.project.snap_to_grid=t,this.toasterService.error("Cannot update project settings")})}showMessage(e){this.notificationsVisibility&&(e.type==="error"&&this.toasterService.error(e.message),e.type==="warning"&&this.toasterService.warning(e.message))}hideMenu(){this.projectMapMenuComponent().resetDrawToolChoice(),this.isProjectMapMenuVisible=!1}showMenu(){this.isProjectMapMenuVisible=!0}zoomIn(){this.mapScaleService.setScale(this.mapScaleService.getScale()+.1)}zoomOut(){let e=this.mapScaleService.getScale();e-.1>0&&this.mapScaleService.setScale(e-.1)}resetZoom(){this.mapScaleService.resetToDefault()}addNewProject(){let t=this.dialog.open(qf,{width:"400px",autoFocus:!1,disableClose:!0}).componentInstance;t.controller=this.controller}saveProject(){let t=this.dialog.open(KS,{width:"400px",autoFocus:!1,disableClose:!0}).componentInstance;t.controller=this.controller,t.project=this.project}editProject(){let e=this.dialog.open(Kf,{autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","configurator-dialog-panel","edit-project-dialog-panel"]}),t=e.componentInstance;t.controller=this.controller,t.project=this.project,e.afterClosed().subscribe(o=>{o&&(this.project=o,this.cd.markForCheck())})}importProject(){let e="",t=this.dialog.open(Yf,{width:"400px",autoFocus:!1,disableClose:!0}),o=t.componentInstance;o.controller=this.controller;let r=t.componentInstance.onImportProject.subscribe(a=>{e=a});t.afterClosed().subscribe(a=>{if(r.unsubscribe(),e&&!a){this.bottomSheet.open(Zf);let c=this.bottomSheet._openedBottomSheetRef;c.instance.projectMessage="imported project";let p=c.afterDismissed().subscribe(u=>{u&&this.projectService.open(this.controller,e).subscribe({next:()=>{this.router.navigate(["/controller",this.controller.id,"project",e])},error:h=>{let _=h.error?.message||h.message||"Failed to open project";this.toasterService.error(_),this.cd.markForCheck()}})})}})}exportProject(){this.nodes().filter(e=>e.node_type==="virtualbox").length>0?this.toasterService.error("Map with VirtualBox machines cannot be exported."):this.nodes().filter(e=>e.status==="started"&&e.node_type==="vpcs"||e.status==="started"&&e.node_type==="virtualbox"||e.status==="started"&&e.node_type==="vmware").length>0?this.toasterService.error("Project with running nodes cannot be exported."):this.exportPortableProjectDialog()}exportPortableProjectDialog(){this.dialog.open(tf,{panelClass:["base-dialog-panel","simple-dialog-panel"],autoFocus:!1,disableClose:!0,data:{controllerDetails:this.controller,projectDetails:this.project}}).afterClosed().subscribe(t=>{})}uploadImageFile(e){this.readImageFile(e.target)}readImageFile(e){let t=e.files[0],o=new FileReader,r=new Image;o.onloadend=()=>{let a=o.result,c=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
height="${r.height}" width="${r.width}">
<image height="${r.height}" width="${r.width}"
xlink:href="${a}"/>
</svg>`;this.drawingService.add(this.controller,this.project.project_id,-(r.width/2),-(r.height/2),c).subscribe({next:()=>{},error:p=>{let u=p.error?.message||p.message||"Failed to add image";this.toasterService.error(u),this.cd.markForCheck()}})},r.onload=()=>{o.readAsDataURL(t)},r.src=window.URL.createObjectURL(t)}closeProject(){let t=this.bottomSheet.open(Wa,{data:{message:"Do you want to close the project?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(o=>{o&&this.projectService.close(this.controller,this.project.project_id).subscribe({next:()=>{this.router.navigate(["/controller",this.controller.id,"projects"])},error:r=>{let a=r.error?.message||r.message||"Failed to close project";this.toasterService.error(a),this.cd.markForCheck()}})})}deleteProject(){let t=this.bottomSheet.open(Wa,{data:{message:"Do you want to delete the project?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(o=>{o&&this.projectService.delete(this.controller,this.project.project_id).subscribe({next:()=>{this.router.navigate(["/controller",this.controller.id,"projects"])},error:r=>{let a=r.error?.message||r.message||"Failed to delete project";this.toasterService.error(a),this.cd.markForCheck()}})})}addNewTemplate(){let t=this.dialog.open(cg,{width:"800px",maxHeight:"800px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","configurator-dialog-panel","new-template-dialog-panel"]}).componentInstance;t.controller=this.controller,t.project=this.project}showReadme(){let t=this.dialog.open(C2,{width:"600px",height:"650px",autoFocus:!1,disableClose:!0}).componentInstance;t.controller=this.controller,t.project=this.project}ngOnDestroy(){this.onLeaveProject(),this.nodeConsoleService.openConsoles=0,this.title.setTitle("GNS3 Web UI"),this.drawingsDataSource.clear(),this.nodesDataSource.clear(),this.linksDataSource.clear(),this.projectws&&this.projectws.OPEN&&this.projectws.close(),this.ws&&this.ws.OPEN&&this.ws.close(),this.projectMapSubscription.unsubscribe(),this.startedNodeIds.clear()}onOpenFileManagerInline(e){if(this.fileManagerInlineWindows.has(e.node.node_id)){this.bringFileManagerToFront(e.node.node_id);return}this.zIndexCounter++,this.fileManagerInlineWindows.set(e.node.node_id,e.node),this.fileManagerInlineZIndex.set(e.node.node_id,this.baseZIndex+this.zIndexCounter),this.cd.markForCheck()}closeFileManagerInline(e){this.fileManagerInlineWindows.delete(e),this.fileManagerInlineZIndex.delete(e),this.cd.markForCheck()}bringFileManagerToFront(e){this.fileManagerInlineWindows.has(e)&&(this.zIndexCounter++,this.fileManagerInlineZIndex.set(e,this.baseZIndex+this.zIndexCounter),this.cd.markForCheck())}getFileManagerZIndex(e){return this.fileManagerInlineZIndex.get(e)||this.baseZIndex}getFileManagerInlineWindows(){return Array.from(this.fileManagerInlineWindows.values())}isFileManagerMinimized(e){return this.windowManagement.minimizedWindows().some(t=>t.id==="filemgr-"+e)}toggleFileManagerMinimize(e){let t=`filemgr-${e}`;this.windowManagement.minimizedWindows().some(o=>o.id===t)?this.windowManagement.restoreWindow(t):this.windowManagement.minimizeWindow(t,"filemgr"),this.cd.markForCheck()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-project-map"]],viewQuery:function(t,o){t&1&&Xt(o.contextMenu,ag,5)(o.mapChild,AS,5)(o.projectMapMenuComponent,pg,5)(o.topologySummaryContainer,Ske,5,oo)(o.templateComponent,Cg,5),t&2&&Kt(5)},decls:172,vars:78,consts:[["projectMap",""],["mainMenu","matMenu"],["projectMenu","matMenu"],["viewMenu","matMenu"],["topologySummaryContainer",""],[1,"project-map",3,"ngClass"],["id","project-titlebar"],["matTooltip","Open menu","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"gns3-button","menu-button",3,"matMenuTriggerFor"],["svgIcon","gns3"],[1,"project-titlebar-controls"],[1,"menu-button-group","primary-controls"],[1,"menu-button-group"],[3,"controller","project"],[3,"openWebWiresharkInline","openWebConsoleInline","openFileManagerInline","project","controller"],["matTooltip","Toggle topology/controllers summary","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",3,"click"],[3,"overlapTrigger"],["mat-menu-item","",3,"routerLink"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"matMenuTriggerFor"],[1,"options-item"],[3,"change","checked"],[3,"controller","project","symbols","nodes","links","drawings","width","height","show-interface-labels","readonly"],["id","project-toolbar"],[1,"section"],["matTooltip","Selection mode","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"selection-button","menu-button",3,"click","color"],["matTooltip","Pan workspace","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"pan-button","menu-button",3,"click","color"],["matTooltip","Zoom in","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"zoom-button",3,"click"],["matTooltip","Reset zoom","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"reset-zoom-button",3,"click"],["matTooltip","Zoom out","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"zoom-button",3,"click"],[3,"aiChatOpened","controller","project"],[3,"links"],[3,"controller"],[3,"drawingSaved","controller","project"],[3,"ngClass"],[3,"controller","project","zIndex"],[3,"project","controller","zIndex"],[1,"inline-taskbar"],[1,"inline-taskbar__icon",3,"inline-taskbar__icon--minimized","left","title"],[3,"nodeCreationChange","controller","project"],["matTooltip","Add a link","matTooltipClass","custom-tooltip","matTooltipPosition","below","mat-icon-button","",1,"menu-button",3,"click","ngClass","color"],[3,"closeConsole","windowFocused","controller","project","zIndex"],[3,"closed","windowFocused","project","controller","zIndex"],[3,"link","controller","project","zIndex"],[3,"closeWindow","windowFocused","link","controller","project","zIndex"],[3,"node","controller","project","zIndex"],[3,"closeWindow","windowFocused","node","controller","project","zIndex"],[3,"node","controller","zIndex"],[3,"closeWindow","windowFocused","node","controller","zIndex"],[1,"inline-taskbar__icon",3,"click","title"],[1,"inline-taskbar__icon-type"],[1,"inline-taskbar__label"]],template:function(t,o){if(t&1&&(s(0,"div",5,0)(2,"div",6)(3,"button",7),R(4,"mat-icon",8),l(),s(5,"div",9),A(6,Ike,5,6,"div",10),s(7,"div",11),R(8,"app-nodes-menu",12),s(9,"app-context-menu",13),g("openWebWiresharkInline",function(a){return o.openWebWiresharkInline(a)})("openWebConsoleInline",function(a){return o.onOpenWebConsoleInline(a)})("openFileManagerInline",function(a){return o.onOpenFileManagerInline(a)}),l()()(),s(10,"div")(11,"button",14),g("click",function(){return o.toggleShowTopologySummary(!o.isTopologySummaryVisible)}),s(12,"mat-icon"),d(13,"toc"),l()()(),s(14,"mat-menu",15,1)(16,"button",16)(17,"mat-icon"),d(18,"developer_board"),l(),s(19,"span"),d(20,"Controllers"),l()(),s(21,"button",16)(22,"mat-icon"),d(23,"work"),l(),s(24,"span"),d(25,"Projects"),l()(),s(26,"button",16)(27,"mat-icon"),d(28,"dns"),l(),s(29,"span"),d(30,"Computes"),l()(),s(31,"button",16)(32,"mat-icon"),d(33,"settings_applications"),l(),s(34,"span"),d(35,"Template preferences"),l()(),s(36,"button",16)(37,"mat-icon"),d(38,"collections"),l(),s(39,"span"),d(40,"Image manager"),l()(),s(41,"button",17),g("click",function(){return o.addNewTemplate()}),s(42,"mat-icon"),d(43,"control_point"),l(),s(44,"span"),d(45,"New template"),l()(),R(46,"app-import-appliance",12),s(47,"button",18)(48,"mat-icon"),d(49,"settings"),l(),s(50,"span"),d(51,"Project settings"),l()(),s(52,"button",18)(53,"mat-icon"),d(54,"view_module"),l(),s(55,"span"),d(56,"Map settings"),l()()(),s(57,"mat-menu",15,2)(59,"div")(60,"button",17),g("click",function(){return o.addNewProject()}),s(61,"mat-icon"),d(62,"add"),l(),s(63,"span"),d(64,"Add new blank project"),l()(),s(65,"button",17),g("click",function(){return o.saveProject()}),s(66,"mat-icon"),d(67,"save"),l(),s(68,"span"),d(69,"Save project as"),l()(),s(70,"button",17),g("click",function(){return o.editProject()}),s(71,"mat-icon"),d(72,"edit"),l(),s(73,"span"),d(74,"Edit project"),l()(),s(75,"button",17),g("click",function(){return o.exportProject()}),s(76,"mat-icon"),d(77,"call_made"),l(),s(78,"span"),d(79,"Export project"),l()(),s(80,"button",17),g("click",function(){return o.importProject()}),s(81,"mat-icon"),d(82,"call_received"),l(),s(83,"span"),d(84,"Import project"),l()(),s(85,"button",17),g("click",function(){return o.closeProject()}),s(86,"mat-icon"),d(87,"close"),l(),s(88,"span"),d(89,"Close project"),l()(),s(90,"button",17),g("click",function(){return o.deleteProject()}),s(91,"mat-icon"),d(92,"delete"),l(),s(93,"span"),d(94,"Delete project"),l()()()(),s(95,"mat-menu",15,3)(97,"div",19)(98,"mat-checkbox",20),g("change",function(a){return o.toggleShowInterfaceLabels(a.checked)}),d(99," Show interface labels "),l(),R(100,"br"),s(101,"mat-checkbox",20),g("change",function(a){return o.toggleShowConsole(a.checked)}),d(102," Show console "),l(),R(103,"br"),s(104,"mat-checkbox",20),g("change",function(a){return o.toggleShowTopologySummary(a.checked)}),d(105," Show topology/controllers summary "),l(),R(106,"br"),s(107,"mat-checkbox",20),g("change",function(a){return o.toggleNotifications(a.checked)}),d(108," Show notifications "),l(),R(109,"br"),s(110,"mat-checkbox",20),g("change",function(a){return o.toggleLayers(a.checked)}),d(111," Show layers "),l(),R(112,"br"),s(113,"mat-checkbox",20),g("change",function(a){return o.toggleItemLockStatus(a.checked)}),d(114," Show item lock status "),l(),R(115,"br"),s(116,"mat-checkbox",20),g("change",function(a){return o.toggleGrid(a.checked)}),d(117," Show grid "),l(),R(118,"br"),s(119,"mat-checkbox",20),g("change",function(a){return o.toggleSnapToGrid(a.checked)}),d(120," Snap to grid "),l(),R(121,"br"),s(122,"mat-checkbox",20),g("change",function(a){return o.toggleSymbolScaling(a.checked)}),d(123," Scale symbols "),l(),R(124,"br"),l()()(),R(125,"app-d3-map",21),s(126,"div",22)(127,"div",23)(128,"button",24),g("click",function(){return o.toggleMovingMode()}),s(129,"mat-icon"),d(130,"near_me"),l()(),s(131,"button",25),g("click",function(){return o.toggleMovingMode()}),s(132,"mat-icon"),d(133,"zoom_out_map"),l()(),s(134,"button",26),g("click",function(){return o.zoomIn()}),s(135,"mat-icon"),d(136,"zoom_in"),l()(),s(137,"button",27),g("click",function(){return o.resetZoom()}),s(138,"mat-icon"),d(139,"adjust"),l()(),s(140,"button",28),g("click",function(){return o.zoomOut()}),s(141,"mat-icon"),d(142,"zoom_out"),l()()(),s(143,"div",23)(144,"app-project-map-menu",29),g("aiChatOpened",function(){return o.onAIChatOpened()}),l()(),A(145,Ake,2,2,"div",23),l(),R(146,"app-progress"),A(147,Oke,1,1,"app-draw-link-tool",30),R(148,"app-drawing-dragged",12)(149,"app-drawing-resized",31)(150,"app-interface-label-dragged",31)(151,"app-link-created",12)(152,"app-node-dragged",12)(153,"app-node-label-dragged",31),s(154,"app-text-added",32),g("drawingSaved",function(){return o.onDrawingSaved()}),l(),R(155,"app-text-edited",31),s(156,"div",33),A(157,Nke,1,3,"app-console-wrapper",34),l(),A(158,Fke,1,3,"app-ai-chat",35),A(159,Lke,2,0),A(160,Bke,2,0),A(161,jke,2,0),s(162,"div",36),A(163,$ke,5,7,"div",37),Y(164,Hke,5,7,"div",37,ij),Y(166,Uke,5,7,"div",37,W2),Y(168,Gke,5,6,"div",37,W2),l()(),xe(170,Wke,0,0,"ng-template",null,4,Rg)),t&2){let r=Pe(15),a=Pe(58),c=Pe(96);Be("pan-mode",o.tools.moving),C("ngClass",o.mapBgClass()),m(3),C("matMenuTriggerFor",r),m(3),O(o.readonly?-1:6),m(2),C("controller",o.controller)("project",o.project),m(),C("project",o.project)("controller",o.controller),m(5),C("overlapTrigger",!1),m(2),C("routerLink",Bt(71,wke)),m(5),C("routerLink",dn(72,Mke,o.controller.id)),m(5),C("routerLink",Ui("/controller/",o.controller.id,"/computes")),m(5),C("routerLink",Ui("/controller/",o.controller.id,"/preferences")),m(5),C("routerLink",dn(74,kke,o.controller.id)),m(10),C("controller",o.controller)("project",o.project),m(),C("matMenuTriggerFor",a),m(5),C("matMenuTriggerFor",c),m(5),C("overlapTrigger",!1),m(38),C("overlapTrigger",!1),m(3),C("checked",o.isInterfaceLabelVisible),m(3),C("checked",o.isConsoleVisible),m(3),C("checked",o.isTopologySummaryVisible),m(3),C("checked",o.notificationsVisibility),m(3),C("checked",o.layersVisibility),m(3),C("checked",o.itemLockStatusVisibility),m(3),C("checked",o.gridVisibility),m(3),C("checked",o.project.snap_to_grid),m(3),C("checked",o.symbolScaling),m(3),C("controller",o.controller)("project",o.project)("symbols",o.symbols)("nodes",o.nodes())("links",o.links)("drawings",o.drawings)("width",o.project.scene_width||2e3)("height",o.project.scene_height||2e3)("show-interface-labels",o.isInterfaceLabelVisible)("readonly",o.inReadOnlyMode),m(3),Be("tool-active",!o.tools.moving),C("color",o.tools.moving?"basic":"primary"),m(3),Be("tool-active",o.tools.moving),C("color",o.tools.moving?"primary":"basic"),m(13),C("controller",o.controller)("project",o.project),m(),O(o.readonly?-1:145),m(2),O(o.tools.draw_link?147:-1),m(),C("controller",o.controller)("project",o.project),m(),C("controller",o.controller),m(),C("controller",o.controller),m(),C("controller",o.controller)("project",o.project),m(),C("controller",o.controller)("project",o.project),m(),C("controller",o.controller),m(),C("controller",o.controller)("project",o.project),m(),C("controller",o.controller),m(),C("ngClass",dn(76,Tke,!o.isConsoleVisible)),m(),O(o.project?157:-1),m(),O(o.project&&o.isAIChatVisible?158:-1),m(),O(o.project&&o.webWiresharkInlineWindows.size>0?159:-1),m(),O(o.project&&o.webConsoleInlineWindows.size>0?160:-1),m(),O(o.project&&o.fileManagerInlineWindows.size>0?161:-1),m(2),O(o.project&&o.isConsoleVisible?163:-1),m(),Z(o.getWebWiresharkInlineWindows()),m(2),Z(o.getWebConsoleInlineWindows()),m(2),Z(o.getFileManagerInlineWindows())}},dependencies:[ne,Yi,Xe,W,je,Ot,Gt,ie,de,Ge,Qn,Ze,Fn,wt,It,dt,vn,AS,ag,pg,L2,z2,G2,Cg,V2,O2,M2,V9,B9,$9,xm,Q9,X9,K9,Y9,Z9,J9,ej,tj],styles:['@charset "UTF-8";.shadow-subtle[_ngcontent-%COMP%], #project-toolbar[_ngcontent-%COMP%]{box-shadow:0 1px 3px color-mix(in srgb,var(--mat-sys-shadow) var(--gns3-shadow-opacity-light),transparent)}.shadow-normal[_ngcontent-%COMP%], .shadow[_ngcontent-%COMP%], #project-titlebar[_ngcontent-%COMP%]{box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) var(--gns3-shadow-opacity-normal),transparent)}.shadow-medium[_ngcontent-%COMP%], #menu-wrapper[_ngcontent-%COMP%], .shadowed[_ngcontent-%COMP%]{box-shadow:0 4px 16px color-mix(in srgb,var(--mat-sys-shadow) var(--gns3-shadow-opacity-medium),transparent)}.shadow-heavy[_ngcontent-%COMP%]{box-shadow:0 4px 16px color-mix(in srgb,var(--mat-sys-shadow) var(--gns3-shadow-opacity-heavy),transparent)}.selection-on-primary[_ngcontent-%COMP%], #project-titlebar[_ngcontent-%COMP%] .selected[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--mat-sys-on-primary) var(--gns3-selection-opacity-normal),transparent)}.selection-on-primary[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], #project-titlebar[_ngcontent-%COMP%] .selected[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .selection-on-primary[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%], #project-titlebar[_ngcontent-%COMP%] .selected[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}.selection-on-surface[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container)}.selection-on-surface[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .selection-on-surface[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.selection-svg-stroke[_ngcontent-%COMP%], line.selected[_ngcontent-%COMP%]{stroke:var(--mat-sys-primary)}.selection-error[_ngcontent-%COMP%], path.curve_element.selected[_ngcontent-%COMP%], path.serial_link.selected[_ngcontent-%COMP%]{stroke:var(--mat-sys-error)}.wrapper[_ngcontent-%COMP%]{height:500px}app-root[_ngcontent-%COMP%], app-project-map[_ngcontent-%COMP%], .project-map[_ngcontent-%COMP%], app-map[_ngcontent-%COMP%]{width:auto}g.node[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-primary)}.project-map[_ngcontent-%COMP%]{background:var(--gns3-map-bg, var(--mat-sys-surface));min-height:100vh;min-width:100vw}.project-map[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{fill:var(--mat-sys-on-surface)}.project-map[_ngcontent-%COMP%] path.ethernet_link[_ngcontent-%COMP%]{stroke:var(--mat-sys-on-surface)}.project-map[_ngcontent-%COMP%] path.serial_link[_ngcontent-%COMP%]{stroke:var(--mat-sys-error)}.project-map[_ngcontent-%COMP%] g.drawing-line-tool[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{stroke:var(--mat-sys-on-surface)}.project-map.pan-mode[_ngcontent-%COMP%] app-d3-map[_ngcontent-%COMP%]{cursor:grab}.project-map.pan-mode[_ngcontent-%COMP%] app-d3-map[_ngcontent-%COMP%] svg.map[_ngcontent-%COMP%]{cursor:grab}#project-titlebar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;height:64px;padding:0 16px;background-color:var(--mat-sys-primary);color:var(--mat-sys-on-primary);display:flex;justify-content:space-between;align-items:center;z-index:2;transition:background-color .2s ease}#project-titlebar[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}#project-titlebar[_ngcontent-%COMP%] .gns3-button[_ngcontent-%COMP%]{position:relative;top:-2px}#project-titlebar[_ngcontent-%COMP%] .gns3-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:30px;height:30px}#project-titlebar[_ngcontent-%COMP%] .primary-controls[_ngcontent-%COMP%]{border-right:1px solid color-mix(in srgb,var(--mat-sys-on-primary) var(--gns3-border-opacity-medium),transparent);padding-right:16px;margin-right:16px}#project-titlebar[_ngcontent-%COMP%] .menu-button-group[_ngcontent-%COMP%]{display:flex;align-items:center;height:40px}#project-titlebar[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:40px;width:40px;margin:0 8px;border-radius:20px;background:none;font-size:14px;transition:transform .1s ease}#project-titlebar[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}#project-titlebar[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%]:hover{transform:scale(1.3)}#project-titlebar[_ngcontent-%COMP%] .menu-button.selected[_ngcontent-%COMP%]:hover{transform:scale(1.15)}#project-titlebar[_ngcontent-%COMP%] .add-menu-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:28px}#project-titlebar[_ngcontent-%COMP%] .selected[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--mat-sys-on-primary) 30%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--mat-sys-on-primary) 50%,transparent);transform:scale(1.15)}#project-titlebar[_ngcontent-%COMP%] .project-titlebar-controls[_ngcontent-%COMP%]{display:flex;align-items:center}#project-toolbar[_ngcontent-%COMP%]{position:fixed;top:64px;left:0;width:56px;margin:16px;background-color:var(--mat-sys-surface-container);border-radius:4px;z-index:2;transition:background-color .2s ease;display:flex;flex-direction:column;align-items:center}#project-toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;--mdc-icon-button-icon-size: 20px;--mat-icon-button-icon-size: 20px;--mat-icon-button-state-layer-size: 40px;--mdc-icon-button-state-layer-size: 40px}#project-toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;font-size:20px;margin:0}#project-toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:20px;height:20px}#project-toolbar[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%], #project-toolbar[_ngcontent-%COMP%] .zoom-button[_ngcontent-%COMP%], #project-toolbar[_ngcontent-%COMP%] .reset-zoom-button[_ngcontent-%COMP%], #project-toolbar[_ngcontent-%COMP%] .selection-button[_ngcontent-%COMP%], #project-toolbar[_ngcontent-%COMP%] .snapshot-button[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:20px;margin:2px 0;transition:transform .1s ease}#project-toolbar[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%]:hover, #project-toolbar[_ngcontent-%COMP%] .zoom-button[_ngcontent-%COMP%]:hover, #project-toolbar[_ngcontent-%COMP%] .reset-zoom-button[_ngcontent-%COMP%]:hover, #project-toolbar[_ngcontent-%COMP%] .selection-button[_ngcontent-%COMP%]:hover, #project-toolbar[_ngcontent-%COMP%] .snapshot-button[_ngcontent-%COMP%]:hover{transform:scale(1.3)}#project-toolbar[_ngcontent-%COMP%] .menu-button.tool-active[_ngcontent-%COMP%], #project-toolbar[_ngcontent-%COMP%] .selection-button.tool-active[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)}#project-toolbar[_ngcontent-%COMP%] .menu-button.tool-active[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], #project-toolbar[_ngcontent-%COMP%] .selection-button.tool-active[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-secondary-container)}#project-toolbar[_ngcontent-%COMP%] .selection-button[_ngcontent-%COMP%]{margin-bottom:0}#project-toolbar[_ngcontent-%COMP%] .section[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;border-top:1px solid var(--mat-sys-outline-variant);padding:5px 0}#project-toolbar[_ngcontent-%COMP%] .section[_ngcontent-%COMP%]:first-child{border:none}img[_ngcontent-%COMP%]{-webkit-filter:invert(1);filter:invert(1)}#show-menu-wrapper[_ngcontent-%COMP%]{position:fixed;background:transparent;top:0;left:92px;background:var(--mat-sys-surface);height:48px;padding-top:16px;transition:background-color .2s ease}#show-menu-wrapper[_ngcontent-%COMP%] .arrow-button[_ngcontent-%COMP%]{outline:0}.non-visible[_ngcontent-%COMP%]{display:none}#menu-wrapper[_ngcontent-%COMP%]{position:fixed;background:transparent;top:0;left:92px;right:0;background:var(--mat-sys-surface);height:48px;padding-top:16px;padding-bottom:16px;transition:35s;width:0;overflow:hidden;transition:.1s ease;display:flex}#menu-wrapper[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%]{outline:0;transition:.5s;margin-bottom:16px;width:40px;margin-right:16px;margin-left:16px;background:transparent;padding:0;border:none;background-color:transparent}#menu-wrapper[_ngcontent-%COMP%] .arrow-button[_ngcontent-%COMP%]{outline:0;transition:.5s;margin-bottom:16px}.extended[_ngcontent-%COMP%]{width:200px;height:100%;overflow:hidden}mat-divider.divider[_ngcontent-%COMP%]{height:40px;margin-left:1px;margin-right:7px;width:10px;color:var(--mat-sys-outline-variant)}@-moz-document url-prefix(){.mat-drawer-content{display:inline}}.mat-drawer-backdrop.mat-drawer-shown[_ngcontent-%COMP%]{background-color:transparent}.project-toolbar[_ngcontent-%COMP%] .mat-toolbar-multiple-rows[_ngcontent-%COMP%]{width:auto}.loading-spinner[_ngcontent-%COMP%]{position:absolute;top:50%;width:100px;margin-left:-50px;margin-top:-50px;left:50%}svg.map[_ngcontent-%COMP%] image[_ngcontent-%COMP%]:hover, svg.map[_ngcontent-%COMP%] image.chosen[_ngcontent-%COMP%], g.node_body.selected[_ngcontent-%COMP%] > image[_ngcontent-%COMP%]{filter:url(#grayscale)}.selected[_ngcontent-%COMP%] > .interface_label_border[_ngcontent-%COMP%]{stroke:var(--mat-sys-on-surface);fill:none}g.drawing_body[_ngcontent-%COMP%] .rotation-handle-stem[_ngcontent-%COMP%], g.drawing_body[_ngcontent-%COMP%] .rotation-handle-knob[_ngcontent-%COMP%]{visibility:hidden}g.drawing_body.drawing_selected[_ngcontent-%COMP%] .rotation-handle-stem[_ngcontent-%COMP%], g.drawing_body.drawing_selected[_ngcontent-%COMP%] .rotation-handle-knob[_ngcontent-%COMP%]{visibility:visible}g.drawing_body.drawing_selected[_ngcontent-%COMP%] .rotation-handle-stem[_ngcontent-%COMP%]{stroke:var(--mat-sys-primary);stroke-width:2;stroke-dasharray:4 2}g.drawing_body.drawing_selected[_ngcontent-%COMP%] .rotation-handle-knob[_ngcontent-%COMP%]{fill:var(--mat-sys-primary);stroke:var(--gns3-bright-text);stroke-width:2}g.node[_ngcontent-%COMP%] text[_ngcontent-%COMP%], .noselect[_ngcontent-%COMP%]{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.project-toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{outline:0;border:none;-moz-outline-style:none}.options-item[_ngcontent-%COMP%]{padding-left:16px;padding-right:16px}.context-menu-items[_ngcontent-%COMP%] .mat-menu-item[_ngcontent-%COMP%]{line-height:32px;height:32px;font-size:12px;padding:0 6px;outline:none}.context-menu-items[_ngcontent-%COMP%] .mat-menu-item[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:3px}.context-menu-items[_ngcontent-%COMP%] .mat-menu-item[_ngcontent-%COMP%]:focus{background:none}.context-menu-items[_ngcontent-%COMP%] .mat-menu-item.cdk-focused[_ngcontent-%COMP%]:not(:hover), .context-menu-items[_ngcontent-%COMP%] .mat-menu-item.cdk-program-focused[_ngcontent-%COMP%]:not(:hover), .context-menu-items[_ngcontent-%COMP%] .mat-menu-item.cdk-keyboard-focused[_ngcontent-%COMP%]:not(:hover){background:none}.context-menu-items[_ngcontent-%COMP%] .mat-menu-item[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-container)}.visible[_ngcontent-%COMP%]{display:none}mat-menu-panel[_ngcontent-%COMP%]{min-height:0}.unmarked[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface)}.inline-taskbar[_ngcontent-%COMP%]{position:fixed;bottom:20px;left:0;z-index:999;display:flex;gap:8px}.inline-taskbar__icon[_ngcontent-%COMP%]{position:absolute;bottom:0;display:flex;align-items:center;gap:8px;padding:8px 12px;height:48px;width:180px;cursor:pointer;user-select:none;transition:background-color .15s var(--mat-sys-motion-easing-linear);background:var(--mat-sys-surface);border-radius:8px;box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 25%,transparent),0 0 0 1px var(--mat-sys-outline-variant)}.inline-taskbar__icon[_ngcontent-%COMP%]:hover{background:var(--mat-sys-hover-state-layer)}.inline-taskbar__icon[_ngcontent-%COMP%]:active{background:var(--mat-sys-focus-state-layer)}.inline-taskbar__icon--minimized[_ngcontent-%COMP%]{opacity:.7}.inline-taskbar__icon--minimized[_ngcontent-%COMP%]:hover{opacity:1}.inline-taskbar__icon-type[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--mat-sys-primary);flex-shrink:0}.inline-taskbar__label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}'],changeDetection:0})}return n})();var Q2=(()=>{class n{dialogRef=f(Ie);projectService=f(ki);toasterService=f(te);cd=f(Q);controller;project;name=U("");ngOnInit(){this.name.set(this.project.name),this.cd.markForCheck()}onCloseClick(){this.dialogRef.close()}onSaveClick(){this.projectService.duplicate(this.controller,this.project.project_id,this.name()).subscribe({next:()=>{this.dialogRef.close()},error:e=>{let t=e.error?.message||e.message||"Failed to duplicate project";this.toasterService.error(t),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-choose-name-dialog"]],inputs:{controller:"controller",project:"project",name:[1,"name"]},outputs:{name:"nameChange"},decls:10,vars:1,consts:[["mat-dialog-title",""],[1,"modal-form-container"],[1,"form-field"],["matInput","","placeholder","Project name","type","text",3,"input","value"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Save project as"),l(),s(2,"div",1)(3,"mat-form-field",2)(4,"input",3),g("input",function(a){return o.name.set(a.target.value)}),l()()(),s(5,"div",4)(6,"button",5),g("click",function(){return o.onCloseClick()}),d(7,"Cancel"),l(),s(8,"button",6),g("click",function(){return o.onSaveClick()}),d(9,"Save project"),l()()),t&2&&(m(4),C("value",o.name()))},dependencies:[ne,Xe,_e,Ne,Fe,W,pe,Se,Ee,Me,we],styles:[".form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();function qke(n,i){if(n&1&&(s(0,"p"),d(1),l()),n&2){let e=i.$implicit,t=i.$index;m(),ui("",t+1,". ",e==null?null:e.filename)}}function Qke(n,i){if(n&1){let e=z();s(0,"h1",0),d(1,"Do you want delete all projects?"),l(),s(2,"div",1)(3,"p"),d(4,"Your selected projects"),l(),Y(5,qke,2,2,"p",null,Hi),l(),s(7,"div",2)(8,"button",3),g("click",function(){k(e);let o=v();return T(o.deleteAll())}),d(9,"Delete"),l(),s(10,"button",4),d(11,"Cancel"),l()()}if(n&2){let e=v();m(5),Z(e.deleteData==null?null:e.deleteData.deleteFilesPaths)}}function Xke(n,i){n&1&&(s(0,"h1",5),d(1,"Please wait."),l(),s(2,"div",6),R(3,"mat-spinner",7),l())}function Kke(n,i){if(n&1&&(s(0,"p"),d(1),l()),n&2){let e=i.$implicit,t=i.$index;m(),ui("",t+1,". ",(e==null?null:e.filename)||(e==null?null:e.project_id))}}function Yke(n,i){if(n&1&&(s(0,"h2",0),d(1),l(),Y(2,Kke,2,2,"p",null,Ae)),n&2){let e=v(2);m(),ui("\u2713 ",e.successfulDeletions().length," ",e.successfulDeletions().length===1?"Project":"Projects"," deleted successfully"),m(),Z(e.successfulDeletions())}}function Zke(n,i){if(n&1&&(s(0,"p"),d(1),s(2,"strong"),d(3),l(),R(4,"br"),s(5,"span",10),d(6),l()()),n&2){let e=i.$implicit,t=i.$index;m(),ee(" ",t+1,". "),m(2),j((e.project==null?null:e.project.filename)||(e.project==null?null:e.project.project_id)),m(3),j((e.error==null||e.error.error==null?null:e.error.error.message)||(e.error==null?null:e.error.message)||"Unknown error")}}function Jke(n,i){if(n&1&&(s(0,"h2",9),d(1),l(),Y(2,Zke,7,3,"p",null,Hi)),n&2){let e=v(2);m(),ui("\u2717 ",e.failedDeletions().length," ",e.failedDeletions().length===1?"Project":"Projects"," failed to delete"),m(),Z(e.failedDeletions())}}function eTe(n,i){if(n&1){let e=z();s(0,"div",1),A(1,Yke,4,2),A(2,Jke,4,2),l(),s(3,"div",2)(4,"button",8),g("click",function(){k(e);let o=v();return T(o.dialogRef.close(o.successfulDeletions().length>0))}),d(5,"Close"),l()()}if(n&2){let e=v();m(),O(e.successfulDeletions().length>0?1:-1),m(),O(e.failedDeletions().length>0?2:-1)}}var X2=(()=>{class n{deleteData;dialogRef=f(Ie);projectService=f(ki);toasterService=f(te);cd=f(Q);isDelete=ae(!1);isUsedFiles=ae(!1);successfulDeletions=ae([]);failedDeletions=ae([]);constructor(e){this.deleteData=e}async deleteAll(){this.isDelete.set(!0),await this.deleteFile()}deleteFile(){let e=this.deleteData.deleteFilesPaths.map((t,o)=>this.projectService.delete(this.deleteData.controller,t.project_id).pipe(po(r=>Nn({error:!0,data:r,projectIndex:o}))));qi(e).subscribe({next:t=>{let o=[],r=[];t.forEach((a,c)=>{a&&a.error===!0?r.push({project:this.deleteData.deleteFilesPaths[c],error:a.data}):a==null?o.push(this.deleteData.deleteFilesPaths[c]):r.push({project:this.deleteData.deleteFilesPaths[c],error:a})}),this.successfulDeletions.set(o),this.failedDeletions.set(r),this.isUsedFiles.set(!0),this.isDelete.set(!0),this.cd.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to delete projects";this.toasterService.error(o),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-confirmation-delete-all-projects"]],decls:3,vars:3,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["mat-dialog-actions","","align","end"],["mat-button","",3,"click"],["mat-button","","mat-dialog-close","","cdkFocusInitial",""],["align","center","mat-dialog-title",""],["mat-dialog-content","","align","center"],["color","accent"],["mat-raised-button","","color","primary",3,"click"],["mat-dialog-title","",1,"mat-error"],[1,"mat-error"]],template:function(t,o){t&1&&(A(0,Qke,12,0),A(1,Xke,4,0),A(2,eTe,6,2)),t&2&&(O(!o.isDelete()&&!o.isUsedFiles()?0:-1),m(),O(o.isDelete()&&!o.isUsedFiles()?1:-1),m(),O(o.isDelete()&&o.isUsedFiles()?2:-1))},dependencies:[ne,_e,pc,Ne,Fe,bt,W,pe,pn,li],encapsulation:2,changeDetection:0})}return n})();var tTe=(n,i)=>["/controller",n,"project",i];function nTe(n,i){if(n&1){let e=z();s(0,"mat-header-cell")(1,"mat-checkbox",35),g("change",function(o){k(e);let r=v();return T(o.checked?r.allChecked():r.unChecked())}),l()()}if(n&2){let e=v();m(),C("checked",e.selection.hasValue()&&e.isAllSelected())("indeterminate",e.selection.hasValue()&&!e.isAllSelected())}}function iTe(n,i){if(n&1){let e=z();s(0,"mat-cell")(1,"mat-checkbox",36),g("click",function(o){return o.stopPropagation()})("change",function(o){let r=k(e).$implicit,a=v();return T(o?a.selection.toggle(r):null)}),l()()}if(n&2){let e=i.$implicit,t=v();m(),C("checked",t.selection.isSelected(e))}}function oTe(n,i){n&1&&(s(0,"mat-header-cell",37),d(1," Name "),l())}function rTe(n,i){if(n&1&&(s(0,"mat-cell")(1,"a",38),d(2),l()()),n&2){let e=i.$implicit,t=v();m(),C("routerLink",zs(2,tTe,t.controller.id,e.project_id)),m(),ee(" ",e.name," ")}}function aTe(n,i){n&1&&(s(0,"mat-header-cell",37),d(1," Created By "),l())}function sTe(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit;m(),ee(" ",e.created_by," ")}}function lTe(n,i){n&1&&(s(0,"mat-header-cell",39),d(1," Actions "),l())}function cTe(n,i){if(n&1){let e=z();s(0,"button",48),g("click",function(){k(e);let o=v().$implicit,r=v();return T(r.open(o))}),s(1,"mat-icon",49),d(2,"play_arrow"),l()()}}function dTe(n,i){n&1&&R(0,"mat-progress-spinner",51)}function mTe(n,i){n&1&&(s(0,"mat-icon",52),d(1,"pause"),l())}function pTe(n,i){if(n&1){let e=z();s(0,"button",50),g("click",function(){k(e);let o=v().$implicit,r=v();return T(r.close(o))}),A(1,dTe,1,0,"mat-progress-spinner",51)(2,mTe,2,0,"mat-icon",52),l()}if(n&2){let e=v().$implicit,t=v();C("disabled",t.isProjectLoading(e.project_id)),m(),O(t.isProjectLoading(e.project_id)?1:2)}}function uTe(n,i){if(n&1){let e=z();s(0,"button",53),g("click",function(){k(e);let o=v().$implicit,r=v();return T(r.duplicate(o))}),s(1,"mat-icon",54),d(2,"content_copy"),l()()}}function hTe(n,i){if(n&1){let e=z();s(0,"mat-cell",39)(1,"div",40),A(2,cTe,3,0,"button",41),A(3,pTe,3,2,"button",42),s(4,"button",43),g("click",function(){let o=k(e).$implicit,r=v();return T(r.editProject(o))}),s(5,"mat-icon",44),d(6,"edit"),l()(),A(7,uTe,3,0,"button",45),s(8,"button",46),g("click",function(){let o=k(e).$implicit,r=v();return T(r.exportSelectProject(o))}),s(9,"mat-icon",47),d(10,"file_download"),l()()()()}if(n&2){let e=i.$implicit;m(2),O(e.status==="closed"?2:-1),m(),O(e.status==="opened"?3:-1),m(4),O(e.status==="closed"?7:-1)}}function fTe(n,i){if(n&1){let e=z();s(0,"button",56),g("click",function(){k(e);let o=v(2);return T(o.deleteAllFiles())}),s(1,"mat-icon"),d(2,"delete"),l()()}}function gTe(n,i){if(n&1&&(s(0,"mat-header-cell",39),A(1,fTe,3,0,"button",55),l()),n&2){let e=v();m(),O(e.selection.selected.length>1?1:-1)}}function _Te(n,i){n&1&&R(0,"mat-progress-spinner",51)}function vTe(n,i){n&1&&(s(0,"mat-icon",59),d(1,"delete"),l())}function CTe(n,i){if(n&1){let e=z();s(0,"button",58),g("click",function(){k(e);let o=v().$implicit,r=v();return T(r.delete(o))}),A(1,_Te,1,0,"mat-progress-spinner",51)(2,vTe,2,0,"mat-icon",59),l()}if(n&2){let e=v().$implicit,t=v();C("disabled",t.isProjectLoading(e.project_id)),m(),O(t.isProjectLoading(e.project_id)?1:2)}}function bTe(n,i){if(n&1&&(s(0,"mat-cell",39),A(1,CTe,3,2,"button",57),l()),n&2){let e=i.$implicit,t=v();m(),O(e.status==="closed"&&t.selection.isSelected(e)?1:-1)}}function xTe(n,i){n&1&&R(0,"mat-header-row")}function yTe(n,i){n&1&&R(0,"mat-row")}function STe(n,i){n&1&&R(0,"mat-icon",33)}function wTe(n,i){n&1&&R(0,"mat-icon",34)}var K2=(()=>{class n{controller;settings;project;displayedColumns=["select","name","created_by","actions","delete"];version=gg;currentYear=new Date().getFullYear();isAllDelete=!1;selection=new Oa(!0,[]);sort=Nt(mo);searchText=U("");_projects=ae([]);_sortActive=ae("name");_sortDirection=ae("asc");_loadingProjects=ae(new Set);displayProjects=Jt(()=>{let e=this.searchText()?.toLowerCase()||"",t=this._projects();e&&(t=t.filter(a=>a.name.toLowerCase().includes(e)||a.created_by&&a.created_by.toLowerCase().includes(e)));let o=this._sortActive(),r=this._sortDirection();return o&&r&&(t=[...t].sort((a,c)=>{let p=a[o],u=c[o],h=isNaN(+p)?p:+p,_=isNaN(+u)?u:+u;return(h<_?-1:1)*(r==="asc"?1:-1)})),t});_displayProjects$=jS(this.displayProjects);dataSource=this._displayProjects$;destroyRef=f(Pl);route=f(lt);projectService=f(ki);notificationService=f(Ws);settingsService=f($r);progressService=f(no);dialog=f(nt);router=f(ht);bottomSheet=f(Gl);toasterService=f(te);recentlyOpenedProjectService=f(qd);themeService=f(ci);ngOnInit(){this.controller=this.route.snapshot.data.controller,this.controller||this.router.navigate(["/controllers"]),this.recentlyOpenedProjectService.setcontrollerIdProjectList(this.controller.id.toString());let e=this.route.snapshot.queryParams.error;e&&(this.toasterService.error(e),this.router.navigate([],{queryParams:{},replaceUrl:!0})),this.refresh(),this.sort()?.sort({id:"name",start:"asc"}),this.settings=this.settingsService.getAll(),this.projectService.projectListSubject.pipe(Ls(this.destroyRef)).subscribe(()=>this.refresh()),this.notificationService.projectNotificationEmitter.pipe(Ls(this.destroyRef)).subscribe(t=>this.handleProjectNotification(t))}onSortChange(e){this._sortActive.set(e.active),this._sortDirection.set(e.direction)}refresh(){this.projectService.list(this.controller).subscribe({next:e=>{this._projects.set(e)},error:e=>{let t=e.error?.message||e.message||"Failed to list projects";this.toasterService.error(t),this.progressService.setError(e)}})}handleProjectNotification(e){this._projects.update(t=>{let o=[...t],r=o.findIndex(a=>a.project_id===e.event.project_id);switch(e.action){case"project.created":r===-1&&o.push(e.event);break;case"project.opened":case"project.closed":case"project.updated":r>=0&&(o[r]=e.event);break;case"project.deleted":r>=0&&o.splice(r,1);break}return o})}isProjectLoading(e){return this._loadingProjects().has(e)}setProjectLoading(e,t){this._loadingProjects.update(o=>{let r=new Set(o);return t?r.add(e):r.delete(e),r})}isAllSelected(){let e=this.selection.selected.length,t=this._projects().length;return e===t}selectAllImages(){this.isAllSelected()?this.unChecked():this.allChecked()}unChecked(){this.selection.clear(),this.isAllDelete=!1}allChecked(){this._projects().forEach(e=>this.selection.select(e)),this.isAllDelete=!0}delete(e){let o=this.bottomSheet.open(Wa,{data:{message:"Do you want to delete the project?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(r=>{r&&(this.setProjectLoading(e.project_id,!0),this.projectService.delete(this.controller,e.project_id).subscribe({next:()=>{this.refresh()},error:a=>{let c=a.error?.message||a.message||"Failed to delete project";this.toasterService.error(c),this.setProjectLoading(e.project_id,!1)},complete:()=>{this.setProjectLoading(e.project_id,!1)}}))})}open(e){this.progressService.activate(),this.projectService.open(this.controller,e.project_id).subscribe({next:()=>{this.refresh()},error:t=>{let o=t.error?.message||t.message||"Project was deleted";this.refresh(),this.progressService.deactivate(),this.toasterService.error(o)},complete:()=>{this.progressService.deactivate()}})}close(e){let o=this.bottomSheet.open(Wa,{data:{message:"Do you want to close the project?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(r=>{r&&(this.setProjectLoading(e.project_id,!0),this.projectService.close(this.controller,e.project_id).subscribe({next:()=>{this.refresh(),this.progressService.deactivate()},error:a=>{let c=a.error?.message||a.message||"Failed to close project";this.toasterService.error(c),this.setProjectLoading(e.project_id,!1),this.progressService.deactivate()},complete:()=>{this.setProjectLoading(e.project_id,!1)}}))})}duplicate(e){let t=this.dialog.open(Q2,{panelClass:["base-dialog-panel","choose-name-dialog-panel"],autoFocus:!1,disableClose:!0}),o=t.componentInstance;o.controller=this.controller,o.project=e,t.afterClosed().subscribe(()=>{this.refresh()})}editProject(e){let t=this.dialog.open(Kf,{autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","configurator-dialog-panel","edit-project-dialog-panel"]}),o=t.componentInstance;o.controller=this.controller,o.project=e,t.afterClosed().subscribe(()=>{this.refresh()})}addBlankProject(){let t=this.dialog.open(qf,{panelClass:["base-dialog-panel","add-blank-project-dialog-panel"],autoFocus:!1,disableClose:!0}).componentInstance;t.controller=this.controller}importProject(){let e="",t=this.dialog.open(Yf,{panelClass:["base-dialog-panel","import-project-dialog-panel"],autoFocus:!1,disableClose:!0}),o=t.componentInstance;o.controller=this.controller;let r=t.componentInstance.onImportProject.subscribe(a=>{e=a});t.afterClosed().subscribe(()=>{if(this.refresh(),r.unsubscribe(),e){this.bottomSheet.open(Zf);let a=this.bottomSheet._openedBottomSheetRef;a.instance.projectMessage="imported project";let c=a.afterDismissed().subscribe(p=>{p&&this.projectService.open(this.controller,e).subscribe({next:()=>{this.router.navigate(["/controller",this.controller.id,"project",e])},error:u=>{let h=u.error?.message||u.message||"Failed to open project";this.toasterService.error(h)}})})}})}deleteAllFiles(){this.dialog.open(X2,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel","delete-all-projects-dialog-panel"],autoFocus:!1,disableClose:!0,data:{controller:this.controller,deleteFilesPaths:this.selection.selected}}).afterClosed().subscribe(t=>{if(t)this.unChecked(),this.refresh(),this.toasterService.success("All projects deleted");else return this.unChecked(),this.refresh(),!1})}exportSelectProject(e){this.project=e,this.project.project_id&&this.exportPortableProjectDialog()}exportPortableProjectDialog(){this.dialog.open(tf,{panelClass:["base-dialog-panel","simple-dialog-panel"],autoFocus:!1,disableClose:!0,data:{controllerDetails:this.controller,projectDetails:this.project}}).afterClosed().subscribe(()=>{})}isLightThemeEnabled(){return this.themeService.getActualTheme()==="light"}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-projects"]],viewQuery:function(t,o){t&1&&Xt(o.sort,mo,5),t&2&&Kt()},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:54,vars:9,consts:[["table",""],[1,"projects"],[1,"projects__content"],[1,"projects__header"],[1,"projects__title"],[1,"projects__buttons-bar"],["mat-raised-button","","color","primary",1,"projects__button",3,"click"],[1,"projects__search-form"],[1,"projects__search"],["matPrefix",""],["matInput","","placeholder","Search by name or created by",3,"input","value"],[1,"projects__table-container"],["itemSize","72","minBufferPx","400","maxBufferPx","800"],["matSort","",3,"matSortChange","dataSource"],["matColumnDef","select"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","name"],["mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","created_by"],["matColumnDef","actions"],["class","projects__cell--actions",4,"matHeaderCellDef"],["class","projects__cell--actions",4,"matCellDef"],["matColumnDef","delete"],[4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"projects__footer"],[1,"projects__footer-content"],[1,"projects__footer-info"],[1,"projects__footer-social"],["href","https://github.com/GNS3","target","_blank","rel","noopener noreferrer","matTooltip","GitHub",1,"projects__footer-social-link"],["svgIcon","github",1,"projects__footer-icon"],["href","https://www.gns3.com/","target","_blank","rel","noopener noreferrer","matTooltip","Website",1,"projects__footer-social-link"],["svgIcon","gns3",1,"projects__footer-icon"],["svgIcon","gns3black",1,"projects__footer-icon"],[3,"change","checked","indeterminate"],[3,"click","change","checked"],["mat-sort-header",""],[1,"projects__link",3,"routerLink"],[1,"projects__cell--actions"],[1,"projects__actions-cell"],["mat-icon-button","","matTooltip","Open project"],["mat-icon-button","","matTooltip","Close project",3,"disabled"],["mat-icon-button","","matTooltip","Rename/Edit project",3,"click"],["aria-label","Rename project"],["mat-icon-button","","matTooltip","Duplicate project"],["mat-icon-button","","matTooltip","Export project",3,"click"],["aria-label","Export project"],["mat-icon-button","","matTooltip","Open project",3,"click"],["aria-label","Open project"],["mat-icon-button","","matTooltip","Close project",3,"click","disabled"],["diameter","20","mode","indeterminate"],["aria-label","Close project"],["mat-icon-button","","matTooltip","Duplicate project",3,"click"],["aria-label","Save project as"],["mat-button","","color","warn","matTooltip","Delete all selected"],["mat-button","","color","warn","matTooltip","Delete all selected",3,"click"],["mat-icon-button","","color","warn","matTooltip","Delete project",3,"disabled"],["mat-icon-button","","color","warn","matTooltip","Delete project",3,"click","disabled"],["aria-label","Delete project"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"div",2)(2,"div",3)(3,"h1",4),d(4,"Projects"),l(),s(5,"div",5)(6,"button",6),g("click",function(){return o.addBlankProject()}),s(7,"mat-icon"),d(8,"add"),l(),d(9," Add Blank Project "),l(),s(10,"button",6),g("click",function(){return o.importProject()}),s(11,"mat-icon"),d(12,"cloud_upload"),l(),d(13," Import Project "),l(),s(14,"button",6),g("click",function(){return o.refresh()}),s(15,"mat-icon"),d(16,"refresh"),l(),d(17," Refresh Projects "),l()()(),s(18,"form",7)(19,"mat-form-field",8)(20,"mat-icon",9),d(21,"search"),l(),s(22,"input",10),g("input",function(a){return o.searchText.set(a.target.value)}),l()()(),s(23,"div",11)(24,"cdk-virtual-scroll-viewport",12)(25,"mat-table",13,0),g("matSortChange",function(a){return o.onSortChange(a)}),Le(27,14),xe(28,nTe,2,2,"mat-header-cell",15)(29,iTe,2,1,"mat-cell",16),Ve(),Le(30,17),xe(31,oTe,2,0,"mat-header-cell",18)(32,rTe,3,5,"mat-cell",16),Ve(),Le(33,19),xe(34,aTe,2,0,"mat-header-cell",18)(35,sTe,2,1,"mat-cell",16),Ve(),Le(36,20),xe(37,lTe,2,0,"mat-header-cell",21)(38,hTe,11,3,"mat-cell",22),Ve(),Le(39,23),xe(40,gTe,2,1,"mat-header-cell",21)(41,bTe,2,1,"mat-cell",22),Ve(),xe(42,xTe,1,0,"mat-header-row",24)(43,yTe,1,0,"mat-row",25),l()()(),s(44,"footer",26)(45,"div",27)(46,"div",28),d(47),l(),s(48,"div",29)(49,"a",30),R(50,"mat-icon",31),l(),s(51,"a",32),A(52,STe,1,0,"mat-icon",33),A(53,wTe,1,0,"mat-icon",34),l()()()()()()),t&2&&(m(22),C("value",o.searchText()),m(3),C("dataSource",o.dataSource),m(17),C("matHeaderRowDef",o.displayedColumns)("matHeaderRowDefSticky",!0),m(),C("matRowDefColumns",o.displayedColumns),m(4),ui("GNS3 Web-UI \xA92018-",o.currentYear," v",o.version),m(5),O(o.isLightThemeEnabled()?-1:52),m(),O(o.isLightThemeEnabled()?53:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,vn,Bc,_e,ar,mo,Tr,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W,pe,je,ie,de,we,Me,Gs,Se,Ee,Ot,Gt,pn,li,mC,KO,ZO],styles:['[_nghost-%COMP%]{display:block;width:100%;background:transparent}.projects__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;max-width:1000px;margin:0 auto;padding:24px 20px 16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.projects__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.projects__content[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.projects__buttons-bar[_ngcontent-%COMP%]{display:flex;gap:12px}.projects__button[_ngcontent-%COMP%]{margin:12px 0;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1)}.projects__button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.projects__button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.projects__search-form[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:16px auto;width:100%;max-width:1000px;padding:0 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.projects__search[_ngcontent-%COMP%]{width:100%}.projects__table-container[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;width:100%;max-width:1000px;margin:0 auto;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both;height:calc(100vh - 600px);min-height:300px}cdk-virtual-scroll-viewport[_ngcontent-%COMP%]{height:100%;width:100%;overflow:auto}.mat-table[_ngcontent-%COMP%]{width:100%;min-width:100%}.mat-row[_ngcontent-%COMP%]{height:72px;min-height:72px;box-sizing:border-box}mat-row[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);cursor:default;position:relative}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent);transform:scale(1.002)}mat-row[_ngcontent-%COMP%]:nth-child(2n){background-color:color-mix(in srgb,var(--mat-sys-on-surface) 1%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n):hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent)}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.mat-header-row[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px;text-transform:uppercase}.mat-table-sticky[_ngcontent-%COMP%]{top:0}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.mat-column-name[_ngcontent-%COMP%]{flex:3;justify-content:flex-start;font-weight:500}.projects__cell--actions[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}.projects__link[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);display:inline-block;transform-origin:left center;color:var(--mat-sys-primary);text-decoration:none;font-weight:500;position:relative}.projects__link[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-2px;left:0;width:0;height:2px;background-color:currentColor;transition:width .2s cubic-bezier(.4,0,.2,1)}.projects__link[_ngcontent-%COMP%]:hover{color:color-mix(in srgb,var(--mat-sys-primary) 80%,black);transform:translateY(-2px)}.projects__link[_ngcontent-%COMP%]:hover:after{width:100%}.projects__actions-cell[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:4px}button[mat-icon-button][_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;transition:all .2s cubic-bezier(.4,0,.2,1);border-radius:50%;--mat-icon-button-state-layer-size: 32px;--mat-icon-button-icon-size: 20px}button[mat-icon-button][_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;border-radius:inherit;background-color:var(--mat-icon-button-state-layer);opacity:0;transition:opacity .15s cubic-bezier(.4,0,.2,1)}button[mat-icon-button][_ngcontent-%COMP%]:hover:before{opacity:var(--mat-icon-button-hover-state-layer-opacity)}button[mat-icon-button][_ngcontent-%COMP%]:active:before{opacity:var(--mat-icon-button-pressed-state-layer-opacity)}button[mat-icon-button][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:transform .15s cubic-bezier(.4,0,.2,1);position:relative;z-index:1}button[mat-icon-button][_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.15)}button[mat-icon-button][_ngcontent-%COMP%]:active mat-icon[_ngcontent-%COMP%]{transform:scale(.95)}.projects__actions-cell[_ngcontent-%COMP%] button[mat-icon-button][_ngcontent-%COMP%]:first-child:before{background-color:var(--mat-sys-primary)}.projects__actions-cell[_ngcontent-%COMP%] button[mat-icon-button][_ngcontent-%COMP%]:first-child:hover:before{opacity:.12}.projects__actions-cell[_ngcontent-%COMP%] button[mat-icon-button][_ngcontent-%COMP%]:first-child:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}button[color=warn][_ngcontent-%COMP%]:before{background-color:var(--mat-sys-error)}button[color=warn][_ngcontent-%COMP%]:hover:before{opacity:.12}button[color=warn][_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-error)}button[mat-icon-button][_ngcontent-%COMP%] mat-progress-spinner[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;position:relative;z-index:1}button[mat-icon-button][_ngcontent-%COMP%]:disabled{cursor:wait;opacity:.7}.projects__footer[_ngcontent-%COMP%]{padding:24px 20px;color:var(--mat-sys-on-surface-variant);font-size:14px;opacity:.7;flex-shrink:0}.projects__footer-content[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;max-width:1000px;margin:0 auto;gap:16px}.projects__footer-info[_ngcontent-%COMP%]{flex:1}.projects__footer-social[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.projects__footer-social-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;color:var(--mat-sys-on-surface-variant);transition:all .2s cubic-bezier(.4,0,.2,1);text-decoration:none}.projects__footer-social-link[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);color:var(--mat-sys-primary);transform:translateY(-2px)}.projects__footer-social-link[_ngcontent-%COMP%]:active{transform:translateY(0)}.projects__footer-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;display:flex;align-items:center;justify-content:center;line-height:1;overflow:visible}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@media(max-width:768px){.projects__header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:12px;padding:16px 16px 12px}.projects__title[_ngcontent-%COMP%]{font-size:28px}.projects__button[_ngcontent-%COMP%]{margin:8px 0;width:100%;height:44px;font-size:15px}.projects__buttons-bar[_ngcontent-%COMP%]{flex-direction:column;width:100%}.projects__actions-cell[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px}mat-cell[_ngcontent-%COMP%]{padding:0 12px;font-size:13px}.projects__footer[_ngcontent-%COMP%]{padding:16px;font-size:12px}.projects__footer-content[_ngcontent-%COMP%]{flex-direction:column;gap:12px;text-align:center}}'],changeDetection:0})}return n})();var yg=(()=>{class n{controllerStatusChanged=new He;constructor(){}get statusChannel(){return"local-controller-status-events"}async start(e){var t={controllerName:e.name,status:"starting",message:""};return this.controllerStatusChanged.next(t),Promise.resolve()}async stop(e){return Promise.resolve()}async stopAll(){return Promise.resolve()}getRunningControllers(){return[]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var MTe=(n,i)=>i.key;function kTe(n,i){n&1&&(s(0,"mat-error"),d(1,"You must enter a value"),l())}function TTe(n,i){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=i.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}function ETe(n,i){if(n&1&&(s(0,"div",2)(1,"mat-error"),d(2),l()()),n&2){let e=v();m(2),j(e.connectionError)}}function DTe(n,i){if(n&1&&(s(0,"div",2)(1,"mat-error"),d(2),l()()),n&2){let e=v();m(2),j(e.duplicateNameError)}}function PTe(n,i){n&1&&R(0,"mat-spinner",12)}function ITe(n,i){n&1&&d(0," Add ")}function ATe(n,i){if(n&1){let e=z();s(0,"button",14),g("click",function(){k(e);let o=v();return T(o.onAddAnywayClick())}),d(1,"Add anyway"),l()}}var Y2=(()=>{class n{dialogRef=f(Ie);controllerService=f(Je);toasterService=f(te);changeDetector=f(Q);data=f(gt);protocols=[{key:"http:",name:"HTTP"},{key:"https:",name:"HTTPS"}];connectionError="";canAddAnyway=!1;isCheckingConnection=!1;duplicateNameError="";controllerForm=new gr({name:new Ye("",[Ue.required]),host:new Ye("",[Ue.required]),port:new Ye("",[Ue.required,Ue.min(1)]),protocol:new Ye("http:")});getDefaultHost(){return"127.0.0.1"}getDefaultPort(){return 3080}constructor(){this.controllerForm.get("host").setValue(this.getDefaultHost()),this.controllerForm.get("port").setValue(this.getDefaultPort())}detectLocation(e){return e==="127.0.0.1"||e==="localhost"?"local":"remote"}onAddClick(){if(!this.controllerForm.valid)return;let e=this.controllerForm.get("name").value;if(this.controllerService.isControllerNameTaken(e)){this.duplicateNameError=`Controller with name "${e}" already exists`,this.toasterService.error(this.duplicateNameError),this.changeDetector.markForCheck();return}this.connectionError="",this.duplicateNameError="",this.canAddAnyway=!1,this.isCheckingConnection=!0,this.changeDetector.markForCheck();let t=Object.assign({},this.controllerForm.value);t.location=this.detectLocation(t.host),this.controllerService.checkControllerVersion(t).subscribe({next:o=>{this.isCheckingConnection=!1,o.version.split(".")[0]>=3?(this.dialogRef.close(t),this.toasterService.success(`Controller ${t.name} added.`)):(this.connectionError="Controller version is not supported.",this.canAddAnyway=!0,this.toasterService.error("Controller version is not supported.")),this.changeDetector.markForCheck()},error:o=>{this.isCheckingConnection=!1,this.connectionError="Cannot connect to the controller. It appears offline.",this.canAddAnyway=!0;let r=o.error?.message||o.message||"Cannot connect to the controller";this.toasterService.error(r),this.changeDetector.markForCheck()}})}onAddAnywayClick(){if(!this.controllerForm.valid)return;let e=this.controllerForm.get("name").value;if(this.controllerService.isControllerNameTaken(e)){this.duplicateNameError=`Controller with name "${e}" already exists`,this.toasterService.error(this.duplicateNameError),this.changeDetector.markForCheck();return}let t=Object.assign({},this.controllerForm.value);t.location=this.detectLocation(t.host),this.dialogRef.close(t),this.toasterService.warning(`Controller ${t.name} added in offline mode.`)}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-controller-dialog"]],decls:32,vars:7,consts:[["mat-dialog-title",""],[3,"formGroup"],["mat-dialog-content",""],["appearance","fill",1,"full-width-field"],["matInput","","tabindex","1","formControlName","name","placeholder","Controller name"],["matInput","","tabindex","1","formControlName","host","placeholder","127.0.0.1"],["matInput","","type","number","tabindex","1","formControlName","port","placeholder","3080"],["formControlName","protocol"],[3,"value"],["mat-dialog-actions","","align","end"],["mat-button","","tabindex","-1","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click","disabled"],["diameter","16"],["mat-button","","mat-raised-button","","color","warn"],["mat-button","","mat-raised-button","","color","warn",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1,"Add controller"),l(),s(2,"form",1)(3,"div",2)(4,"mat-form-field",3)(5,"mat-label"),d(6,"Name"),l(),R(7,"input",4),A(8,kTe,2,0,"mat-error"),l(),s(9,"mat-form-field",3)(10,"mat-label"),d(11,"Host"),l(),R(12,"input",5),l(),s(13,"mat-form-field",3)(14,"mat-label"),d(15,"Port"),l(),R(16,"input",6),l(),s(17,"mat-form-field",3)(18,"mat-label"),d(19,"Protocol"),l(),s(20,"mat-select",7),Y(21,TTe,2,2,"mat-option",8,MTe),l()()(),A(23,ETe,3,1,"div",2),A(24,DTe,3,1,"div",2),s(25,"div",9)(26,"button",10),g("click",function(){return o.onNoClick()}),d(27,"Cancel"),l(),s(28,"button",11),g("click",function(){return o.onAddClick()}),A(29,PTe,1,0,"mat-spinner",12)(30,ITe,1,0),l(),A(31,ATe,2,0,"button",13),l()()),t&2&&(m(2),C("formGroup",o.controllerForm),m(6),O(o.controllerForm.get("name").hasError("required")?8:-1),m(13),Z(o.protocols),m(2),O(o.connectionError?23:-1),m(),O(o.duplicateNameError?24:-1),m(4),C("disabled",o.isCheckingConnection),m(),O(o.isCheckingConnection?29:30),m(2),O(o.canAddAnyway?31:-1))},dependencies:[ne,Dt,at,Ft,_r,Pt,rt,Rt,zt,_e,Ne,Fe,bt,W,pe,we,Me,et,fi,Se,Ee,vt,At,_t,Fo,pn,li],encapsulation:2,changeDetection:0})}return n})();function OTe(n,i){n&1&&(s(0,"mat-error"),d(1,"Name is required"),l())}function NTe(n,i){n&1&&(s(0,"mat-error"),d(1,"Host is required"),l())}function FTe(n,i){n&1&&(s(0,"mat-error"),d(1,"Port is required"),l())}function RTe(n,i){n&1&&(s(0,"mat-error"),d(1,"Port must be at least 1"),l())}function LTe(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v();m(),j(e.duplicateNameError)}}var oj=(()=>{class n{dialogRef=f(Ie);controllerService=f(Je);toasterService=f(te);changeDetector=f(Q);controller;controllerForm;duplicateNameError="";ngOnInit(){this.controllerForm=new gr({name:new Ye(this.controller.name,[Ue.required]),host:new Ye(this.controller.host,[Ue.required]),port:new Ye(this.controller.port,[Ue.required,Ue.min(1)]),protocol:new Ye(this.controller.protocol||"http:")})}onSave(){if(!this.controllerForm.valid)return;let e=this.controllerForm.value.name;if(e!==this.controller.name&&this.controllerService.isControllerNameTaken(e)){this.duplicateNameError=`Controller with name "${e}" already exists`,this.toasterService.error(this.duplicateNameError),this.changeDetector.markForCheck();return}this.duplicateNameError="";let t=it(K({},this.controller),{name:e,host:this.controllerForm.value.host,port:this.controllerForm.value.port,protocol:this.controllerForm.value.protocol});this.controllerService.update(t).then(()=>{this.dialogRef.close(t),this.toasterService.success(`Controller ${t.name} updated.`)},o=>{let r=o.error?.message||o.message||"Failed to update controller";this.toasterService.error(r),this.changeDetector.markForCheck()})}onCancel(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-edit-controller-dialog"]],decls:34,vars:7,consts:[["mat-dialog-title",""],[3,"formGroup"],["appearance","fill",1,"full-width-field"],["matInput","","formControlName","name","placeholder","Controller name"],["matInput","","formControlName","host","placeholder","127.0.0.1"],["matInput","","type","number","formControlName","port","placeholder","3080"],["formControlName","protocol"],["value","http:"],["value","https:"],["align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1,"Edit Controller"),l(),s(2,"mat-dialog-content")(3,"form",1)(4,"mat-form-field",2)(5,"mat-label"),d(6,"Name"),l(),R(7,"input",3),A(8,OTe,2,0,"mat-error"),l(),s(9,"mat-form-field",2)(10,"mat-label"),d(11,"Host"),l(),R(12,"input",4),A(13,NTe,2,0,"mat-error"),l(),s(14,"mat-form-field",2)(15,"mat-label"),d(16,"Port"),l(),R(17,"input",5),A(18,FTe,2,0,"mat-error"),A(19,RTe,2,0,"mat-error"),l(),s(20,"mat-form-field",2)(21,"mat-label"),d(22,"Protocol"),l(),s(23,"mat-select",6)(24,"mat-option",7),d(25,"HTTP"),l(),s(26,"mat-option",8),d(27,"HTTPS"),l()()(),A(28,LTe,2,1,"mat-error"),l()(),s(29,"mat-dialog-actions",9)(30,"button",10),g("click",function(){return o.onCancel()}),d(31,"Cancel"),l(),s(32,"button",11),g("click",function(){return o.onSave()}),d(33,"Save"),l()()),t&2&&(m(3),C("formGroup",o.controllerForm),m(5),O(o.controllerForm.get("name").hasError("required")?8:-1),m(5),O(o.controllerForm.get("host").hasError("required")?13:-1),m(5),O(o.controllerForm.get("port").hasError("required")?18:-1),m(),O(o.controllerForm.get("port").hasError("min")?19:-1),m(9),O(o.duplicateNameError?28:-1),m(4),C("disabled",!o.controllerForm.valid))},dependencies:[ne,Dt,at,Ft,_r,Pt,rt,Rt,zt,_e,Ne,Fe,bt,W,pe,we,Me,et,fi,Se,Ee,vt,At,_t,Fo],encapsulation:2,changeDetection:0})}return n})();var VTe=n=>["/controller",n,"projects"];function BTe(n,i){n&1&&R(0,"mat-icon",4)}function zTe(n,i){n&1&&R(0,"mat-icon",5)}function jTe(n,i){n&1&&(s(0,"mat-header-cell",40),d(1," ID "),l())}function $Te(n,i){if(n&1&&(s(0,"mat-cell",41),d(1),l()),n&2){let e=i.$implicit;m(),ee(" ",e.id," ")}}function HTe(n,i){n&1&&(s(0,"mat-header-cell",42),d(1," Name "),l())}function UTe(n,i){if(n&1&&(s(0,"a",43),d(1),l()),n&2){let e=v().$implicit;C("routerLink",dn(2,VTe,e.id)),m(),ee(" ",e.name," ")}}function GTe(n,i){if(n&1&&(s(0,"span",44),d(1),l()),n&2){let e=v().$implicit;m(),j(e.name)}}function WTe(n,i){if(n&1&&(s(0,"mat-cell"),A(1,UTe,2,4,"a",43)(2,GTe,2,1,"span",44),l()),n&2){let e=i.$implicit,t=v();m(),O(t.getControllerStatus(e)==="running"?1:2)}}function qTe(n,i){n&1&&(s(0,"mat-header-cell",42),d(1," Status "),l())}function QTe(n,i){n&1&&(s(0,"div",45),R(1,"span",48),s(2,"span"),d(3,"Running"),l()())}function XTe(n,i){n&1&&(s(0,"div",46),R(1,"span",48),s(2,"span"),d(3,"Starting"),l()())}function KTe(n,i){n&1&&(s(0,"div",47),R(1,"span",48),s(2,"span"),d(3,"Stopped"),l()())}function YTe(n,i){if(n&1&&(s(0,"mat-cell"),A(1,QTe,4,0,"div",45)(2,XTe,4,0,"div",46)(3,KTe,4,0,"div",47),l()),n&2){let e,t=i.$implicit,o=v();m(),O((e=o.getControllerStatus(t))==="running"?1:e==="starting"?2:3)}}function ZTe(n,i){n&1&&(s(0,"mat-header-cell",40),d(1," Location "),l())}function JTe(n,i){if(n&1&&(s(0,"mat-cell",41),d(1),l()),n&2){let e=i.$implicit;m(),ee(" ",e.location," ")}}function eEe(n,i){n&1&&(s(0,"mat-header-cell",42),d(1," Host "),l())}function tEe(n,i){if(n&1&&(s(0,"mat-cell")(1,"span",49),d(2),l(),s(3,"span",41),d(4),l()()),n&2){let e=i.$implicit;m(2),ui("",e.host,":",e.port),m(2),j(e.host)}}function nEe(n,i){n&1&&(s(0,"mat-header-cell",40),d(1," Port "),l())}function iEe(n,i){if(n&1&&(s(0,"mat-cell",41),d(1),l()),n&2){let e=i.$implicit;m(),ee(" ",e.port," ")}}function oEe(n,i){n&1&&(s(0,"mat-header-cell"),d(1," Actions "),l())}function rEe(n,i){if(n&1){let e=z();s(0,"button",54),g("click",function(){k(e);let o=v().$implicit,r=v();return T(r.openProjects(o))}),s(1,"mat-icon"),d(2,"folder_open"),l()()}}function aEe(n,i){if(n&1){let e=z();s(0,"mat-cell")(1,"div",50),A(2,rEe,3,0,"button",51),s(3,"button",52),g("click",function(){let o=k(e).$implicit,r=v();return T(r.editController(o))}),s(4,"mat-icon"),d(5,"edit"),l()(),s(6,"button",53),g("click",function(){let o=k(e).$implicit,r=v();return T(r.deleteController(o))}),s(7,"mat-icon"),d(8,"delete"),l()()()()}if(n&2){let e=i.$implicit,t=v();m(2),O(t.getControllerStatus(e)==="running"?2:-1)}}function sEe(n,i){n&1&&R(0,"mat-header-row")}function lEe(n,i){if(n&1&&R(0,"mat-row"),n&2){let e=i.$implicit,t=v();Be("controllers__row--running",t.getControllerStatus(e)==="running")("controllers__row--starting",t.getControllerStatus(e)==="starting")("controllers__row--stopped",t.getControllerStatus(e)==="stopped")}}function cEe(n,i){n&1&&R(0,"mat-icon",38)}function dEe(n,i){n&1&&R(0,"mat-icon",39)}var Z2=(()=>{class n{dialog=f(nt);controllerService=f(Je);controllerDatabase=f(wm);controllerManagement=f(yg);changeDetector=f(Q);bottomSheet=f(Gl);route=f(lt);router=f(ht);themeService=f(ci);toasterService=f(te);dataSource=null;displayedColumns=["id","name","status","location","ip","port","actions"];controllerStatusSubscription;searchText=U("");minStartingDisplayMs=700;statusRefreshIntervalMs=5e3;startingTimestamps=new Map;startingTimeouts=new Map;statusRefreshSubscription;version=gg;currentYear=new Date().getFullYear();sort;constructor(){}getControllers(){let e=this.controllerManagement.getRunningControllers();this.controllerService.findAll().then(t=>{t.forEach(o=>{o.status="stopped",e.findIndex(a=>o.name===a)>=0&&(o.status="running"),o.protocol||(o.protocol=location.protocol)}),this.controllerDatabase.addControllers(t),this.changeDetector.markForCheck(),t.forEach(o=>{this.updateControllerOnlineStatus(o)})},t=>{let o=t.error?.message||t.message||"Failed to load controllers";this.toasterService.error(o),this.changeDetector.markForCheck()})}ngOnInit(){this.controllerService&&this.controllerService.isServiceInitialized?this.getControllers():this.controllerService.serviceInitialized.subscribe(async e=>{e&&this.getControllers()}),this.startStatusAutoRefresh(),this.controllerStatusSubscription=this.controllerManagement.controllerStatusChanged.subscribe(e=>{let t=this.controllerDatabase.find(e.controllerName);if(!t)return;let o=this.startingTimeouts.get(t.name);if(o&&e.status!=="started"&&(clearTimeout(o),this.startingTimeouts.delete(t.name)),e.status==="starting"&&(t.status="starting",this.startingTimestamps.set(t.name,Date.now()),this.changeDetector.markForCheck()),e.status==="stopped"&&(t.status="stopped",this.startingTimestamps.delete(t.name),this.changeDetector.markForCheck()),e.status==="errored"&&(t.status="stopped",this.startingTimestamps.delete(t.name),this.changeDetector.markForCheck()),e.status==="started"){let r=this.startingTimestamps.get(t.name)||Date.now(),a=Date.now()-r,c=Math.max(0,this.minStartingDisplayMs-a);if(c>0){let p=setTimeout(()=>{t.status="running",this.controllerDatabase.update(t),this.startingTimeouts.delete(t.name),this.startingTimestamps.delete(t.name),this.changeDetector.markForCheck()},c);this.startingTimeouts.set(t.name,p);return}t.status="running",this.startingTimestamps.delete(t.name),this.controllerDatabase.update(t),this.changeDetector.markForCheck()}})}ngAfterViewInit(){this.sort&&(this.sort.sort({id:"id",start:"asc"}),this.dataSource=new aO(this.controllerDatabase,this.sort),this.changeDetector.markForCheck())}ngOnDestroy(){this.controllerStatusSubscription.unsubscribe(),this.startingTimeouts.forEach(e=>clearTimeout(e)),this.startingTimeouts.clear(),this.statusRefreshSubscription&&this.statusRefreshSubscription.unsubscribe()}openProjects(e){this.router.navigate(["/controller",e.id,"projects"])}createModal(){this.dialog.open(Y2,{panelClass:["base-dialog-panel","controller-small-dialog-panel","add-controller-dialog-panel"],autoFocus:!1,disableClose:!0}).afterClosed().subscribe(t=>{t&&this.controllerService.create(t).then(o=>{o.status="stopped",this.controllerDatabase.addController(o),this.updateControllerOnlineStatus(o),this.changeDetector.markForCheck()},o=>{let r=o.error?.message||o.message||"Failed to create controller";this.toasterService.error(r),this.changeDetector.markForCheck()})})}startStatusAutoRefresh(){this.statusRefreshSubscription=Kv(this.statusRefreshIntervalMs).subscribe(()=>{this.refreshControllersStatuses()})}refreshControllersStatuses(){this.controllerDatabase.data.slice().forEach(e=>{e.status!=="starting"&&this.updateControllerOnlineStatus(e)})}updateControllerOnlineStatus(e){this.controllerService.checkControllerVersion(e).subscribe({next:t=>{e.status=t.version.split(".")[0]>=3?"running":"stopped",this.controllerDatabase.update(e),this.changeDetector.markForCheck()},error:()=>{e.status="stopped",this.controllerDatabase.update(e),this.changeDetector.markForCheck()}})}getControllerStatus(e){return e.status===void 0?"stopped":e.status}deleteController(e){let o=this.bottomSheet.open(Wa,{data:{message:"Do you want to delete the controller?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(r=>{r&&this.controllerService.delete(e).then(()=>{this.controllerDatabase.remove(e),this.changeDetector.markForCheck()},a=>{let c=a.error?.message||a.message||"Failed to delete controller";this.toasterService.error(c),this.changeDetector.markForCheck()})})}editController(e){let t=this.dialog.open(oj,{panelClass:["base-dialog-panel","controller-dialog-panel","edit-controller-dialog-panel"],autoFocus:!1,disableClose:!0,data:{controller:e}});t.componentRef.instance.controller=e,t.afterClosed().subscribe(o=>{o&&(this.controllerDatabase.update(o),this.changeDetector.markForCheck())})}onSearchChange(e){this.searchText.set(e),this.dataSource&&this.dataSource.setFilter(e)}isLightThemeEnabled(){return this.themeService.getActualTheme()==="light"}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-controller-list"]],viewQuery:function(t,o){if(t&1&&xn(mo,5),t&2){let r;mt(r=pt())&&(o.sort=r.first)}},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:65,vars:17,consts:[["table",""],[1,"controllers"],[1,"controllers__header"],[1,"controllers__header-content"],["svgIcon","gns3",1,"controllers__logo-icon"],["svgIcon","gns3black",1,"controllers__logo-icon"],[1,"controllers__content"],[1,"controllers__search-form"],[1,"controllers__search"],["matPrefix",""],["matInput","","placeholder","Search controllers",3,"input","value"],[1,"controllers__empty-state"],["mat-raised-button","","color","primary",3,"click"],[1,"controllers__table-container"],["matSort","",3,"dataSource"],["matColumnDef","id"],["mat-sort-header","","class","hide-mobile",4,"matHeaderCellDef"],["class","hide-mobile",4,"matCellDef"],["matColumnDef","name"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","status"],["matColumnDef","location"],["matColumnDef","ip"],["matColumnDef","port"],["matColumnDef","actions"],[4,"matHeaderCellDef"],[4,"matHeaderRowDef","matHeaderRowDefSticky"],[3,"controllers__row--running","controllers__row--starting","controllers__row--stopped",4,"matRowDef","matRowDefColumns"],[1,"controllers__buttons-bar"],["mat-raised-button","","color","primary",1,"controllers__button",3,"click"],[1,"controllers__footer"],[1,"controllers__footer-content"],[1,"controllers__footer-info"],[1,"controllers__footer-social"],["href","https://github.com/GNS3","target","_blank","rel","noopener noreferrer","matTooltip","GitHub",1,"controllers__footer-social-link"],["svgIcon","github",1,"controllers__footer-icon"],["href","https://www.gns3.com/","target","_blank","rel","noopener noreferrer","matTooltip","Website",1,"controllers__footer-social-link"],["svgIcon","gns3",1,"controllers__footer-icon"],["svgIcon","gns3black",1,"controllers__footer-icon"],["mat-sort-header","",1,"hide-mobile"],[1,"hide-mobile"],["mat-sort-header",""],[1,"controllers__link",3,"routerLink"],[1,"controllers__name--inactive"],[1,"controllers__status-indicator","controllers__status--running"],[1,"controllers__status-indicator","controllers__status--starting"],[1,"controllers__status-indicator","controllers__status--stopped"],[1,"controllers__status-dot"],[1,"hide-desktop"],[1,"controllers__actions-cell"],["mat-icon-button","","color","primary",1,"primary-action-btn"],["mat-icon-button","",3,"click"],["mat-icon-button","","color","warn",3,"click"],["mat-icon-button","","color","primary",1,"primary-action-btn",3,"click"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"div",2)(2,"div",3),A(3,BTe,1,0,"mat-icon",4),A(4,zTe,1,0,"mat-icon",5),s(5,"h1"),d(6,"Controllers"),l()()(),s(7,"div",6)(8,"form",7)(9,"mat-form-field",8)(10,"mat-icon",9),d(11,"search"),l(),s(12,"input",10),g("input",function(a){return o.onSearchChange(a.target.value)}),l()()(),s(13,"div",11)(14,"mat-icon"),d(15,"cloud_off"),l(),s(16,"h3"),d(17,"No controllers found"),l(),s(18,"p"),d(19,"Add a controller to get started with GNS3"),l(),s(20,"button",12),g("click",function(){return o.createModal()}),s(21,"mat-icon"),d(22,"add"),l(),d(23," Add Controller "),l()(),s(24,"div",13)(25,"mat-table",14,0),Le(27,15),xe(28,jTe,2,0,"mat-header-cell",16)(29,$Te,2,1,"mat-cell",17),Ve(),Le(30,18),xe(31,HTe,2,0,"mat-header-cell",19)(32,WTe,3,1,"mat-cell",20),Ve(),Le(33,21),xe(34,qTe,2,0,"mat-header-cell",19)(35,YTe,4,1,"mat-cell",20),Ve(),Le(36,22),xe(37,ZTe,2,0,"mat-header-cell",16)(38,JTe,2,1,"mat-cell",17),Ve(),Le(39,23),xe(40,eEe,2,0,"mat-header-cell",19)(41,tEe,5,3,"mat-cell",20),Ve(),Le(42,24),xe(43,nEe,2,0,"mat-header-cell",16)(44,iEe,2,1,"mat-cell",17),Ve(),Le(45,25),xe(46,oEe,2,0,"mat-header-cell",26)(47,aEe,9,1,"mat-cell",20),Ve(),xe(48,sEe,1,0,"mat-header-row",27)(49,lEe,1,6,"mat-row",28),l()(),s(50,"div",29)(51,"button",30),g("click",function(){return o.createModal()}),s(52,"mat-icon"),d(53,"add"),l(),d(54," Add Controller "),l()(),s(55,"footer",31)(56,"div",32)(57,"div",33),d(58),l(),s(59,"div",34)(60,"a",35),R(61,"mat-icon",36),l(),s(62,"a",37),A(63,cEe,1,0,"mat-icon",38),A(64,dEe,1,0,"mat-icon",39),l()()()()()()),t&2&&(m(3),O(o.isLightThemeEnabled()?-1:3),m(),O(o.isLightThemeEnabled()?4:-1),m(8),C("value",o.searchText()),m(),Be("controllers__empty-state--hidden",o.controllerDatabase&&o.controllerDatabase.data.length>0),m(11),Be("controllers__table-container--hidden",!o.controllerDatabase||o.controllerDatabase.data.length===0),m(),C("dataSource",o.dataSource),m(23),C("matHeaderRowDef",o.displayedColumns)("matHeaderRowDefSticky",!0),m(),C("matRowDefColumns",o.displayedColumns),m(),Be("controllers__buttons-bar--hidden",!o.controllerDatabase||o.controllerDatabase.data.length===0),m(8),ui("GNS3 Web-UI \xA92018-",o.currentYear," v",o.version),m(5),O(o.isLightThemeEnabled()?-1:63),m(),O(o.isLightThemeEnabled()?64:-1))},dependencies:[ne,Xe,at,rt,Gn,dt,vn,_e,ar,mo,Tr,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,we,Me,Gs,Se,Ee,ie,de,W,pe,je,Bc,Ge,wt,It],styles:['[_nghost-%COMP%]{display:block;width:100%;background:transparent}.controllers__header[_ngcontent-%COMP%]{max-width:1000px;margin:0 auto;padding:32px 20px 16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.controllers__header-content[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-start;gap:16px;animation:fadeIn .5s ease-out}.controllers__logo-icon[_ngcontent-%COMP%]{font-size:72px;width:72px;height:72px;display:flex;align-items:center;justify-content:center;line-height:1;overflow:visible}.controllers__header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.controllers__content[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.controllers__buttons-bar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;max-width:1000px;margin:0 auto;padding:0 20px 20px}.controllers__buttons-bar--hidden[_ngcontent-%COMP%]{display:none}.controllers__button[_ngcontent-%COMP%]{margin:12px 0;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1)}.controllers__button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.controllers__button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.controllers__search-form[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:16px auto;width:100%;max-width:1000px;padding:0 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.controllers__search[_ngcontent-%COMP%]{width:100%}.controllers__table-container[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;width:100%;max-width:1000px;margin:0 auto;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both}.controllers__table-container--hidden[_ngcontent-%COMP%]{display:none}mat-row[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);cursor:default;position:relative}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent);transform:scale(1.002)}mat-row.controllers__row--running[_ngcontent-%COMP%]{border-left:3px solid var(--mat-sys-primary)}mat-row.controllers__row--running[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 4%,transparent)}mat-row.controllers__row--starting[_ngcontent-%COMP%]{border-left:3px solid var(--mat-sys-secondary)}mat-row.controllers__row--starting[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-secondary) 4%,transparent)}mat-row.controllers__row--stopped[_ngcontent-%COMP%]{border-left:3px solid var(--mat-sys-outline-variant)}mat-row.controllers__row--stopped[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-outline-variant) 6%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n){background-color:color-mix(in srgb,var(--mat-sys-on-surface) 1%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n):hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent)}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.mat-header-row[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px;text-transform:uppercase}.mat-table-sticky[_ngcontent-%COMP%]{top:0}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}mat-cell[mat-column=name][_ngcontent-%COMP%]{justify-content:flex-start;font-weight:500}.controllers__name--inactive[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);transition:color .2s cubic-bezier(.4,0,.2,1)}.controllers__name--inactive[_ngcontent-%COMP%]:hover{color:var(--mat-sys-on-surface)}mat-cell[mat-column=status][_ngcontent-%COMP%]{justify-content:center}mat-cell[mat-column=actions][_ngcontent-%COMP%], mat-header-cell[mat-column=actions][_ngcontent-%COMP%]{justify-content:flex-end;padding:0 16px}mat-cell[mat-column=actions][_ngcontent-%COMP%]{overflow:visible}.controllers__status-indicator[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:6px 14px;border-radius:20px;font-size:13px;font-weight:500;transition:background-color .2s cubic-bezier(.4,0,.2,1),color .2s cubic-bezier(.4,0,.2,1),transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_status-fade-in .3s cubic-bezier(.4,0,.2,1);background-color:var(--mat-sys-surface-container-highest);color:var(--mat-sys-on-surface-variant);border:1px solid var(--mat-sys-outline-variant)}.controllers__status-indicator[_ngcontent-%COMP%]:hover{transform:translateY(-1px);box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.controllers__status-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background-color:var(--mat-sys-on-surface-variant);transition:background-color .2s cubic-bezier(.4,0,.2,1)}.controllers__status--running[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container);border:1px solid var(--mat-sys-primary)}.controllers__status--running[_ngcontent-%COMP%] .controllers__status-dot[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary);animation:_ngcontent-%COMP%_pulse-green 2s cubic-bezier(.4,0,.6,1) infinite}.controllers__status--running[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 20%,var(--mat-sys-primary-container));box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-primary) 25%,transparent)}.controllers__status--starting[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container);border:1px solid var(--mat-sys-secondary)}.controllers__status--starting[_ngcontent-%COMP%] .controllers__status-dot[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary);animation:_ngcontent-%COMP%_pulse-orange 1.5s cubic-bezier(.4,0,.6,1) infinite}.controllers__status--starting[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-secondary) 20%,var(--mat-sys-secondary-container));box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-secondary) 25%,transparent)}@keyframes _ngcontent-%COMP%_status-fade-in{0%{opacity:0;transform:scale(.95) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes _ngcontent-%COMP%_pulse-green{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.15)}}@keyframes _ngcontent-%COMP%_pulse-orange{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.15)}}.controllers__link[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);display:inline-block;transform-origin:left center;color:var(--mat-sys-primary);text-decoration:none;font-weight:500;position:relative}.controllers__link[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-2px;left:0;width:0;height:2px;background-color:currentColor;transition:width .2s cubic-bezier(.4,0,.2,1)}.controllers__link[_ngcontent-%COMP%]:hover{color:color-mix(in srgb,var(--mat-sys-primary) 80%,black);transform:translateY(-2px)}.controllers__link[_ngcontent-%COMP%]:hover:after{width:100%}.controllers__actions-cell[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:4px}button[mat-icon-button][_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;transition:all .2s cubic-bezier(.4,0,.2,1);border-radius:50%;--mat-icon-button-state-layer-size: 32px;--mat-icon-button-icon-size: 20px}button[mat-icon-button][_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;border-radius:inherit;background-color:var(--mat-icon-button-state-layer);opacity:0;transition:opacity .15s cubic-bezier(.4,0,.2,1)}button[mat-icon-button][_ngcontent-%COMP%]:hover:before{opacity:var(--mat-icon-button-hover-state-layer-opacity)}button[mat-icon-button][_ngcontent-%COMP%]:active:before{opacity:var(--mat-icon-button-pressed-state-layer-opacity)}button[mat-icon-button][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:transform .15s cubic-bezier(.4,0,.2,1);position:relative;z-index:1}button[mat-icon-button][_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.15)}button[mat-icon-button][_ngcontent-%COMP%]:active mat-icon[_ngcontent-%COMP%]{transform:scale(.95)}.primary-action-btn[_ngcontent-%COMP%]{margin-right:4px}.primary-action-btn[_ngcontent-%COMP%]:before{background-color:var(--mat-sys-primary)}.primary-action-btn[_ngcontent-%COMP%]:hover:before{opacity:.12}.primary-action-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}button[mat-icon-button][_ngcontent-%COMP%]:has(.mat-icon[aria-label*=Start]):before{background-color:var(--mat-sys-tertiary)}button[mat-icon-button][_ngcontent-%COMP%]:has(.mat-icon[aria-label*=Start]):hover:before{opacity:.12}button[mat-icon-button][_ngcontent-%COMP%]:has(.mat-icon[aria-label*=Start]):hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-tertiary)}button[mat-icon-button][_ngcontent-%COMP%]:has(.mat-icon[aria-label*=Stop]):before{background-color:var(--mat-sys-error)}button[mat-icon-button][_ngcontent-%COMP%]:has(.mat-icon[aria-label*=Stop]):hover:before{opacity:.12}button[mat-icon-button][_ngcontent-%COMP%]:has(.mat-icon[aria-label*=Stop]):hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-error)}button[color=warn][_ngcontent-%COMP%]:before{background-color:var(--mat-sys-error)}button[color=warn][_ngcontent-%COMP%]:hover:before{opacity:.12}button[color=warn][_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.controllers__empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:64px 32px;text-align:center;margin:20px auto;max-width:1000px;border-radius:16px;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .2s both}.controllers__empty-state--hidden[_ngcontent-%COMP%]{display:none}.controllers__empty-state[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;margin-bottom:16px;opacity:.4;color:var(--mat-sys-on-surface-variant)}.controllers__empty-state[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:20px;font-weight:500;margin:0 0 8px;color:var(--mat-sys-on-surface)}.controllers__empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:14px;color:color-mix(in srgb,var(--mat-sys-on-surface) 60%,transparent);margin:0 0 24px}.controllers__empty-state[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;padding:0 24px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.controllers__footer[_ngcontent-%COMP%]{padding:24px 20px;color:var(--mat-sys-on-surface-variant);font-size:14px;opacity:.7}.controllers__footer-content[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;max-width:1000px;margin:0 auto;gap:16px}.controllers__footer-info[_ngcontent-%COMP%]{flex:1}.controllers__footer-social[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.controllers__footer-social-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;color:var(--mat-sys-on-surface-variant);transition:all .2s cubic-bezier(.4,0,.2,1);text-decoration:none}.controllers__footer-social-link[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);color:var(--mat-sys-primary);transform:translateY(-2px)}.controllers__footer-social-link[_ngcontent-%COMP%]:active{transform:translateY(0)}.controllers__footer-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;display:flex;align-items:center;justify-content:center;line-height:1;overflow:visible}@media(max-width:768px){.controllers__header-content[_ngcontent-%COMP%]{gap:12px}.controllers__logo-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px}.controllers__header[_ngcontent-%COMP%]{padding:24px 16px 12px}.controllers__header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:24px}.controllers__button[_ngcontent-%COMP%]{margin:8px 0;width:100%;height:44px;font-size:15px}.controllers__actions-cell[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px}.primary-action-btn[_ngcontent-%COMP%]{margin-right:4px}.hide-mobile[_ngcontent-%COMP%]{display:none}.hide-desktop[_ngcontent-%COMP%]{display:inline}.controllers__status-indicator[_ngcontent-%COMP%]{padding:4px 10px;font-size:12px}mat-cell[_ngcontent-%COMP%]{padding:0 12px;font-size:13px}.controllers__empty-state[_ngcontent-%COMP%]{margin:16px;padding:48px 24px}.controllers__footer[_ngcontent-%COMP%]{padding:16px;font-size:12px}.controllers__footer-content[_ngcontent-%COMP%]{flex-direction:column;gap:12px;text-align:center}}@media(min-width:769px){.hide-desktop[_ngcontent-%COMP%]{display:none}}'],changeDetection:0})}return n})(),aO=class extends cd{controllerDatabase;sort;filterChange=new an("");constructor(i,e){super(),this.controllerDatabase=i,this.sort=e}setFilter(i){this.filterChange.next((i||"").trim().toLowerCase())}connect(){return Hn(this.controllerDatabase.dataChange,this.sort.sortChange,this.filterChange).pipe(Lt(()=>{let i=this.controllerDatabase.data.slice(),e=this.filterChange.value;return e&&(i=i.filter(t=>[t.id,t.name,t.location,t.host,t.port,t.status||"stopped"].map(r=>String(r||"").toLowerCase()).join(" ").includes(e))),!this.sort.active||this.sort.direction===""?i:i.sort((t,o)=>{let r=t[this.sort.active]!==void 0?t[this.sort.active]:"",a=o[this.sort.active]!==void 0?o[this.sort.active]:"",c=isNaN(+r)?r:+r,p=isNaN(+a)?a:+a;return(c<p?-1:1)*(this.sort.direction==="asc"?1:-1)})}))}disconnect(){}};var J2=(()=>{class n{constructor(){}get(){}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var eM=(()=>{class n{defaultConsoleService;settingsService;constructor(e,t){this.defaultConsoleService=e,this.settingsService=t}get command(){let e=this.settingsService.getConsoleSettings();return e===void 0?this.defaultConsoleService.get():e}set command(e){this.settingsService.setConsoleSettings(e)}static \u0275fac=function(t){return new(t||n)(ge(J2),ge($r))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var tM=(()=>{class n{consoleForm=new gr({command:new Ye("")});router=f(ht);consoleService=f(eM);toasterService=f(te);ngOnInit(){this.consoleForm.get("command").setValue(this.consoleService.command)}goBack(){this.router.navigate(["/settings"])}save(){let e=this.consoleForm.value;this.consoleService.command=e.command,this.toasterService.success("Console command has been updated."),this.goBack()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-console"]],decls:30,vars:1,consts:[[1,"content"],[1,"default-header"],[1,"row"],[1,"col"],[1,"default-content"],[3,"formGroup"],[1,"form-field","full-width-field"],["matInput","","formControlName","command","placeholder","Command"],[1,"help"],[1,"buttons-bar"],["mat-button","",1,"cancel-button",3,"click"],["mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"Console settings"),l()()(),s(5,"div",4)(6,"mat-card")(7,"form",5)(8,"mat-form-field",6),R(9,"textarea",7),l(),s(10,"div",8),d(11," The following variables are replaced by GNS3:"),R(12,"br"),d(13," %h: console IP or hostname"),R(14,"br"),d(15," %p: console port"),R(16,"br"),d(17," %s: path of the serial connection"),R(18,"br"),d(19," %d: title of the console"),R(20,"br"),d(21," %i: Project UUID"),R(22,"br"),d(23," %c: controller URL (http://user:password@controller:port) "),l()()(),s(24,"div",9)(25,"button",10),g("click",function(){return o.goBack()}),d(26,"Cancel"),l(),s(27,"button",11),g("click",function(){return o.save()}),d(28,"Save"),l(),R(29,"br"),l()()()),t&2&&(m(7),C("formGroup",o.consoleForm))},dependencies:[Dt,at,Ft,Pt,rt,Rt,zt,W,pe,Mt,On,we,Me,Se,Ee],styles:[".help[_ngcontent-%COMP%]{font-size:14px}"],changeDetection:0})}return n})();var nM=(()=>{class n{httpClient;constructor(e){this.httpClient=e}getLatestVersion(){return this.httpClient.get("http://update.gns3.net/")}static \u0275fac=function(t){return new(t||n)(ge(js))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var iM=(n,i)=>i.key;function uEe(n,i){if(n&1&&(s(0,"mat-radio-button",13)(1,"span",24),R(2,"span",25),s(3,"span",26),d(4),l()()()),n&2){let e=i.$implicit;C("value",e.key),m(2),nn("background",e.primaryColor),m(2),j(e.label)}}function hEe(n,i){if(n&1&&(s(0,"mat-radio-button",13)(1,"span",24),R(2,"span",25),s(3,"span",26),d(4),l()()()),n&2){let e=i.$implicit;C("value",e.key),m(2),nn("background",e.primaryColor),m(2),j(e.label)}}function fEe(n,i){if(n&1&&(s(0,"div",16)(1,"mat-radio-button",13)(2,"span",24),R(3,"span",27),s(4,"span",26),d(5),l()()()()),n&2){let e=v();m(),C("value",e.autoMapBackground.key),m(4),j(e.autoMapBackground.label)}}function gEe(n,i){if(n&1&&(s(0,"mat-radio-button",13)(1,"span",24)(2,"span",28)(3,"span",29),d(4,"A"),l()(),s(5,"span",26),d(6),l()()()),n&2){let e=i.$implicit;C("value",e.key),m(2),nn("background",e.background)("color",e.textColor),m(4),j(e.label)}}function _Ee(n,i){if(n&1&&(s(0,"mat-radio-button",13)(1,"span",24)(2,"span",28)(3,"span",29),d(4,"A"),l()(),s(5,"span",26),d(6),l()()()),n&2){let e=i.$implicit;C("value",e.key),m(2),nn("background",e.background)("color",e.textColor),m(4),j(e.label)}}function vEe(n,i){n&1&&R(0,"mat-spinner",21)}function CEe(n,i){n&1&&(s(0,"span"),d(1,"Check for update AI skills"),l())}var oM=(()=>{class n{settingsService=f($r);toaster=f(te);themeService=f(ci);mapSettingsService=f(go);updatesService=f(nM);cdr=f(Q);route=f(lt);controllerService=f(Je);aiChatService=f(eh);settings;integrateLinksLabelsToLinks=U(!1);openReadme=U(!1);openConsolesInWidget=U(!1);crashReports=U(!1);anonymousStatistics=U(!1);isLoadingAiSkills=ae(!1);mapTheme;currentTheme;availableThemes=this.themeService.availableThemes;availableMapBackgrounds=this.themeService.availableMapBackgrounds;get lightThemes(){return this.themeService.availableThemes.filter(e=>e.type==="light")}get darkThemes(){return this.themeService.availableThemes.filter(e=>e.type==="dark")}get lightMapBackgrounds(){return this.themeService.availableMapBackgrounds.filter(e=>e.type==="light"&&e.key!=="auto")}get darkMapBackgrounds(){return this.themeService.availableMapBackgrounds.filter(e=>e.type==="dark")}get autoMapBackground(){return this.themeService.availableMapBackgrounds.find(e=>e.key==="auto")}ngOnInit(){this.settings=this.settingsService.getAll(),this.integrateLinksLabelsToLinks.set(this.mapSettingsService.integrateLinkLabelsToLinks),this.openReadme.set(this.mapSettingsService.openReadme),this.openConsolesInWidget.set(this.mapSettingsService.openConsolesInWidget),this.crashReports.set(this.settings.crash_reports),this.anonymousStatistics.set(this.settings.anonymous_statistics),this.mapTheme=this.themeService.savedMapTheme,this.currentTheme=this.themeService.getCurrentTheme(),this.cdr.markForCheck()}save(){this.settings.crash_reports=this.crashReports(),this.settings.anonymous_statistics=this.anonymousStatistics(),this.settingsService.setAll(this.settings),this.toaster.success("Settings have been saved."),this.mapSettingsService.toggleIntegrateInterfaceLabels(this.integrateLinksLabelsToLinks()),this.mapSettingsService.toggleOpenReadme(this.openReadme()),this.mapSettingsService.toggleOpenConsolesInWidget(this.openConsolesInWidget())}setTheme(e){this.themeService.setTheme(e),this.currentTheme=e,this.cdr.markForCheck()}setMapTheme(e){this.mapTheme=e,this.themeService.setMapTheme(e),this.cdr.markForCheck()}checkForUpdates(){window.open("https://gns3.com/software")}checkForAiSkillsUpdates(){let e=this.route.snapshot.paramMap.get("controller_id");if(!e){this.toaster.error("Controller not found");return}this.isLoadingAiSkills.set(!0),this.controllerService.get(+e).then(t=>{this.aiChatService.reloadSkills(t).subscribe({next:()=>{this.toaster.success("AI skills reloaded successfully"),this.isLoadingAiSkills.set(!1)},error:o=>{let r=o?.error?.message||o?.message||"Failed to reload AI skills";this.toaster.error(r),this.isLoadingAiSkills.set(!1)}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-settings"]],inputs:{integrateLinksLabelsToLinks:[1,"integrateLinksLabelsToLinks"],openReadme:[1,"openReadme"],openConsolesInWidget:[1,"openConsolesInWidget"],crashReports:[1,"crashReports"],anonymousStatistics:[1,"anonymousStatistics"]},outputs:{integrateLinksLabelsToLinks:"integrateLinksLabelsToLinksChange",openReadme:"openReadmeChange",openConsolesInWidget:"openConsolesInWidgetChange",crashReports:"crashReportsChange",anonymousStatistics:"anonymousStatisticsChange"},decls:75,vars:14,consts:[[1,"settings"],[1,"settings__header"],[1,"settings__title"],[1,"settings__content"],[1,"settings__card"],[3,"expanded"],[1,"settings__checkbox-group"],[3,"change","checked"],[1,"settings__theme-section"],[1,"settings__label"],[1,"settings__radio-group",3,"change","value"],[1,"settings__theme-group"],[1,"settings__theme-group-label"],[3,"value"],[1,"settings__theme-section","settings__theme-section--map"],[1,"settings__map-background-group",3,"change","value"],[1,"settings__map-background-auto"],[1,"settings__map-background-row"],[1,"settings__update-section"],["mat-raised-button","",1,"settings__update-button",3,"click"],["mat-raised-button","",1,"settings__update-button",3,"click","disabled","matTooltip"],["diameter","20",1,"settings__update-spinner"],[1,"settings__actions"],["mat-raised-button","","color","primary",1,"settings__save-button",3,"click"],[1,"settings__theme-option"],[1,"settings__theme-swatch"],[1,"settings__theme-name"],[1,"settings__theme-swatch","settings__theme-swatch--auto"],[1,"settings__theme-swatch","settings__theme-swatch--bg"],[1,"settings__theme-swatch-text"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"h1",2),d(3,"Settings"),l()(),s(4,"div",3)(5,"div",4)(6,"mat-accordion")(7,"mat-expansion-panel",5)(8,"mat-expansion-panel-header")(9,"mat-panel-title"),d(10," Local settings "),l(),s(11,"mat-panel-description"),d(12," Customize your local settings "),l()(),s(13,"div",6)(14,"mat-checkbox",7),g("change",function(a){return o.crashReports.set(a.checked)}),d(15,"Send anonymous crash reports"),l(),s(16,"mat-checkbox",7),g("change",function(a){return o.integrateLinksLabelsToLinks.set(a.checked)}),d(17,"Integrate link labels to links"),l(),s(18,"mat-checkbox",7),g("change",function(a){return o.openReadme.set(a.checked)}),d(19,"Automatically open project README files"),l(),s(20,"mat-checkbox",7),g("change",function(a){return o.anonymousStatistics.set(a.checked)}),d(21,"Send anonymous usage statistics"),l(),s(22,"mat-checkbox",7),g("change",function(a){return o.openConsolesInWidget.set(a.checked)}),d(23,"Open consoles in the widget instead of in new tabs after clicking start consoles for all nodes"),l()()(),s(24,"mat-expansion-panel",5)(25,"mat-expansion-panel-header")(26,"mat-panel-title"),d(27," Theme settings "),l(),s(28,"mat-panel-description"),d(29," Customize theme settings "),l()(),s(30,"div",8)(31,"label",9),d(32,"Global theme"),l(),s(33,"mat-radio-group",10),g("change",function(a){return o.setTheme(a.value)}),s(34,"div",11)(35,"span",12),d(36,"Light"),l(),Y(37,uEe,5,4,"mat-radio-button",13,iM),l(),s(39,"div",11)(40,"span",12),d(41,"Dark"),l(),Y(42,hEe,5,4,"mat-radio-button",13,iM),l()()(),s(44,"div",14)(45,"label",9),d(46,"Project map background"),l(),s(47,"mat-radio-group",15),g("change",function(a){return o.setMapTheme(a.value)}),A(48,fEe,6,2,"div",16),s(49,"div",17)(50,"div",11)(51,"span",12),d(52,"Light"),l(),Y(53,gEe,7,6,"mat-radio-button",13,iM),l(),s(55,"div",11)(56,"span",12),d(57,"Dark"),l(),Y(58,_Ee,7,6,"mat-radio-button",13,iM),l()()()()(),s(60,"mat-expansion-panel",5)(61,"mat-expansion-panel-header")(62,"mat-panel-title"),d(63," Updates "),l(),s(64,"mat-panel-description"),d(65," Check for updates "),l()(),s(66,"div",18)(67,"button",19),g("click",function(){return o.checkForUpdates()}),d(68," Check for updates "),l(),s(69,"button",20),g("click",function(){return o.checkForAiSkillsUpdates()}),A(70,vEe,1,0,"mat-spinner",21)(71,CEe,2,0,"span"),l()()()()(),s(72,"div",22)(73,"button",23),g("click",function(){return o.save()}),d(74,"Save settings"),l()()()()),t&2&&(m(7),C("expanded",!0),m(7),C("checked",o.crashReports()),m(2),C("checked",o.integrateLinksLabelsToLinks()),m(2),C("checked",o.openReadme()),m(2),C("checked",o.anonymousStatistics()),m(2),C("checked",o.openConsolesInWidget()),m(2),C("expanded",!1),m(9),C("value",o.currentTheme),m(4),Z(o.lightThemes),m(5),Z(o.darkThemes),m(5),C("value",o.mapTheme),m(),O(o.autoMapBackground?48:-1),m(5),Z(o.lightMapBackgrounds),m(5),Z(o.darkMapBackgrounds),m(2),C("expanded",!1),m(9),C("disabled",o.isLoadingAiSkills())("matTooltip",o.isLoadingAiSkills()?"Updating AI skills...":""),m(),O(o.isLoadingAiSkills()?70:71))},dependencies:[ne,Xe,cl,km,kd,Td,Mm,Gb,Ot,Gt,W,pe,io,xo,ho,pn,li,wt,It],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.settings__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:24px 20px 16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.settings__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.settings__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 24px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.settings__card[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1)}.settings__checkbox-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.settings__checkbox-group[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{margin:0}.settings__theme-section[_ngcontent-%COMP%]{margin-bottom:16px}.settings__theme-section[_ngcontent-%COMP%]:last-child{margin-bottom:0}.settings__theme-section--map[_ngcontent-%COMP%]{padding-top:16px;border-top:1px solid var(--mat-sys-outline-variant);margin-top:16px}.settings__label[_ngcontent-%COMP%]{display:block;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface);margin-bottom:8px}.settings__radio-group[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:16px}.settings__map-background-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.settings__map-background-auto[_ngcontent-%COMP%]{width:100%;padding-bottom:12px;border-bottom:1px solid var(--mat-sys-outline-variant)}.settings__map-background-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:32px}.settings__theme-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;flex:1;min-width:200px}.settings__theme-group-label[_ngcontent-%COMP%]{font-size:12px;font-weight:600;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px;padding-bottom:4px;border-bottom:1px solid var(--mat-sys-outline-variant)}.settings__theme-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.settings__theme-swatch[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50%;flex-shrink:0;box-shadow:0 1px 3px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent);transition:transform .15s cubic-bezier(.4,0,.2,1)}.settings__theme-name[_ngcontent-%COMP%]{font-size:14px}mat-radio-button[_ngcontent-%COMP%]:hover .settings__theme-swatch[_ngcontent-%COMP%]{transform:scale(1.1)}.settings__theme-swatch--bg[_ngcontent-%COMP%]{width:28px;height:20px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--mat-sys-outline)}.settings__theme-swatch-text[_ngcontent-%COMP%]{font-size:10px;font-weight:600}.settings__theme-swatch--auto[_ngcontent-%COMP%]{width:28px;height:20px;border-radius:4px;background:linear-gradient(135deg,var(--mat-sys-primary) 0%,var(--mat-sys-secondary) 50%,var(--mat-sys-surface-variant) 100%);border:1px solid var(--mat-sys-outline)}.settings__update-section[_ngcontent-%COMP%]{padding:8px 0;display:flex;flex-direction:column;gap:12px}.settings__update-button[_ngcontent-%COMP%]{width:100%;min-height:48px;display:flex;align-items:center;justify-content:center}.settings__update-button[_ngcontent-%COMP%] .settings__update-spinner[_ngcontent-%COMP%]{--mat-spinner-stroke-color: var(--mat-sys-on-primary)}.settings__actions[_ngcontent-%COMP%]{margin-top:20px;display:flex;justify-content:flex-end}.settings__save-button[_ngcontent-%COMP%]{height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1);padding:0 32px}.settings__save-button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.settings__save-button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.settings__header[_ngcontent-%COMP%]{padding:16px 16px 12px}.settings__title[_ngcontent-%COMP%]{font-size:28px}.settings__content[_ngcontent-%COMP%]{padding:0 16px 16px}.settings__radio-group[_ngcontent-%COMP%]{flex-direction:column;gap:8px}.settings__save-button[_ngcontent-%COMP%]{width:100%;height:44px;font-size:15px}}"],changeDetection:0})}return n})();var rj=(n,i)=>i[0];function bEe(n,i){if(n&1&&(s(0,"div",13)(1,"span",15),d(2),l(),s(3,"span",16),d(4),l()()),n&2){let e=i.$implicit;m(2),j(e[0]),m(2),j(e[1])}}function xEe(n,i){n&1&&(s(0,"span",14),d(1,"No nodes"),l())}function yEe(n,i){if(n&1&&(s(0,"div",13)(1,"span",15),d(2),l(),s(3,"span",16),d(4),l()()),n&2){let e=i.$implicit;m(2),j(e[0]),m(2),j(e[1])}}function SEe(n,i){if(n&1&&(s(0,"div",1)(1,"h3",2),d(2,"Nodes by Status"),l(),s(3,"div",12),Y(4,yEe,5,2,"div",13,rj),l()()),n&2){let e=v(2);m(4),Z(e.getNodeStatusEntries())}}function wEe(n,i){if(n&1&&(s(0,"div",1)(1,"h3",2),d(2,"Projects & Nodes"),l(),s(3,"div",3)(4,"div",4)(5,"span",5),d(6),l(),s(7,"span",6),d(8,"Total Projects"),l()(),s(9,"div",7)(10,"span",5),d(11),l(),s(12,"span",6),d(13,"Open Projects"),l()(),s(14,"div",8)(15,"span",5),d(16),l(),s(17,"span",6),d(18,"Closed Projects"),l()(),s(19,"div",9)(20,"span",5),d(21),l(),s(22,"span",6),d(23,"Total Nodes"),l()(),s(24,"div",10)(25,"span",5),d(26),l(),s(27,"span",6),d(28,"Total Links"),l()(),s(29,"div",11)(30,"span",5),d(31),l(),s(32,"span",6),d(33,"Capturing"),l()()()(),s(34,"div",1)(35,"h3",2),d(36,"Nodes by Type"),l(),s(37,"div",12),Y(38,bEe,5,2,"div",13,rj,!1,xEe,2,0,"span",14),l()(),A(41,SEe,6,0,"div",1)),n&2){let e=v();m(6),j(e.projectStats().total),m(5),j(e.projectStats().opened),m(5),j(e.projectStats().closed),m(5),j(e.nodeStats().total),m(5),j(e.linkStats().total),m(5),j(e.linkStats().capturing),m(7),Z(e.getNodeTypeEntries()),m(3),O(e.getNodeStatusEntries().length>0?41:-1)}}function MEe(n,i){if(n&1&&(s(0,"div",1)(1,"h3",2),d(2),l(),s(3,"div",17)(4,"div",4)(5,"span",5),d(6),l(),s(7,"span",6),d(8,"CPU Usage"),l()(),s(9,"div",4)(10,"span",5),d(11),l(),s(12,"span",6),d(13,"Disk Usage"),l()(),s(14,"div",4)(15,"span",5),d(16),l(),s(17,"span",6),d(18,"Memory Usage"),l()(),s(19,"div",4)(20,"span",5),d(21),l(),s(22,"span",6),d(23,"SWAP Usage"),l()()(),s(24,"div",18)(25,"div",19)(26,"span",20),d(27,"Load Average (1m / 5m / 15m)"),l(),s(28,"span",21),d(29),l()(),s(30,"div",19)(31,"span",20),d(32,"Memory"),l(),s(33,"span",21),d(34),l()(),s(35,"div",19)(36,"span",20),d(37,"SWAP"),l(),s(38,"span",21),d(39),l()()()()),n&2){let e=v();m(2),ee("Compute: ",e.computeStatistics().compute_name),m(4),ee("",e.computeStatistics().statistics.cpu_usage_percent,"%"),m(5),ee("",e.computeStatistics().statistics.disk_usage_percent,"%"),m(5),ee("",e.computeStatistics().statistics.memory_usage_percent,"%"),m(5),ee("",e.computeStatistics().statistics.swap_usage_percent,"%"),m(8),eC(" ",e.computeStatistics().statistics.load_average_percent[0]," / ",e.computeStatistics().statistics.load_average_percent[1]," / ",e.computeStatistics().statistics.load_average_percent[2]," "),m(5),eC(" ",e.formatBytes(e.computeStatistics().statistics.memory_used)," / ",e.formatBytes(e.computeStatistics().statistics.memory_total)," (",e.formatBytes(e.computeStatistics().statistics.memory_free)," free) "),m(5),eC(" ",e.formatBytes(e.computeStatistics().statistics.swap_used)," / ",e.formatBytes(e.computeStatistics().statistics.swap_total)," (",e.formatBytes(e.computeStatistics().statistics.swap_free)," free) ")}}var rM=(()=>{class n{computeStatistics=le(void 0);projectStats=le(void 0);nodeStats=le(void 0);linkStats=le(void 0);formatBytes(e,t=2){if(e==null||e===0)return"0 Bytes";let o=1024,r=t<0?0:t,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,c)).toFixed(r))+" "+a[c]}getNodeTypeEntries(){let e=this.nodeStats();return e?Object.entries(e.by_type):[]}getNodeStatusEntries(){let e=this.nodeStats();return e?Object.entries(e.by_status):[]}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-status-chart"]],inputs:{computeStatistics:[1,"computeStatistics"],projectStats:[1,"projectStats"],nodeStats:[1,"nodeStats"],linkStats:[1,"linkStats"]},decls:3,vars:2,consts:[[1,"status-chart"],[1,"status-chart__section"],[1,"status-chart__section-title"],[1,"status-chart__stats-grid"],[1,"stat-card"],[1,"stat-card__value"],[1,"stat-card__label"],[1,"stat-card","stat-card--opened"],[1,"stat-card","stat-card--closed"],[1,"stat-card","stat-card--nodes"],[1,"stat-card","stat-card--links"],[1,"stat-card","stat-card--capturing"],[1,"status-chart__breakdown"],[1,"breakdown-item"],[1,"status-chart__empty"],[1,"breakdown-item__label"],[1,"breakdown-item__value"],[1,"status-chart__compute-grid"],[1,"status-chart__info-table"],[1,"info-row"],[1,"info-row__label"],[1,"info-row__value"]],template:function(t,o){t&1&&(s(0,"mat-card",0),A(1,wEe,42,8),A(2,MEe,40,14,"div",1),l()),t&2&&(m(),O(o.projectStats()?1:-1),m(),O(o.computeStatistics()?2:-1))},dependencies:[ne,Mt,On],styles:["[_nghost-%COMP%]{display:block}.status-chart[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;padding:24px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1)}.status-chart__gauges[_ngcontent-%COMP%]{display:flex;justify-content:space-around;align-items:center;margin-bottom:24px}.status-chart__gauges[_ngcontent-%COMP%]:last-child{margin-bottom:0}.gauge--empty[_ngcontent-%COMP%]{flex:1;max-width:200px;visibility:hidden}.status-chart__section[_ngcontent-%COMP%]{margin-bottom:24px;padding-bottom:24px;border-bottom:1px solid var(--mat-sys-outline-variant)}.status-chart__section[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.status-chart__section-title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--mat-sys-on-surface-variant);margin-bottom:16px}.status-chart__empty[_ngcontent-%COMP%]{font-size:13px;color:var(--mat-sys-on-surface-variant);font-style:italic}.status-chart__chips[_ngcontent-%COMP%]{margin-top:16px;padding-top:16px;border-top:1px solid var(--mat-sys-outline-variant)}.status-chart__chip-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:16px;margin-bottom:12px}.status-chart__chip-row[_ngcontent-%COMP%]:last-child{margin-bottom:0}.chip[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:12px 20px;border-radius:var(--mat-sys-corner-medium);flex:1;min-width:0;transition:all .2s ease}.chip__label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:.5px;opacity:.8}.chip__value[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin-top:4px}.chip--memory[_ngcontent-%COMP%]{background:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container)}.chip--swap[_ngcontent-%COMP%]{background:var(--mat-sys-tertiary-container);color:var(--mat-sys-on-tertiary-container)}.status-chart__stats-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}.stat-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:16px 12px;border-radius:var(--mat-sys-corner-medium);background:var(--mat-sys-surface-container-high)}.stat-card__value[_ngcontent-%COMP%]{font-size:24px;font-weight:700;color:var(--mat-sys-on-surface)}.stat-card__label[_ngcontent-%COMP%]{font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.3px;color:var(--mat-sys-on-surface-variant);margin-top:4px;text-align:center}.stat-card--opened[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container)}.stat-card--opened[_ngcontent-%COMP%] .stat-card__value[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary-container)}.stat-card--opened[_ngcontent-%COMP%] .stat-card__label[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary-container);opacity:.8}.stat-card--closed[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-highest)}.stat-card--nodes[_ngcontent-%COMP%]{background:var(--mat-sys-secondary-container)}.stat-card--nodes[_ngcontent-%COMP%] .stat-card__value[_ngcontent-%COMP%]{color:var(--mat-sys-on-secondary-container)}.stat-card--nodes[_ngcontent-%COMP%] .stat-card__label[_ngcontent-%COMP%]{color:var(--mat-sys-on-secondary-container);opacity:.8}.stat-card--links[_ngcontent-%COMP%]{background:var(--mat-sys-tertiary-container)}.stat-card--links[_ngcontent-%COMP%] .stat-card__value[_ngcontent-%COMP%]{color:var(--mat-sys-on-tertiary-container)}.stat-card--links[_ngcontent-%COMP%] .stat-card__label[_ngcontent-%COMP%]{color:var(--mat-sys-on-tertiary-container);opacity:.8}.stat-card--capturing[_ngcontent-%COMP%]{background:var(--mat-sys-error-container)}.stat-card--capturing[_ngcontent-%COMP%] .stat-card__value[_ngcontent-%COMP%]{color:var(--mat-sys-on-error-container)}.stat-card--capturing[_ngcontent-%COMP%] .stat-card__label[_ngcontent-%COMP%]{color:var(--mat-sys-on-error-container);opacity:.8}.status-chart__breakdown[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px}.breakdown-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--mat-sys-surface-container);border-radius:var(--mat-sys-corner-small);min-width:100px}.breakdown-item__label[_ngcontent-%COMP%]{font-size:13px;color:var(--mat-sys-on-surface-variant);text-transform:capitalize}.breakdown-item__value[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--mat-sys-on-surface);margin-left:auto}@media(max-width:768px){.status-chart[_ngcontent-%COMP%]{padding:16px;border-radius:var(--mat-sys-corner-medium)}.status-chart__gauges[_ngcontent-%COMP%]{flex-wrap:wrap;gap:16px}.gauge--empty[_ngcontent-%COMP%]{display:none}.status-chart__chip-row[_ngcontent-%COMP%]{flex-direction:column;gap:8px}.chip[_ngcontent-%COMP%]{flex-direction:row;justify-content:space-between;padding:10px 16px}.status-chart__stats-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)}.breakdown-item[_ngcontent-%COMP%]{flex:1 1 calc(50% - 8px);min-width:0}.status-chart__compute-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}.status-chart__info-table[_ngcontent-%COMP%]{margin-top:16px;padding-top:16px;border-top:1px solid var(--mat-sys-outline-variant)}.info-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--mat-sys-outline-variant)}.info-row[_ngcontent-%COMP%]:last-child{border-bottom:none}.info-row__label[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.info-row__value[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--mat-sys-on-surface);text-align:right}.status-chart__compute-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.status-chart__compute-grid[_ngcontent-%COMP%] .stat-card__value[_ngcontent-%COMP%]{font-size:20px}"],changeDetection:0})}return n})();var kEe=(n,i)=>i.compute_name;function TEe(n,i){n&1&&(s(0,"div"),d(1,"Statistics not loaded"),l())}function EEe(n,i){if(n&1&&(s(0,"div",2)(1,"h3",3),d(2),l(),R(3,"app-status-chart",4),l()),n&2){let e=i.$implicit;m(2),j(e.compute_name),m(),C("computeStatistics",e)}}var aM=(()=>{class n{route=f(lt);computeService=f(ko);controllerService=f(Je);toasterService=f(te);cd=f(Q);controllerId="";computeStatistics=ae([]);projectStats=ae({total:0,opened:0,closed:0});nodeStats=ae({total:0,open_project_nodes:0,closed_project_nodes:0,by_type:{},by_status:{}});linkStats=ae({total:0,capturing:0});connectionFailed;ngOnInit(){this.controllerId=this.route.snapshot.paramMap.get("controller_id"),this.getStatistics()}getStatistics(){this.controllerService.get(Number(this.controllerId)).then(e=>{this.computeService.getStatistics(e).subscribe({next:t=>{this.computeStatistics.set(t.computes),this.projectStats.set(t.projects),this.nodeStats.set(t.nodes),this.linkStats.set(t.links),setTimeout(()=>{this.getStatistics()},2e4)},error:t=>{let o=t.error?.message||t.message||"Failed to load statistics";this.toasterService.error(o),this.connectionFailed=!0,this.cd.markForCheck()}})},e=>{let t=e.error?.message||e.message||"Failed to load controller";this.toasterService.error(t),this.cd.markForCheck()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-status-info"]],decls:5,vars:4,consts:[[1,"status-info__summary"],[3,"projectStats","nodeStats","linkStats"],[1,"status-info__compute"],[1,"status-info__compute-title"],[3,"computeStatistics"]],template:function(t,o){t&1&&(A(0,TEe,2,0,"div"),s(1,"div",0),R(2,"app-status-chart",1),l(),Y(3,EEe,4,2,"div",2,kEe)),t&2&&(O(!o.projectStats().total&&!o.nodeStats().total&&!o.linkStats().total&&!o.computeStatistics().length?0:-1),m(2),C("projectStats",o.projectStats())("nodeStats",o.nodeStats())("linkStats",o.linkStats()),m(),Z(o.computeStatistics()))},dependencies:[ne,rM],styles:[".status-info__summary[_ngcontent-%COMP%], .status-info__compute[_ngcontent-%COMP%]{margin-bottom:24px}.status-info__compute-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;margin-bottom:12px;color:var(--mat-sys-on-surface)}"],changeDetection:0})}return n})();var sM=(()=>{class n{controllerId="";route=f(lt);ngOnInit(){this.controllerId=this.route.snapshot.paramMap.get("controller_id")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-system-status"]],decls:6,vars:0,consts:[[1,"system-status"],[1,"system-status__header"],[1,"system-status__title"],[1,"system-status__content"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"h1",2),d(3,"System status"),l()(),s(4,"div",3),R(5,"app-status-info"),l()())},dependencies:[aM],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.system-status__header[_ngcontent-%COMP%]{max-width:1000px;margin:0 auto;padding:24px 20px 16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.system-status__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.system-status__content[_ngcontent-%COMP%]{max-width:1000px;margin:0 auto;padding:0 20px 24px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.system-status__header[_ngcontent-%COMP%]{padding:16px 16px 12px}.system-status__title[_ngcontent-%COMP%]{font-size:28px}.system-status__content[_ngcontent-%COMP%]{padding:0 16px 16px}}"],changeDetection:0})}return n})();var aj=Bs(eO()),sj=Bs(nO()),lj=Bs(oO());var DEe=["terminal"],$v=(()=>{class n{controllerId;projectId;nodeId;destroy$=new He;controller;node;contextMenuCleanup=null;socket=null;consoleService=f(rr);controllerService=f(Je);route=f(lt);title=f(Hu);nodeService=f(ut);themeService=f(ci);contextMenuService=f(P2);cdr=f(Q);xtermService=f(hg);toasterService=f(te);term=new aj.Terminal(K({},this.xtermService.getDefaultTerminalOptions()));fitAddon=new lj.FitAddon;terminal=Nt("terminal");constructor(){}ngOnInit(){this.themeService.themeChanged.pipe(tt(this.destroy$)).subscribe(()=>{this.xtermService.updateTerminalTheme(this.term,this.cdr)}),this.controllerService.isServiceInitialized?this.getData():this.controllerService.serviceInitialized.pipe(tt(this.destroy$)).subscribe(e=>{e&&this.getData()})}getData(){this.controllerId=this.route.snapshot.paramMap.get("controller_id"),this.projectId=this.route.snapshot.paramMap.get("project_id"),this.nodeId=this.route.snapshot.paramMap.get("node_id"),this.consoleService.consoleResized.pipe(tt(this.destroy$)).subscribe(()=>{this.fitAddon.fit()}),this.controllerService.get(+this.controllerId).then(e=>{this.controller=e,this.nodeService.getNodeById(this.controller,this.projectId,this.nodeId).pipe(tt(this.destroy$)).subscribe({next:t=>{this.node=t,this.title.setTitle(this.node.name),this.openTerminal()},error:t=>{let o=t.error?.message||t.message||"Failed to load node";this.toasterService.error(o),this.cdr.markForCheck()}})},e=>{let t=e.error?.message||e.message||"Failed to load controller";this.toasterService.error(t),this.cdr.markForCheck()})}openTerminal(){setTimeout(()=>{let e=this.terminal();this.term.open(e.nativeElement),this.xtermService.updateTerminalTheme(this.term,this.cdr),this.socket=new WebSocket(this.consoleService.getUrl(this.controller,this.node)),this.socket.onerror=()=>{console.error("[WebConsoleFullWindow] Socket connection error"),this.term.write(`\r
\x1B[31mConnection lost. Please check if the node is still running.\x1B[0m\r
`)},this.socket.onclose=()=>{console.log("[WebConsoleFullWindow] Socket closed"),this.term.write(`\r
\x1B[33mConnection closed.\x1B[0m\r
`)};let t=new sj.AttachAddon(this.socket);this.term.loadAddon(t),this.xtermService.initTerminal(this.term,this.fitAddon),this.fitAddon.fit(),this.term.focus(),this.term.attachCustomKeyEventHandler(o=>!((o.code==="KeyC"||o.code==="KeyV")&&o.ctrlKey&&o.shiftKey)),this.xtermService.settingsChanged$.pipe(tt(this.destroy$)).subscribe(()=>{this.xtermService.applySettingsToTerminal(this.term,this.fitAddon,this.cdr)}),this.contextMenuCleanup=this.contextMenuService.attachContextMenu(this.term,e.nativeElement)},0)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.socket&&(this.socket.close(),this.socket=null),this.contextMenuCleanup&&(this.contextMenuCleanup(),this.contextMenuCleanup=null),this.term&&this.term.dispose()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-web-console-full-window"]],viewQuery:function(t,o){t&1&&Xt(o.terminal,DEe,5),t&2&&Kt()},decls:2,vars:0,consts:[["terminal",""],[1,"terminal",2,"width","100%","height","100%"]],template:function(t,o){t&1&&bs(0,"div",1,0)},dependencies:[ne],styles:["[_nghost-%COMP%]{display:block;width:100vw;height:100vh;overflow:hidden}.terminal[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0})}return n})();var lM=(()=>{class n{consoleService;bottomSheet;constructor(e,t){this.consoleService=e,this.bottomSheet=t}canDeactivate(){return this.consoleService.openConsoles>0?this.bottomSheet.open(Wa,{data:{message:"Exiting the project will close open consoles, do you want to continue?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed():!0}static \u0275fac=function(t){return new(t||n)(ge(rr),ge(Gl))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var ni=(()=>{class n{controllerService;loginService;router;constructor(e,t,o){this.controllerService=e,this.loginService=t,this.router=o}async canActivate(e,t){let o=e.paramMap.get("controller_id");this.loginService.controller_id=o;let r=await this.controllerService.get(parseInt(o,10));try{await this.loginService.getLoggedUser(r)}catch{}return this.controllerService.get(parseInt(o,10)).then(a=>{if(a.authToken&&!a.tokenExpired)return!0;this.router.navigate(["/controller",a.id,"login"],{queryParams:{returnUrl:t.url}})})}static \u0275fac=function(t){return new(t||n)(ge(Je),ge(dl),ge(ht))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Er=(()=>{class n{httpController;constructor(e){this.httpController=e}getInformationAboutLoggedUser(e){return this.httpController.get(e,"/access/users/me/")}get(e,t){return this.httpController.get(e,`/access/users/${t}`)}list(e){return this.httpController.get(e,"/access/users")}add(e,t){return this.httpController.post(e,"/access/users",t)}delete(e,t){return this.httpController.delete(e,`/access/users/${t}`)}update(e,t,o){return o?this.httpController.put(e,"/access/users/me",t):this.httpController.put(e,`/access/users/${t.user_id}`,t)}getGroupsByUserId(e,t){return this.httpController.get(e,`/access/users/${t}/groups`)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function cM(n){if(n.get("password").value!==n.get("confirmPassword").value){n.get("confirmPassword").setErrors({confirmPasswordMatch:!0});return}}function IEe(n,i){n&1&&(s(0,"mat-error"),d(1,"Password must be at least 8 characters long and contain at least one digit, one lowercase letter and one uppercase letter."),l())}function AEe(n,i){n&1&&(s(0,"mat-error"),d(1,"Password and Confirm password must be the same."),l())}var Sg=(()=>{class n{dialogRef=f(Ie);userService=f(Er);toasterService=f(te);cd=f(Q);data=f(gt);user=ae(this.data.user);editPasswordForm=new gr({password:new Ye(null,[Ue.minLength(6),Ue.maxLength(100),Ue.pattern(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/),Ue.required]),confirmPassword:new Ye(null,[Ue.minLength(6),Ue.maxLength(100),Ue.pattern(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/),Ue.required])},{validators:[cM]});constructor(){}get passwordForm(){return this.editPasswordForm.controls}onCancel(){this.dialogRef.close()}onPasswordSave(){if(!this.editPasswordForm.valid)return;let e={};e.password=this.editPasswordForm.get("password").value,e.user_id=this.user().user_id,this.userService.update(this.data.controller,e,this.data.self_update).subscribe({next:t=>{this.toasterService.success(`User ${t.username} password updated`),this.editPasswordForm.reset(),this.dialogRef.close(!0),this.cd.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to update password";this.toasterService.error(o),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-change-user-password"]],decls:15,vars:5,consts:[["mat-dialog-title",""],[1,"input-field",3,"formGroup"],[1,"input-field"],["matInput","","type","password","formControlName","password","placeholder","Password"],["matInput","","type","password","formControlName","confirmPassword","placeholder","Confirm Password"],["mat-dialog-actions","",1,"button-div"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click","disabled"]],template:function(t,o){if(t&1&&(s(0,"h1",0),d(1),l(),s(2,"div")(3,"form",1)(4,"mat-form-field",2),R(5,"input",3),A(6,IEe,2,0,"mat-error"),l(),s(7,"mat-form-field",2),R(8,"input",4),A(9,AEe,2,0,"mat-error"),l(),s(10,"div",5)(11,"button",6),g("click",function(){return o.onCancel()}),d(12,"Cancel"),l(),s(13,"button",7),g("click",function(){return o.onPasswordSave()}),d(14," Change password "),l()()()()),t&2){let r;m(),ee("Change password for ",(r=o.user())==null?null:r.username),m(2),C("formGroup",o.editPasswordForm),m(3),O(o.passwordForm.password!=null&&o.passwordForm.password.touched&&(o.passwordForm.password!=null&&o.passwordForm.password.errors)?6:-1),m(3),O(o.passwordForm.confirmPassword!=null&&o.passwordForm.confirmPassword.touched&&(o.passwordForm.confirmPassword!=null&&o.passwordForm.confirmPassword.errors)?9:-1),m(4),C("disabled",!o.editPasswordForm.valid)}},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,_e,Ne,Fe,W,pe,we,Me,fi,Se,Ee],styles:[".input-field[_ngcontent-%COMP%]{width:100%;padding:0 16px}.button-div[_ngcontent-%COMP%]{float:right}"],changeDetection:0})}return n})();function OEe(n,i){if(n&1&&(s(0,"div",1)(1,"div",5)(2,"span",6),d(3,"Username:"),l(),s(4,"span",7),d(5),l()(),s(6,"div",5)(7,"span",6),d(8,"Full name:"),l(),s(9,"span",7),d(10),l()(),s(11,"div",5)(12,"span",6),d(13,"Email:"),l(),s(14,"span",7),d(15),l()()()),n&2){let e=i;m(5),j(e.username),m(5),j(e.full_name),m(5),j(e.email)}}var cj=(()=>{class n{dialogRef;data;controllerService;userService;toasterService;dialog;user=ae(void 0);controller;constructor(e,t,o,r,a,c){this.dialogRef=e,this.data=t,this.controllerService=o,this.userService=r,this.toasterService=a,this.dialog=c}ngOnInit(){this.controllerService.get(this.data.controllerId).then(e=>{this.controller=e,this.userService.getInformationAboutLoggedUser(e).subscribe(t=>{this.user.set(t)})})}close(){this.dialogRef.close()}changePassword(){this.dialog.open(Sg,{panelClass:["base-dialog-panel","change-user-password-dialog-panel"],data:{user:this.user(),controller:this.controller,self_update:!0}})}copyToken(){let e=document.createElement("textarea");e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.opacity="0",e.value=this.controller.authToken,document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.toasterService.success("Token copied")}static \u0275fac=function(t){return new(t||n)(ot(Ie),ot(gt),ot(Je),ot(Er),ot(te),ot(nt))};static \u0275cmp=F({type:n,selectors:[["app-logged-user"]],decls:11,vars:1,consts:[["mat-dialog-title",""],[1,"logged-user__info"],["align","end",1,"logged-user__actions"],["mat-raised-button","","color","primary",3,"click"],["mat-button","",3,"click"],[1,"logged-user__info-row"],[1,"logged-user__info-label"],[1,"logged-user__info-value"]],template:function(t,o){if(t&1&&(s(0,"h2",0),d(1,"Logged in user info"),l(),s(2,"mat-dialog-content"),A(3,OEe,16,3,"div",1),l(),s(4,"mat-dialog-actions",2)(5,"button",3),g("click",function(){return o.changePassword()}),d(6," Change password "),l(),s(7,"button",3),g("click",function(){return o.copyToken()}),d(8," Copy access token "),l(),s(9,"button",4),g("click",function(){return o.close()}),d(10,"Close"),l()()),t&2){let r;m(3),O((r=o.user())?3:-1,r)}},dependencies:[ne,_e,Ne,Fe,bt,W,pe,ie],styles:[".logged-user__info[_ngcontent-%COMP%]{padding:8px 0}.logged-user__info-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 0}.logged-user__info-row[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid var(--mat-sys-outline-variant)}.logged-user__info-label[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.logged-user__info-value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.logged-user__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px}"],changeDetection:0})}return n})();var dj=(()=>{class n{dialogRef=f(Ie);close(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-model-type-help-dialog"]],decls:269,vars:0,consts:[["mat-dialog-title",""],[1,"help-content"],[1,"compatibility-card"],[1,"status-text"],[1,"status-icon"],[1,"help-section"],[1,"field-item"],[1,"info-card"],[1,"warning-card"],[1,"note"],[1,"strategy-table","mat-elevation-z1"],["align","end"],["mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0)(1,"mat-icon"),d(2,"help_outline"),l(),d(3,` Custom Mode Field Documentation
`),l(),s(4,"mat-dialog-content",1)(5,"mat-card",2)(6,"mat-card-content")(7,"p",3)(8,"mat-icon",4),d(9,"info"),l(),s(10,"strong"),d(11,"OpenAI-Compatible Only:"),l(),d(12," GNS3 currently supports only OpenAI-compatible LLM APIs. Ensure your provider and model use the OpenAI API format (e.g., OpenAI, DeepSeek, OpenRouter, Ollama with OpenAI compatibility). "),l()()(),s(13,"div",5)(14,"h3"),d(15,"Basic Configuration"),l(),s(16,"div",6)(17,"h4"),d(18,"Configuration Name"),l(),s(19,"p"),d(20,"A unique identifier for this LLM model configuration."),l(),s(21,"ul")(22,"li")(23,"strong"),d(24,"Format:"),l(),d(25," 1-100 characters"),l(),s(26,"li")(27,"strong"),d(28,"Allowed characters:"),l(),d(29," Letters, numbers, underscores, and hyphens"),l(),s(30,"li")(31,"strong"),d(32,"Example:"),l(),s(33,"code"),d(34,"gpt-4o-config"),l(),d(35,", "),s(36,"code"),d(37,"claude-3-5-sonnet"),l()()()(),s(38,"div",6)(39,"h4"),d(40,"Model Type"),l(),s(41,"p"),d(42,"The category of AI model for this configuration."),l(),s(43,"mat-card",7)(44,"mat-card-content")(45,"p",3)(46,"mat-icon",4),d(47,"info"),l(),d(48," Currently fixed to "),s(49,"strong"),d(50,"text"),l(),d(51,". This field is reserved for future use when additional model types become supported. "),l()()()()(),s(52,"div",5)(53,"h3"),d(54,"API Configuration"),l(),s(55,"div",6)(56,"h4"),d(57,"Model Provider"),l(),s(58,"p"),d(59,"The LLM provider identifier for API communication."),l(),s(60,"p"),d(61," Enter the provider that matches your API endpoint. Common values include "),s(62,"code"),d(63,"openai"),l(),d(64,", "),s(65,"code"),d(66,"anthropic"),l(),d(67,", "),s(68,"code"),d(69,"ollama"),l(),d(70,", "),s(71,"code"),d(72,"deepseek"),l(),d(73,". "),l(),s(74,"p"),d(75,"For OpenAI-compatible APIs, use "),s(76,"code"),d(77,"openai"),l(),d(78," as the provider and customize the Base URL."),l()(),s(79,"div",6)(80,"h4"),d(81,"Base URL"),l(),s(82,"p"),d(83,"The API endpoint URL for the provider."),l(),s(84,"ul")(85,"li"),d(86,"Enter the full URL of the API endpoint"),l(),s(87,"li")(88,"strong"),d(89,"Examples:"),l(),s(90,"code"),d(91,"https://api.openai.com/v1"),l(),d(92,", "),s(93,"code"),d(94,"http://localhost:11434/v1"),l()()()(),s(95,"div",6)(96,"h4"),d(97,"Model Name"),l(),s(98,"p"),d(99,"The specific model to use."),l(),s(100,"p"),d(101,"Enter the model identifier exactly as required by the provider's API."),l(),s(102,"p")(103,"strong"),d(104,"Examples:"),l(),s(105,"code"),d(106,"gpt-4o"),l(),d(107,", "),s(108,"code"),d(109,"claude-sonnet-4"),l(),d(110,", "),s(111,"code"),d(112,"deepseek-v4-pro"),l(),d(113,", "),s(114,"code"),d(115,"llama-3-70b"),l()()(),s(116,"div",6)(117,"h4"),d(118,"API Key"),l(),s(119,"p"),d(120,"Your authentication key for accessing the API."),l(),s(121,"ul")(122,"li")(123,"strong"),d(124,"Create mode:"),l(),d(125," Required field, minimum 10 characters"),l(),s(126,"li")(127,"strong"),d(128,"Edit mode:"),l(),d(129," Leave empty to keep existing key"),l()(),s(130,"mat-card",8)(131,"mat-card-content")(132,"p",3)(133,"mat-icon",4),d(134,"lock"),l(),d(135," API keys are encrypted on the server for security. "),l()()()()(),s(136,"div",5)(137,"h3"),d(138,"Model Parameters"),l(),s(139,"div",6)(140,"h4"),d(141,"Temperature"),l(),s(142,"p"),d(143,"Controls the randomness of the model's responses."),l(),s(144,"ul")(145,"li")(146,"strong"),d(147,"Range:"),l(),d(148," 0.0 to 2.0"),l(),s(149,"li")(150,"strong"),d(151,"Lower values (0.0-0.3):"),l(),d(152," More focused, deterministic output"),l(),s(153,"li")(154,"strong"),d(155,"Higher values (0.7-2.0):"),l(),d(156," More creative, diverse output"),l(),s(157,"li")(158,"strong"),d(159,"Recommended:"),l(),d(160," 0.3 for technical tasks, 0.7 for creative tasks"),l()()(),s(161,"div",6)(162,"h4"),d(163,"Context Limit"),l(),s(164,"p"),d(165,"The maximum context window size in thousands (K) of tokens."),l(),s(166,"ul")(167,"li")(168,"strong"),d(169,"Range:"),l(),d(170," 1 to 10000"),l(),s(171,"li")(172,"strong"),d(173,"Unit:"),l(),d(174," K tokens (e.g., 128 = 128K tokens)"),l(),s(175,"li")(176,"strong"),d(177,"Meaning:"),l(),d(178," Maximum amount of text the model can consider"),l()(),s(179,"p",9),d(180,"Different models have different context limits. Check your model's documentation."),l()(),s(181,"div",6)(182,"h4"),d(183,"Context Strategy"),l(),s(184,"p"),d(185,"Determines how aggressively the system uses the available context limit."),l(),s(186,"table",10)(187,"thead")(188,"tr")(189,"th"),d(190,"Strategy"),l(),s(191,"th"),d(192,"Usage"),l()()(),s(193,"tbody")(194,"tr")(195,"td")(196,"strong"),d(197,"Conservative"),l()(),s(198,"td"),d(199,"60% of context limit (safer, more reserved)"),l()(),s(200,"tr")(201,"td")(202,"strong"),d(203,"Balanced"),l()(),s(204,"td"),d(205,"75% of context limit (recommended)"),l()(),s(206,"tr")(207,"td")(208,"strong"),d(209,"Aggressive"),l()(),s(210,"td"),d(211,"85% of context limit (maximizes capacity)"),l()()()()(),s(212,"div",6)(213,"h4"),d(214,"Copilot Mode"),l(),s(215,"p"),d(216,"Determines the AI assistant's operational permissions within GNS3."),l(),s(217,"table",10)(218,"thead")(219,"tr")(220,"th"),d(221,"Mode"),l(),s(222,"th"),d(223,"Capabilities"),l()()(),s(224,"tbody")(225,"tr")(226,"td")(227,"strong"),d(228,"Teaching Assistant"),l()(),s(229,"td"),d(230,"Diagnostics and suggestions only (read-only)"),l()(),s(231,"tr")(232,"td")(233,"strong"),d(234,"Lab Automation Assistant"),l()(),s(235,"td"),d(236,"Full configuration access (can modify settings)"),l()()()()()(),s(237,"div",5)(238,"h3"),d(239,"Advanced Parameters (Optional)"),l(),s(240,"p"),d(241,"Add custom parameters to pass additional options to the API."),l(),s(242,"ul")(243,"li")(244,"strong"),d(245,"Key:"),l(),d(246," Parameter name (e.g., "),s(247,"code"),d(248,"max_tokens"),l(),d(249,")"),l(),s(250,"li")(251,"strong"),d(252,"Value:"),l(),d(253," Parameter value (e.g., "),s(254,"code"),d(255,"4096"),l(),d(256,")"),l()(),s(257,"p",9),d(258,"This field is reserved for future use. Additional parameters may be supported in later versions."),l()(),s(259,"div",5)(260,"h3"),d(261,"Default Configuration"),l(),s(262,"p"),d(263,"When enabled, this configuration will be used as the default for AI Chat and other AI-powered features."),l(),s(264,"p"),d(265,"Only one configuration can be set as default at a time."),l()()(),s(266,"mat-dialog-actions",11)(267,"button",12),g("click",function(){return o.close()}),d(268,"Got it"),l()())},dependencies:[_e,Ne,Fe,bt,W,pe,ie,de,Mt,On,ll],styles:["[_nghost-%COMP%]{display:block}mat-dialog-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}mat-dialog-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:24px;width:24px;height:24px}.help-content[_ngcontent-%COMP%]{max-width:700px;max-height:60vh;overflow-y:auto}.help-content[_ngcontent-%COMP%] .compatibility-card[_ngcontent-%COMP%]{margin:0 0 24px;border-radius:8px;background:var(--mat-sys-primary-container);border:1px solid var(--mat-sys-primary)}.help-content[_ngcontent-%COMP%] .compatibility-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{padding:12px 16px}.help-content[_ngcontent-%COMP%] .compatibility-card[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;margin:0;font-size:14px;line-height:1.6;color:var(--mat-sys-on-primary-container)}.help-content[_ngcontent-%COMP%] .compatibility-card[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-top:2px;color:var(--mat-sys-primary)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%]{margin-bottom:32px}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%]:last-child{margin-bottom:0}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:18px;font-weight:600;margin:0 0 20px;padding-bottom:8px;color:var(--mat-sys-on-surface);border-bottom:1px solid var(--mat-sys-outline-variant)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-size:16px;font-weight:600;margin:16px 0 8px;color:var(--mat-sys-on-surface)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:14px;line-height:1.6;margin:8px 0;color:var(--mat-sys-on-surface-variant)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:Courier New,monospace;font-size:13px;background:var(--mat-sys-surface-container-high);color:var(--mat-sys-on-surface);padding:2px 6px;border-radius:4px}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:8px 0;padding-left:24px}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{font-size:14px;line-height:1.6;margin:4px 0;color:var(--mat-sys-on-surface-variant)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .note[_ngcontent-%COMP%]{display:block;margin-top:12px;padding:12px;background:var(--mat-sys-surface-container);border-radius:8px;font-size:13px;color:var(--mat-sys-on-surface-variant)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .info-card[_ngcontent-%COMP%], .help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .warning-card[_ngcontent-%COMP%]{margin:12px 0;border-radius:8px;background:var(--mat-sys-surface-container)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .info-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%], .help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .warning-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{padding:12px 16px}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .info-card[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%], .help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .warning-card[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;margin:0;font-size:14px;line-height:1.6;color:var(--mat-sys-on-surface-variant)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .info-card[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%], .help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .warning-card[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-top:2px}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .field-item[_ngcontent-%COMP%]{margin-bottom:24px}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .field-item[_ngcontent-%COMP%]:last-child{margin-bottom:0}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .strategy-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;margin:12px 0}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .strategy-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-align:left;padding:10px 12px;font-size:14px;font-weight:500;color:var(--mat-sys-on-surface);border-bottom:2px solid var(--mat-sys-outline)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .strategy-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-outline-variant)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .strategy-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child{border-bottom:none}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .strategy-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:10px 12px;font-size:14px;color:var(--mat-sys-on-surface-variant)}.help-content[_ngcontent-%COMP%] .help-section[_ngcontent-%COMP%] .strategy-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:500}"],changeDetection:0})}return n})();var NEe=(n,i)=>i.id,sO=(n,i)=>i.value;function FEe(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),j(e.getErrorMessage("name"))}}function REe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e.id),m(),ee(" ",e.label," ")}}function LEe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function VEe(n,i){if(n&1){let e=z();s(0,"mat-form-field",13)(1,"mat-label"),d(2,"Model Name"),l(),s(3,"mat-select",15),g("selectionChange",function(o){k(e);let r=v(2);return T(r.onModelChange(o.value))}),Y(4,LEe,2,2,"mat-option",16,Ae),l(),s(6,"mat-hint"),d(7,"Select a model from the list"),l()()}if(n&2){let e,t=v(2);m(3),C("value",(e=t.form.get("model"))==null?null:e.value),m(),Z(t.selectedPreset.models)}}function BEe(n,i){n&1&&(s(0,"mat-error"),d(1,"Model name is required"),l())}function zEe(n,i){if(n&1&&(s(0,"mat-form-field",13)(1,"mat-label"),d(2,"Model Name"),l(),R(3,"input",24),A(4,BEe,2,0,"mat-error"),s(5,"mat-hint"),d(6,"Enter your model name (e.g., gpt-4o, claude-3-5-sonnet-20241022)"),l()()),n&2){let e,t=v(2);m(4),O((e=t.form.get("model"))!=null&&e.value?-1:4)}}function jEe(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),j(e.getErrorMessage("api_key"))}}function $Ee(n,i){n&1&&(s(0,"span",18),d(1,"A saved API key exists for this configuration. Leave empty to keep it, or enter a new key to update."),l())}function HEe(n,i){n&1&&(s(0,"span"),d(1,"API key will be encrypted on the server. Minimum length: 10 characters"),l())}function UEe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.label," ")}}function GEe(n,i){if(n&1){let e=z();s(0,"div",7)(1,"div",12)(2,"h3"),d(3,"Quick Setup"),l()(),s(4,"mat-form-field",13)(5,"mat-label"),d(6,"Configuration Name"),l(),R(7,"input",14),A(8,FEe,2,1,"mat-error"),s(9,"mat-hint"),d(10,"A name to identify this configuration"),l()(),s(11,"mat-form-field",13)(12,"mat-label"),d(13,"Select LLM Provider"),l(),s(14,"mat-select",15),g("selectionChange",function(o){k(e);let r=v();return T(r.onPresetChange(o.value))}),Y(15,REe,2,2,"mat-option",16,NEe),l(),s(17,"mat-hint"),d(18,"Select a preset to auto-configure"),l()(),A(19,VEe,8,1,"mat-form-field",13),A(20,zEe,7,1,"mat-form-field",13),s(21,"mat-form-field",13)(22,"mat-label"),d(23,"API Key"),l(),R(24,"input",17),A(25,jEe,2,1,"mat-error"),s(26,"mat-hint"),A(27,$Ee,2,0,"span",18),A(28,HEe,2,0,"span"),l()(),s(29,"mat-form-field",13)(30,"mat-label"),d(31,"Copilot Mode"),l(),s(32,"mat-select",19),Y(33,UEe,2,2,"mat-option",16,sO),l(),s(35,"mat-hint"),d(36),l()(),s(37,"div",20)(38,"mat-icon",21),d(39,"info"),l(),s(40,"p")(41,"strong"),d(42,"Teaching Assistant:"),l(),d(43," Diagnostics and suggestions only. "),s(44,"strong"),d(45,"Lab Automation Assistant:"),l(),d(46," Full configuration access. "),l()(),s(47,"div",22)(48,"mat-checkbox",23),d(49," Set as default configuration "),l()()()}if(n&2){let e=v();m(8),O(e.hasError("name")?8:-1),m(6),C("value",e.selectedPresetId),m(),Z(e.basicModePresets),m(4),O(e.selectedPreset&&e.selectedPresetId!=="custom"&&!e.useCustomModel?19:-1),m(),O(e.selectedPresetId==="custom"||e.useCustomModel?20:-1),m(4),C("placeholder",e.mode==="edit"?"Leave empty to keep existing key":""),m(),O(e.hasError("api_key")?25:-1),m(2),O(e.mode==="edit"?27:-1),m(),O(e.mode==="create"?28:-1),m(5),Z(e.copilotModes),m(3),j(e.getCopilotModeDescription())}}function WEe(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),j(e.getErrorMessage("name"))}}function qEe(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),j(e.getErrorMessage("api_key"))}}function QEe(n,i){n&1&&(s(0,"mat-error"),d(1,"Model name is required"),l())}function XEe(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),j(e.getErrorMessage("temperature"))}}function KEe(n,i){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),j(e.getErrorMessage("context_limit"))}}function YEe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.label," ")}}function ZEe(n,i){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.label," ")}}function JEe(n,i){if(n&1){let e=z();s(0,"div",41)(1,"mat-form-field",42)(2,"mat-label"),d(3,"Key"),l(),R(4,"input",43),l(),s(5,"mat-form-field",44)(6,"mat-label"),d(7,"Value"),l(),R(8,"input",45),l(),s(9,"button",46),g("click",function(){let o=k(e).$index,r=v(3);return T(r.removeCustomField(o))}),s(10,"mat-icon"),d(11,"delete"),l()()()}if(n&2){let e=i.$index;C("formGroupName",e)}}function eDe(n,i){if(n&1&&(s(0,"div",39),Y(1,JEe,12,1,"div",41,Hi),l()),n&2){let e=v(2);C("formGroup",e.form),m(),Z(e.customFieldsArray.controls)}}function tDe(n,i){n&1&&(s(0,"div",40)(1,"mat-icon",47),d(2,"info"),l(),s(3,"p"),d(4,"No custom fields"),l()())}function nDe(n,i){if(n&1){let e=z();s(0,"div",8)(1,"div",25)(2,"h3"),d(3,"Custom Mode Configuration"),l(),s(4,"button",10),g("click",function(){k(e);let o=v();return T(o.openCustomModeHelp())}),s(5,"mat-icon",26),d(6,"help_outline"),l(),s(7,"span"),d(8,"Field Documentation"),l()()(),s(9,"div",12)(10,"h4"),d(11,"Basic Configuration"),l()(),s(12,"mat-form-field",13)(13,"mat-label"),d(14,"Configuration Name"),l(),R(15,"input",27),A(16,WEe,2,1,"mat-error"),l(),s(17,"mat-form-field",13)(18,"mat-label"),d(19,"Model Type"),l(),R(20,"input",28),l(),s(21,"div",12)(22,"h4"),d(23,"API Configuration"),l()(),s(24,"mat-form-field",13)(25,"mat-label"),d(26,"Model Provider"),l(),R(27,"input",29),s(28,"mat-error"),d(29,"Provider is required"),l()(),s(30,"mat-form-field",13)(31,"mat-label"),d(32,"Base URL"),l(),R(33,"input",30),l(),s(34,"mat-form-field",13)(35,"mat-label"),d(36,"API Key"),l(),R(37,"input",17),A(38,qEe,2,1,"mat-error"),l(),s(39,"mat-form-field",13)(40,"mat-label"),d(41,"Model Name"),l(),R(42,"input",31),A(43,QEe,2,0,"mat-error"),l(),s(44,"div",12)(45,"h4"),d(46,"Model Parameters"),l()(),s(47,"div",32)(48,"mat-form-field",33)(49,"mat-label"),d(50,"Temperature"),l(),R(51,"input",34),A(52,XEe,2,1,"mat-error"),l(),s(53,"mat-form-field",33)(54,"mat-label"),d(55,"Context Limit"),l(),R(56,"input",35),A(57,KEe,2,1,"mat-error"),l()(),s(58,"div",32)(59,"mat-form-field",33)(60,"mat-label"),d(61,"Context Strategy"),l(),s(62,"mat-select",36),Y(63,YEe,2,2,"mat-option",16,sO),l()(),s(65,"mat-form-field",33)(66,"mat-label"),d(67,"Copilot Mode"),l(),s(68,"mat-select",19),Y(69,ZEe,2,2,"mat-option",16,sO),l()()(),s(71,"div",22)(72,"mat-checkbox",23),d(73," Set as default configuration "),l()(),s(74,"div",37)(75,"div",12)(76,"h4"),d(77,"Advanced Parameters (Optional)"),l(),s(78,"button",38),g("click",function(){k(e);let o=v();return T(o.addCustomField())}),s(79,"mat-icon"),d(80,"add_circle"),l()()(),A(81,eDe,3,1,"div",39)(82,tDe,5,0,"div",40),l()()}if(n&2){let e,t=v();m(16),O(t.hasError("name")?16:-1),m(21),C("placeholder",t.mode==="edit"?"Leave empty to keep existing key":""),m(),O(t.hasError("api_key")?38:-1),m(5),O((e=t.form.get("model"))!=null&&e.value?-1:43),m(9),O(t.hasError("temperature")?52:-1),m(5),O(t.hasError("context_limit")?57:-1),m(6),Z(t.contextStrategies),m(6),Z(t.copilotModes),m(12),O(t.customFieldsArray.length>0?81:82)}}var iDe=[{id:"custom",label:"Custom (User Defined)",provider:"openai",baseUrl:"",models:[],defaultTemperature:.3},{id:"openrouter",label:"OpenRouter",provider:"openai",baseUrl:"https://openrouter.ai/api/v1",models:["deepseek/deepseek-v3.2","x-ai/grok-3","anthropic/claude-sonnet-4","z-ai/glm-4.7","openai/gpt-4o","google/gemini-2.5-flash"],defaultTemperature:.3,modelContextLimits:{"deepseek/deepseek-v3.2":128,"x-ai/grok-3":128,"anthropic/claude-sonnet-4":200,"z-ai/glm-4.7":200,"openai/gpt-4o":128,"google/gemini-2.5-flash":1e3}},{id:"deepseek",label:"DeepSeek",provider:"deepseek",baseUrl:"https://api.deepseek.com/v1",models:["deepseek-v4-flash","deepseek-v4-pro"],defaultTemperature:.3,modelContextLimits:{"deepseek-v4-flash":1e3,"deepseek-v4-pro":1e3}}],oDe=[{value:"text",label:"Text",description:"Text generation models"},{value:"vision",label:"Vision",description:"Image understanding models"},{value:"stt",label:"STT",description:"Speech-to-Text models"},{value:"tts",label:"TTS",description:"Text-to-Speech models"},{value:"multimodal",label:"Multimodal",description:"Multiple input types"},{value:"embedding",label:"Embedding",description:"Text embedding models"},{value:"reranking",label:"Reranking",description:"Reranking models"},{value:"other",label:"Other",description:"Other model types"}],rDe=[{value:"conservative",label:"Conservative",description:"60% of context limit"},{value:"balanced",label:"Balanced",description:"75% of context limit (default)"},{value:"aggressive",label:"Aggressive",description:"85% of context limit"}],aDe=[{value:"teaching_assistant",label:"Teaching Assistant",description:"Diagnostics only"},{value:"lab_automation_assistant",label:"Lab Automation Assistant",description:"Full configuration access"}],sDe=["name","model_type","provider","model","api_key","base_url","temperature","context_limit","context_strategy","copilot_mode","is_default"],hp=(()=>{class n{fb;dialogRef;dialog;cd;data;form;mode;existingNames;customFieldsArray;configMode="basic";providerPresets=iDe;selectedPresetId="custom";selectedPreset=null;useCustomModel=!1;get basicModePresets(){return this.providerPresets.filter(e=>e.id!=="custom")}modelTypes=oDe;contextStrategies=rDe;copilotModes=aDe;get isPresetSelected(){return this.selectedPresetId!=="custom"&&this.selectedPreset!==null}constructor(e,t,o,r,a){this.fb=e,this.dialogRef=t,this.dialog=o,this.cd=r,this.data=a,this.mode=a.mode,this.existingNames=a.existingNames,this.form=this.createForm()}ngOnInit(){if(this.mode==="edit"&&this.data.config){let e=this.data.config,t=this.form.get("api_key");t&&(t.clearValidators(),t.setValidators([Ue.minLength(10)]),t.updateValueAndValidity()),this.form.patchValue({name:e.name,model_type:e.model_type,provider:e.config.provider,model:e.config.model,api_key:"",base_url:e.config.base_url,temperature:e.config.temperature,context_limit:e.config.context_limit,context_strategy:e.config.context_strategy||"balanced",copilot_mode:e.config.copilot_mode||"teaching_assistant",is_default:e.is_default});let o=Object.entries(e.config).filter(([r])=>!sDe.includes(r)&&r!=="max_tokens");for(;this.customFieldsArray.length!==0;)this.customFieldsArray.removeAt(0);o.forEach(([r,a])=>{this.customFieldsArray.push(this.fb.group({key:[r],value:[String(a)]}))}),this.detectPresetFromConfig(),this.cd.markForCheck()}}createForm(){return this.customFieldsArray=this.fb.array([]),this.fb.group({name:["",[Ue.required,Ue.minLength(1),Ue.maxLength(100),Ue.pattern(/^[a-zA-Z0-9_-]+$/),this.duplicateNameValidator()]],model_type:["text",Ue.required],provider:["",Ue.required],model:["",Ue.required],api_key:["",[Ue.required,Ue.minLength(10)]],base_url:[""],temperature:[.7,[Ue.min(0),Ue.max(2)]],context_limit:[128,[Ue.required,Ue.min(1),Ue.max(1e4)]],context_strategy:["balanced"],copilot_mode:["teaching_assistant"],is_default:[!1],customFields:this.customFieldsArray})}duplicateNameValidator(){return e=>{let t=e.value;return t&&this.existingNames.includes(t)?{duplicateName:!0}:null}}detectPresetFromConfig(){let e=this.form.get("provider")?.value,t=this.form.get("base_url")?.value,o=this.providerPresets.find(r=>r.id!=="custom"&&r.provider===e&&r.baseUrl===t);o?(this.selectedPresetId=o.id,this.selectedPreset=o,this.setPresetMode(!0),o.models.includes(this.form.get("model")?.value)||(this.useCustomModel=!0)):(this.selectedPresetId="custom",this.selectedPreset=null,this.setPresetMode(!1))}onPresetChange(e){if(this.selectedPresetId=e,this.selectedPreset=this.providerPresets.find(t=>t.id===e)||null,this.selectedPreset&&e!=="custom"){if(this.form.get("provider")?.setValue(this.selectedPreset.provider),this.form.get("base_url")?.setValue(this.selectedPreset.baseUrl),this.selectedPreset.models.length>0){let t=this.selectedPreset.models[0];this.form.get("model")?.setValue(t),this.useCustomModel=!1,this.selectedPreset.modelContextLimits&&this.selectedPreset.modelContextLimits[t]&&this.form.get("context_limit")?.setValue(this.selectedPreset.modelContextLimits[t])}this.selectedPreset.defaultTemperature!==void 0&&this.form.get("temperature")?.setValue(this.selectedPreset.defaultTemperature),this.setPresetMode(!0)}else this.setPresetMode(!1)}setPresetMode(e){e?(this.form.get("provider")?.disable(),this.form.get("base_url")?.disable()):(this.form.get("provider")?.enable(),this.form.get("base_url")?.enable())}onModelChange(e){e==="__custom__"?(this.useCustomModel=!0,this.form.get("model")?.setValue("")):(this.useCustomModel=!1,this.form.get("model")?.setValue(e),this.selectedPreset&&this.selectedPreset.modelContextLimits&&this.selectedPreset.modelContextLimits[e]&&this.form.get("context_limit")?.setValue(this.selectedPreset.modelContextLimits[e]))}getErrorMessage(e){let t=this.form.get(e);if(!t||!t.errors)return"";let o=t.errors;return e==="name"?o.required?"Name is required":o.minlength?"Name must be at least 1 character":o.maxlength?"Name cannot exceed 100 characters":o.pattern?"Name can only contain letters, numbers, underscores and hyphens":o.duplicateName?"Name already exists":"Invalid name format":e==="api_key"?o.required?"API Key is required":o.minlength?"API Key is too short (minimum 10 characters)":"Invalid API Key format":e==="temperature"?o.min?"Temperature cannot be less than 0":o.max?"Temperature cannot be greater than 2":"Invalid temperature value":e==="context_limit"?o.required?"Context limit is required":o.min?"Context limit must be at least 1K":o.max?"Context limit cannot exceed 10000K":"Invalid context limit":o.required?"This field is required":"Invalid format"}hasError(e){let t=this.form.get(e);return t?t.invalid&&(t.dirty||t.touched):!1}getContextStrategyDescription(){let e=this.form.get("context_strategy")?.value,t=this.contextStrategies.find(o=>o.value===e);return t?t.description:""}getCopilotModeDescription(){let e=this.form.get("copilot_mode")?.value,t=this.copilotModes.find(o=>o.value===e);return t?t.description:""}addCustomField(){this.customFieldsArray.push(this.fb.group({key:[""],value:[""]}))}removeCustomField(e){this.customFieldsArray.removeAt(e)}getCustomFieldsControls(){return this.customFieldsArray.controls}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=this.form.getRawValue(),t={name:e.name,model_type:e.model_type,provider:e.provider,base_url:e.base_url||"",model:e.model,temperature:parseFloat(e.temperature),context_limit:parseInt(e.context_limit,10),context_strategy:e.context_strategy,copilot_mode:e.copilot_mode,is_default:e.is_default||!1};e.api_key&&e.api_key.trim()&&(t.api_key=e.api_key.trim()),this.customFieldsArray.controls.forEach(o=>{let r=o.get("key")?.value,a=o.get("value")?.value;r&&r.trim()&&a!==null&&a!==void 0&&a!==""&&(t[r.trim()]=a)}),this.dialogRef.close(t)}onCancel(){this.dialogRef.close()}openCustomModeHelp(){this.dialog.open(dj,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"]})}onModeChange(e){e==="basic"&&(this.form.get("temperature")?.value||this.form.patchValue({temperature:.7}),this.form.get("context_limit")?.value||this.form.patchValue({context_limit:128}),this.form.get("context_strategy")?.value||this.form.patchValue({context_strategy:"balanced"}),this.form.get("copilot_mode")?.value||this.form.patchValue({copilot_mode:"teaching_assistant"}),this.form.get("model_type")?.value||this.form.patchValue({model_type:"text"}))}static \u0275fac=function(t){return new(t||n)(ot(CC),ot(Ie),ot(nt),ot(Q),ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-ai-profile-dialog"]],decls:26,vars:7,consts:[["mat-dialog-title",""],[1,"config-form",3,"formGroup"],[1,"mode-selector"],[3,"valueChange","change","value"],["value","basic"],["value","custom"],["mat-icon-button","","matTooltip","Basic Mode: Select preset models | Custom Mode: Full control over all parameters",1,"help-icon"],[1,"basic-mode"],[1,"custom-mode"],["align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"section-header"],["appearance","outline",1,"full-width"],["matInput","","formControlName","name","placeholder","e.g.: my-gpt4-config"],[3,"selectionChange","value"],[3,"value"],["matInput","","formControlName","api_key","type","password","autocomplete","off",3,"placeholder"],[1,"existing-key-hint"],["formControlName","copilot_mode"],[1,"mode-info"],[1,"info-icon"],[1,"checkbox-section"],["formControlName","is_default","color","primary"],["matInput","","formControlName","model","placeholder","Enter model name"],[1,"custom-mode-header"],[1,"help-icon"],["matInput","","formControlName","name","placeholder","e.g.: gpt-4o-config"],["matInput","","formControlName","model_type","value","text","readonly",""],["matInput","","formControlName","provider","placeholder","e.g.: openai, anthropic, ollama"],["matInput","","formControlName","base_url","placeholder","e.g.: https://api.openai.com/v1"],["matInput","","formControlName","model","placeholder","e.g.: gpt-4o, deepseek-v4-flash, claude-sonnet-4"],[1,"row"],["appearance","outline",1,"half-width"],["matInput","","formControlName","temperature","type","number","step","0.1","min","0","max","2","placeholder","0.7"],["matInput","","formControlName","context_limit","type","number","min","1","max","10000","placeholder","128"],["formControlName","context_strategy"],[1,"custom-fields-section"],["mat-icon-button","",3,"click"],["formArrayName","customFields",1,"custom-fields-list",3,"formGroup"],[1,"empty-custom-fields"],[1,"custom-field-row",3,"formGroupName"],["appearance","outline",1,"field-key"],["matInput","","formControlName","key"],["appearance","outline",1,"field-value"],["matInput","","formControlName","value"],["mat-icon-button","","color","warn",1,"delete-btn",3,"click"],[1,"empty-icon"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content")(3,"form",1)(4,"div",2)(5,"mat-button-toggle-group",3),ac("valueChange",function(a){return rc(o.configMode,a)||(o.configMode=a),a}),g("change",function(a){return o.onModeChange(a.value)}),s(6,"mat-button-toggle",4)(7,"mat-icon"),d(8,"stars"),l(),s(9,"span"),d(10,"Basic Mode"),l()(),s(11,"mat-button-toggle",5)(12,"mat-icon"),d(13,"tune"),l(),s(14,"span"),d(15,"Custom Mode"),l()()(),s(16,"button",6)(17,"mat-icon"),d(18,"help_outline"),l()()(),A(19,GEe,50,9,"div",7),A(20,nDe,83,7,"div",8),l()(),s(21,"mat-dialog-actions",9)(22,"button",10),g("click",function(){return o.onCancel()}),d(23,"Cancel"),l(),s(24,"button",11),g("click",function(){return o.onSubmit()}),d(25),l()()),t&2&&(m(),ee(" ",o.mode==="create"?"Create LLM Model Configuration":"Edit LLM Model Configuration",`
`),m(2),C("formGroup",o.form),m(2),oc("value",o.configMode),m(14),O(o.configMode==="basic"?19:-1),m(),O(o.configMode==="custom"?20:-1),m(4),C("disabled",o.form.invalid),m(),ee(" ",o.mode==="create"?"Create":"Save"," "))},dependencies:[ne,Dt,at,Ft,_r,Pt,rt,dc,Xu,Rt,zt,a4,s4,_e,Ne,Fe,bt,DC,$4,H4,ie,de,we,Me,et,MC,fi,Se,Ee,vt,At,_t,Fo,Ot,Gt,W,pe,je,wt,It,Mt],styles:['.config-form[_ngcontent-%COMP%] .full-width[_ngcontent-%COMP%]{width:100%;margin-bottom:12px}.config-form[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{margin-top:16px;margin-bottom:16px}.config-form[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:600;color:var(--mat-sys-primary)}.config-form[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%]{display:inline-flex;vertical-align:middle;width:18px;height:18px;margin-left:4px}.config-form[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--mat-sys-on-surface-variant)}.config-form[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.config-form[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex;gap:12px;margin-bottom:12px}.config-form[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .half-width[_ngcontent-%COMP%]{flex:1;min-width:0}.config-form[_ngcontent-%COMP%] .checkbox-section[_ngcontent-%COMP%]{margin:16px 0}.config-form[_ngcontent-%COMP%] .checkbox-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block}.config-form[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);font-size:14px}.config-form[_ngcontent-%COMP%] .existing-key-hint[_ngcontent-%COMP%]{color:var(--mat-sys-primary);font-size:12px}.config-form[_ngcontent-%COMP%] .warning-hint[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);font-size:14px}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%]{margin-top:16px;padding-top:16px;border-top:1px solid var(--mat-sys-outline-variant)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:500;color:var(--mat-sys-on-surface)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;transition:all .2s cubic-bezier(.4,0,.2,1);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;position:relative}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:before{content:"";position:absolute;width:100%;height:100%;border-radius:50%;background-color:currentColor;opacity:0;transition:opacity .2s cubic-bezier(.4,0,.2,1);transform:scale(.75)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:24px;width:24px;height:24px;transition:transform .2s cubic-bezier(.4,0,.2,1);position:relative;z-index:1}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:before{opacity:1;background-color:var(--mat-sys-primary-container)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);transform:scale(1.1)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-description[_ngcontent-%COMP%]{margin-bottom:16px}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .section-description[_ngcontent-%COMP%] .reserved-field-hint[_ngcontent-%COMP%]{margin:0;font-size:14px;color:var(--mat-sys-on-surface-variant);font-style:italic}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%] .field-key[_ngcontent-%COMP%], .config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%] .field-value[_ngcontent-%COMP%]{flex:1;min-width:150px}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-top:12px;width:40px;height:40px;padding:8px;transition:all .2s cubic-bezier(.4,0,.2,1);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;position:relative}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:before{content:"";position:absolute;width:100%;height:100%;border-radius:50%;background-color:currentColor;opacity:0;transition:opacity .2s cubic-bezier(.4,0,.2,1);transform:scale(.75)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:24px;width:24px;height:24px;transition:transform .2s cubic-bezier(.4,0,.2,1);position:relative;z-index:1}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%] button.delete-btn[_ngcontent-%COMP%]:hover:before{opacity:1;background-color:var(--mat-sys-error-container)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .custom-fields-list[_ngcontent-%COMP%] .custom-field-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.1)}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .empty-custom-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;color:var(--mat-sys-on-surface-variant);text-align:center}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .empty-custom-fields[_ngcontent-%COMP%] .empty-icon[_ngcontent-%COMP%]{font-size:40px;margin-bottom:8px;opacity:.5}.config-form[_ngcontent-%COMP%] .custom-fields-section[_ngcontent-%COMP%] .empty-custom-fields[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:14px}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin-bottom:24px;padding:8px 0}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] mat-button-toggle-group[_ngcontent-%COMP%]{flex:1;display:flex}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] mat-button-toggle-group[_ngcontent-%COMP%] .mat-button-toggle[_ngcontent-%COMP%]{flex:1}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] mat-button-toggle-group[_ngcontent-%COMP%] .mat-button-toggle[_ngcontent-%COMP%] .mat-button-toggle-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 16px}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] mat-button-toggle-group[_ngcontent-%COMP%] .mat-button-toggle[_ngcontent-%COMP%] .mat-button-toggle-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;height:20px;width:20px}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] mat-button-toggle-group[_ngcontent-%COMP%] .mat-button-toggle[_ngcontent-%COMP%] .mat-button-toggle-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;font-weight:500}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%]{flex-shrink:0}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;height:20px;width:20px;color:var(--mat-sys-on-surface-variant)}.config-form[_ngcontent-%COMP%] .mode-selector[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.config-form[_ngcontent-%COMP%] .basic-mode[_ngcontent-%COMP%] .mode-info[_ngcontent-%COMP%]{display:flex;gap:12px;padding:12px;margin-top:16px;background:var(--mat-sys-surface-container);border:1px solid var(--mat-sys-outline-variant);border-radius:8px}.config-form[_ngcontent-%COMP%] .basic-mode[_ngcontent-%COMP%] .mode-info[_ngcontent-%COMP%] .info-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--mat-sys-on-surface-variant);font-size:20px;height:20px;width:20px;margin-top:2px}.config-form[_ngcontent-%COMP%] .basic-mode[_ngcontent-%COMP%] .mode-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:14px;color:var(--mat-sys-on-surface-variant);line-height:1.5}.config-form[_ngcontent-%COMP%] .basic-mode[_ngcontent-%COMP%] .mode-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface)}.config-form[_ngcontent-%COMP%] .custom-mode[_ngcontent-%COMP%] .custom-mode-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding:16px;background:var(--mat-sys-surface-container);border-radius:8px}.config-form[_ngcontent-%COMP%] .custom-mode[_ngcontent-%COMP%] .custom-mode-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:600;color:var(--mat-sys-on-surface)}.config-form[_ngcontent-%COMP%] .custom-mode[_ngcontent-%COMP%] .custom-mode-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.config-form[_ngcontent-%COMP%] .custom-mode[_ngcontent-%COMP%] .custom-mode-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.config-form[_ngcontent-%COMP%] .custom-mode[_ngcontent-%COMP%] .custom-mode-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;font-weight:500}'],changeDetection:0})}return n})();var lDe=(n,i)=>i.name;function cDe(n,i){if(n&1&&(s(0,"p"),d(1),l()),n&2){let e=v();m(),j(e.data.message)}}function dDe(n,i){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=i.$implicit;m(),ui("",e.name,"",e.description?" ("+e.description+")":"")}}function mDe(n,i){if(n&1&&(s(0,"ul"),Y(1,dDe,2,2,"li",null,lDe),l()),n&2){let e=v();m(),Z(e.data.items)}}var wg=(()=>{class n{dialogRef=f(Ie);data=f(gt);onConfirm(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-confirm-dialog"]],decls:10,vars:5,consts:[["mat-dialog-title",""],["align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content"),A(3,cDe,2,1,"p"),A(4,mDe,3,0,"ul"),l(),s(5,"mat-dialog-actions",1)(6,"button",2),g("click",function(){return o.onCancel()}),d(7),l(),s(8,"button",3),g("click",function(){return o.onConfirm()}),d(9),l()()),t&2&&(m(),j(o.data.title),m(2),O(o.data.message?3:-1),m(),O(o.data.items!=null&&o.data.items.length?4:-1),m(3),ee(" ",o.data.cancelText||"Cancel"," "),m(2),ee(" ",o.data.confirmText||"Confirm"," "))},dependencies:[_e,Ne,Fe,bt,W,pe],encapsulation:2,changeDetection:0})}return n})();function pDe(n,i){n&1&&(s(0,"div",8),R(1,"mat-spinner",10),s(2,"p"),d(3,"Loading..."),l()())}function uDe(n,i){n&1&&(s(0,"th",24),d(1,"Name"),l())}function hDe(n,i){n&1&&(s(0,"mat-icon",26),d(1,"group"),l())}function fDe(n,i){if(n&1&&(s(0,"span",28),d(1),l()),n&2){let e=v().$implicit;m(),j(e.group_name)}}function gDe(n,i){if(n&1&&(s(0,"td",25),A(1,hDe,2,0,"mat-icon",26),s(2,"span",27),d(3),l(),A(4,fDe,2,1,"span",28),l()),n&2){let e=i.$implicit;m(),O(e.source==="group"?1:-1),m(2),j(e.name),m(),O(e.source==="group"?4:-1)}}function _De(n,i){n&1&&(s(0,"th",24),d(1,"API Domain"),l())}function vDe(n,i){if(n&1&&(s(0,"td",25)(1,"span",29),d(2),l()()),n&2){let e=i.$implicit,t=v(3);m(2),j(t.getProviderDisplay(e))}}function CDe(n,i){n&1&&(s(0,"th",24),d(1,"Model"),l())}function bDe(n,i){if(n&1&&(s(0,"td",25)(1,"span",30),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.config.model)}}function xDe(n,i){n&1&&(s(0,"th",24),d(1,"Context Limit"),l())}function yDe(n,i){if(n&1&&(s(0,"span",32),d(1),l()),n&2){let e=v().$implicit;m(),ee(" ",e.config.context_strategy," ")}}function SDe(n,i){if(n&1&&(s(0,"td",25)(1,"span",31),d(2),l(),A(3,yDe,2,1,"span",32),l()),n&2){let e=i.$implicit;m(2),ee("",e.config.context_limit,"K"),m(),O(e.config.context_strategy?3:-1)}}function wDe(n,i){n&1&&(s(0,"th",24),d(1,"Actions"),l())}function MDe(n,i){if(n&1){let e=z();s(0,"td",25)(1,"div",33)(2,"button",34),en(3,"async"),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.toggleDefaultConfig(o))}),s(4,"mat-icon"),d(5,"check_circle"),l()(),s(6,"button",34),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.openEditDialog(o))}),s(7,"mat-icon"),d(8,"edit"),l()(),s(9,"button",35),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.deleteConfig(o))}),s(10,"mat-icon"),d(11,"delete"),l()()()()}if(n&2){let e,t=i.$implicit,o=v(3);m(2),Be("active-btn",o.isDefault(t)),C("disabled",((e=jn(3,5,o.settingDefault$))==null?null:e.has(t.config_id))||!o.isEditable(t)),m(4),C("disabled",!o.isEditable(t)),m(3),C("disabled",!o.isEditable(t))}}function kDe(n,i){n&1&&R(0,"tr",36)}function TDe(n,i){if(n&1&&R(0,"tr",37),n&2){let e=i.$implicit,t=v(3);Be("active-row",t.isDefault(e))("inherited-row",e.source==="group")}}function EDe(n,i){if(n&1&&(s(0,"div",12)(1,"table",14),Le(2,15),xe(3,uDe,2,0,"th",16)(4,gDe,5,3,"td",17),Ve(),Le(5,18),xe(6,_De,2,0,"th",16)(7,vDe,3,1,"td",17),Ve(),Le(8,19),xe(9,CDe,2,0,"th",16)(10,bDe,3,1,"td",17),Ve(),Le(11,20),xe(12,xDe,2,0,"th",16)(13,SDe,4,2,"td",17),Ve(),Le(14,21),xe(15,wDe,2,0,"th",16)(16,MDe,12,7,"td",17),Ve(),xe(17,kDe,1,0,"tr",22)(18,TDe,1,4,"tr",23),l()()),n&2){let e=v(2);m(),C("dataSource",e.configs()),m(16),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns)}}function DDe(n,i){n&1&&(s(0,"div",13)(1,"mat-icon",38),d(2,"folder_open"),l(),s(3,"p"),d(4,"No configurations yet"),l(),s(5,"p",39),d(6,'Click "New Configuration" above to create your first LLM model configuration'),l()())}function PDe(n,i){if(n&1&&(s(0,"div",9)(1,"mat-card",11)(2,"mat-card-header")(3,"mat-card-title"),d(4,"All Configurations (Own + Inherited)"),l()(),s(5,"mat-card-content"),A(6,EDe,19,3,"div",12),A(7,DDe,7,0,"div",13),l()()()),n&2){let e=v();m(6),O(e.configs().length>0?6:-1),m(),O(e.configs().length===0?7:-1)}}var dM=(()=>{class n{destroy$=new He;controller=le(void 0);user=le(void 0);loading$=new an(!1);settingDefault$=new an(new Set);error$=new an(null);configs$=new an([]);defaultConfig$=new an(null);configs=ae([]);defaultConfig=ae(null);settingDefaultConfigs=new Set;displayedColumns=["name","provider","model","context_limit","actions"];aiProfilesService=f(ug);dialog=f(nt);snackBar=f(vr);constructor(){}ngOnInit(){if(!this.controller()||!this.user()){console.error("AiProfileTabComponent: controller or user inputs are not set");return}this.loadConfigs(),Pr([this.configs$,this.defaultConfig$]).pipe(tt(this.destroy$)).subscribe(([e,t])=>{this.configs.set(e),this.defaultConfig.set(t)}),this.error$.pipe(tt(this.destroy$),ai(e=>e!==null)).subscribe(e=>{this.showError(e)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadConfigs(){this.loading$.next(!0),this.error$.next(null),this.aiProfilesService.getConfigs(this.controller(),this.user().user_id).pipe(tt(this.destroy$)).subscribe({next:e=>{this.configs$.next(e.configs),this.defaultConfig$.next(e.default_config),this.loading$.next(!1)},error:e=>{this.handleError(e,"Failed to load configurations")}})}isEditable(e){return e.source==="user"}getProviderDisplay(e){let t=e.config.base_url;if(!t)return e.config.provider;try{return new URL(t).hostname.replace(/^api\./,"")}catch{return e.config.provider}}isDefault(e){return this.defaultConfig()?.config_id===e.config_id}getSourceDisplay(e){return e.source==="group"?`Group: ${e.group_name||"Unknown"}`:"User"}openCreateDialog(){this.dialog.open(hp,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"],data:{mode:"create",config:null,existingNames:this.configs().filter(t=>t.source==="user").map(t=>t.name)}}).afterClosed().pipe(tt(this.destroy$)).subscribe(t=>{t&&this.createConfig(t)})}openEditDialog(e){this.dialog.open(hp,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"],data:{mode:"edit",config:K({},e),existingNames:this.configs().filter(o=>o.source==="user"&&o.config_id!==e.config_id).map(o=>o.name)}}).afterClosed().pipe(tt(this.destroy$)).subscribe(o=>{o&&this.updateConfig(e.config_id,o)})}createConfig(e){this.loading$.next(!0),this.aiProfilesService.createConfig(this.controller(),this.user().user_id,e).pipe(tt(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration created successfully")},error:t=>{this.handleError(t,"Failed to create configuration")}})}updateConfig(e,t){this.loading$.next(!0),this.aiProfilesService.updateConfig(this.controller(),this.user().user_id,e,t).pipe(tt(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration updated successfully")},error:o=>{o.status===409?this.handleConflict(o):this.handleError(o,"Failed to update configuration")}})}deleteConfig(e){this.dialog.open(wg,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{title:"Delete Configuration",message:`Are you sure you want to delete configuration "${e.name}"? This action cannot be undone.`,confirmText:"Delete",cancelText:"Cancel"}}).afterClosed().pipe(tt(this.destroy$)).subscribe(o=>{o&&(this.loading$.next(!0),this.aiProfilesService.deleteConfig(this.controller(),this.user().user_id,e.config_id).pipe(tt(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration deleted successfully")},error:r=>{this.handleError(r,"Failed to delete configuration")}}))})}toggleDefaultConfig(e){let t=e.config_id;if(this.settingDefaultConfigs.has(t))return;let o=e.is_default,r=this.defaultConfig(),a=[...this.configs()],c=a.map(p=>it(K({},p),{is_default:o?!1:p.config_id===t}));this.configs.set(c),this.defaultConfig.set(o?null:e),this.settingDefaultConfigs.add(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),o?this.aiProfilesService.unsetDefaultConfig(this.controller(),this.user().user_id,t).pipe(tt(this.destroy$)).subscribe({next:()=>{this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),this.showSuccess("Default configuration removed"),this.loadConfigsWithoutLoading()},error:p=>{this.configs.set(a),this.defaultConfig.set(r),this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),p.status===409?this.handleConflict(p):this.handleError(p,"Failed to remove default configuration")}}):this.aiProfilesService.setDefaultConfig(this.controller(),this.user().user_id,t).pipe(tt(this.destroy$)).subscribe({next:()=>{this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),this.showSuccess("Default configuration set successfully"),this.loadConfigsWithoutLoading()},error:p=>{this.configs.set(a),this.defaultConfig.set(r),this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),p.status===409?this.handleConflict(p):this.handleError(p,"Failed to set default configuration")}})}loadConfigsWithoutLoading(){this.error$.next(null),this.aiProfilesService.getConfigs(this.controller(),this.user().user_id).pipe(tt(this.destroy$)).subscribe({next:e=>{this.configs$.next(e.configs),this.defaultConfig$.next(e.default_config)},error:e=>{this.handleError(e,"Failed to refresh configurations")}})}handleConflict(e){this.loadConfigs(),this.showWarning("Data has been modified by another user, auto-refreshed")}handleError(e,t){console.error(`${t}:`,e);let o=t;e?.error?.detail?o=e.error.detail:e?.message&&(o=e.message),this.error$.next(o),this.loading$.next(!1),this.showError(o)}showSuccess(e){this.snackBar.open(e,"Close",{duration:3e3,panelClass:["success-snackbar"]})}showWarning(e){this.snackBar.open(e,"Close",{duration:5e3,panelClass:["warning-snackbar"]})}showError(e){this.snackBar.open(e,"Close",{duration:5e3,panelClass:["error-snackbar"]})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ai-profile-tab"]],inputs:{controller:[1,"controller"],user:[1,"user"]},decls:23,vars:9,consts:[[1,"ai-profile-container"],[1,"toolbar"],[1,"toolbar-info"],[1,"compatibility-badge"],[1,"subtitle"],[1,"toolbar-actions"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click"],[1,"loading-container"],[1,"content-area"],["diameter","40"],[1,"list-card"],[1,"table-container"],[1,"empty-state"],["mat-table","",1,"profiles-table",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","provider"],["matColumnDef","model"],["matColumnDef","context_limit"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"active-row","inherited-row",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],[1,"group-icon"],[1,"profile-name"],[1,"group-badge"],[1,"provider-badge"],[1,"model-name"],[1,"context-limit-value"],[1,"context-strategy-badge"],[1,"action-buttons"],["mat-icon-button","",3,"click","disabled"],["mat-icon-button","","color","warn",1,"delete-btn",3,"click","disabled"],["mat-header-row",""],["mat-row",""],[1,"empty-icon"],[1,"empty-hint"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3"),d(4,"LLM Model Configurations "),s(5,"span",3),d(6,"OpenAI-Compatible"),l()(),s(7,"p",4),d(8," Manage OpenAI-compatible LLM model configurations. Your configs and configs inherited from your groups are shown below. "),l()(),s(9,"div",5)(10,"button",6),en(11,"async"),g("click",function(){return o.loadConfigs()}),s(12,"mat-icon"),d(13,"refresh"),l(),d(14," Refresh "),l(),s(15,"button",7),g("click",function(){return o.openCreateDialog()}),s(16,"mat-icon"),d(17,"add"),l(),d(18," New Configuration "),l()()(),A(19,pDe,4,0,"div",8),en(20,"async"),A(21,PDe,8,2,"div",9),en(22,"async"),l()),t&2&&(m(10),C("disabled",jn(11,3,o.loading$)),m(9),O(jn(20,5,o.loading$)?19:-1),m(2),O(jn(22,7,o.loading$)?-1:21))},dependencies:[ne,_e,Ya,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W,pe,je,ie,de,we,Se,vt,Ot,Mt,On,ll,Nc,Oc,pn,li,zr],styles:['.ai-profile-container[_ngcontent-%COMP%]{padding:20px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;font-size:18px;font-weight:500;display:flex;align-items:center;gap:12px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-info[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{margin:0;font-size:13px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-info[_ngcontent-%COMP%] .compatibility-badge[_ngcontent-%COMP%]{display:inline-block;padding:2px 10px;font-size:11px;font-weight:600;letter-spacing:.3px;background:var(--mat-sys-primary-container);color:var(--mat-sys-primary);border-radius:12px;line-height:20px;text-transform:uppercase}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-actions[_ngcontent-%COMP%]{display:flex;gap:8px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.ai-profile-container[_ngcontent-%COMP%] .loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px}.ai-profile-container[_ngcontent-%COMP%] .loading-container[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{margin-bottom:16px}.ai-profile-container[_ngcontent-%COMP%] .loading-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-header[_ngcontent-%COMP%] mat-card-title[_ngcontent-%COMP%]{font-size:16px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{padding:0}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow-x:auto}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%]{width:100%}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-header-row[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:500}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-outline-variant)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 8%,transparent)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.inherited-row[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.inherited-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-secondary)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.inherited-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-secondary) 12%,var(--mat-sys-secondary-container))}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.active-row[_ngcontent-%COMP%]{background-color:var(--mat-sys-tertiary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.active-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-tertiary)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.active-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-tertiary) 12%,var(--mat-sys-tertiary-container))}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;margin-right:6px;color:var(--mat-sys-secondary);vertical-align:middle}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .group-badge[_ngcontent-%COMP%]{display:inline-block;margin-left:8px;padding:2px 6px;background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-secondary-container);border-radius:4px;font-size:11px;font-weight:500;vertical-align:middle}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .name-cell[_ngcontent-%COMP%] .profile-name[_ngcontent-%COMP%]{font-weight:500}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .provider-badge[_ngcontent-%COMP%]{padding:4px 8px;background:var(--mat-sys-primary-container);border-radius:4px;font-size:12px;color:var(--mat-sys-on-primary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .model-name[_ngcontent-%COMP%]{font-family:monospace;font-size:13px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .temperature-value[_ngcontent-%COMP%]{font-family:monospace;font-size:13px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex;gap:4px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:32px;height:32px;padding:6px;transition:all .2s cubic-bezier(.4,0,.2,1);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;position:relative}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:before{content:"";position:absolute;width:100%;height:100%;border-radius:50%;background-color:currentColor;opacity:0;transition:opacity .2s cubic-bezier(.4,0,.2,1);transform:scale(.75)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;transition:transform .2s cubic-bezier(.4,0,.2,1);position:relative;z-index:1}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.active-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-tertiary)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.active-btn[_ngcontent-%COMP%]:hover:before{opacity:1;background-color:var(--mat-sys-tertiary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.active-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.35)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(.active-btn):not(.delete-btn):hover:before{opacity:1;background-color:var(--mat-sys-primary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(.active-btn):not(.delete-btn):hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);transform:scale(1.35)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.delete-btn[_ngcontent-%COMP%]:hover:before{opacity:1;background-color:var(--mat-sys-error-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.delete-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.35)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] .empty-icon[_ngcontent-%COMP%]{font-size:64px;margin-bottom:16px;opacity:.3}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] p.empty-hint[_ngcontent-%COMP%]{font-size:13px}'],changeDetection:0})}return n})();var mM=(()=>{class n{dialogRef=f(Ie);data=f(gt);close(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-ai-profile-dialog"]],decls:7,vars:3,consts:[["mat-dialog-title",""],[3,"controller","user"],["mat-button","",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content"),R(3,"app-ai-profile-tab",1),l(),s(4,"mat-dialog-actions")(5,"button",2),g("click",function(){return o.close()}),d(6,"Close"),l()()),t&2&&(m(),ee("AI Profiles - ",o.data.user.username),m(2),C("controller",o.data.controller)("user",o.data.user))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,ie,dM],styles:[".ai-profile-dialog__content[_ngcontent-%COMP%]{padding:16px 0}"],changeDetection:0})}return n})();var mj=(()=>{class n{httpController;constructor(e){this.httpController=e}list(e){return this.httpController.get(e,"/access/api-keys")}create(e,t){return this.httpController.post(e,"/access/api-keys",{name:t})}revoke(e,t){return this.httpController.post(e,`/access/api-keys/${t}/revoke`,null)}restore(e,t){return this.httpController.post(e,`/access/api-keys/${t}/restore`,null)}delete(e,t){return this.httpController.delete(e,`/access/api-keys/${t}`)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var pj=(()=>{class n{dialogRef=f(Ie);name=U("");onCancel(){this.dialogRef.close()}onSubmit(){let e=this.name().trim();e&&this.dialogRef.close(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-api-key-dialog"]],inputs:{name:[1,"name"]},outputs:{name:"nameChange"},decls:12,vars:2,consts:[["mat-dialog-title",""],["appearance","outline",1,"form-field"],["matInput","","placeholder","e.g. MCP Production","required","",3,"input","keyup.enter","value"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","","color","primary",3,"click","disabled"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1,"Create API Key"),l(),s(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"mat-label"),d(5,"Key name"),l(),s(6,"input",2),g("input",function(a){return o.name.set(a.target.value)})("keyup.enter",function(){return o.onSubmit()}),l()()(),s(7,"mat-dialog-actions",3)(8,"button",4),g("click",function(){return o.onCancel()}),d(9,"Cancel"),l(),s(10,"button",5),g("click",function(){return o.onSubmit()}),d(11,"Create"),l()()),t&2&&(m(6),C("value",o.name()),m(4),C("disabled",!o.name().trim()))},dependencies:[ne,Xe,_e,Ne,Fe,bt,W,pe,we,Me,et,Se,Ee],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var uj=(()=>{class n{data;dialogRef=f(Ie);snackBar=f(vr);clipboard=f(N2);constructor(e){this.data=e}copyKey(){let e=this.data.response.api_key;this.clipboard.copy(e)?this.snackBar.open("API key copied to clipboard","Close",{duration:3e3}):this.snackBar.open("Failed to copy. Please copy the key manually.","Close",{duration:5e3})}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-api-key-display-dialog"]],decls:29,vars:3,consts:[["mat-dialog-title",""],[1,"info-note"],[1,"detail-row"],[1,"detail-row__label"],[1,"detail-row__value"],[1,"detail-row__value","detail-row__value--key"],["mat-icon-button","","matTooltip","Copy to clipboard",3,"click"],["align","end"],["mat-flat-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1,"API Key Created"),l(),s(2,"mat-dialog-content")(3,"p",1)(4,"mat-icon"),d(5,"warning"),l(),d(6," This key will only be shown once. Copy it now \u2014 you cannot retrieve it later. "),l(),s(7,"div",2)(8,"span",3),d(9,"Name"),l(),s(10,"span",4),d(11),l()(),s(12,"div",2)(13,"span",3),d(14,"API Key"),l(),s(15,"div",5)(16,"code"),d(17),l(),s(18,"button",6),g("click",function(){return o.copyKey()}),s(19,"mat-icon"),d(20,"content_copy"),l()()()(),s(21,"div",2)(22,"span",3),d(23,"Created"),l(),s(24,"span",4),d(25),l()()(),s(26,"mat-dialog-actions",7)(27,"button",8),g("click",function(){return o.onClose()}),d(28,"I've saved the key"),l()()),t&2&&(m(11),j(o.data.response.name),m(6),j(o.data.response.api_key),m(8),j(o.data.response.created_at))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,je,ie,de,Ya],styles:[".info-note[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--mat-sys-on-surface-variant);background:var(--mat-sys-surface-container-high);padding:12px;border-radius:8px;margin:0 0 20px}.info-note[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.detail-row[_ngcontent-%COMP%]{margin-bottom:16px}.detail-row__label[_ngcontent-%COMP%]{display:block;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant);margin-bottom:4px}.detail-row__value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.detail-row__value--key[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.detail-row__value--key[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{flex:1;padding:8px 12px;background:var(--mat-sys-surface-container-highest);border-radius:4px;font-family:monospace;font-size:13px;word-break:break-all;user-select:all}"],changeDetection:0})}return n})();function IDe(n,i){n&1&&(s(0,"div",3),R(1,"mat-progress-spinner",8),l())}function ADe(n,i){if(n&1){let e=z();s(0,"div",4)(1,"mat-icon"),d(2,"vpn_key"),l(),s(3,"p"),d(4,"No API keys yet"),l(),s(5,"button",9),g("click",function(){k(e);let o=v();return T(o.onCreate())}),d(6,"Create your first API key"),l()()}}function ODe(n,i){n&1&&(s(0,"mat-header-cell",26),d(1,"Name"),l())}function NDe(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}function FDe(n,i){n&1&&(s(0,"mat-header-cell",27),d(1,"Key Prefix"),l())}function RDe(n,i){if(n&1&&(s(0,"mat-cell",27)(1,"code"),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.key_prefix)}}function LDe(n,i){n&1&&(s(0,"mat-header-cell",26),d(1,"Created"),l())}function VDe(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.created_at)}}function BDe(n,i){n&1&&(s(0,"mat-header-cell",28),d(1,"Status"),l())}function zDe(n,i){n&1&&(s(0,"span",29),d(1,"Revoked"),l())}function jDe(n,i){n&1&&(s(0,"span",30),d(1,"Active"),l())}function $De(n,i){if(n&1&&(s(0,"mat-cell",28),A(1,zDe,2,0,"span",29)(2,jDe,2,0,"span",30),l()),n&2){let e=i.$implicit;m(),O(e.revoked?1:2)}}function HDe(n,i){n&1&&(s(0,"mat-header-cell",31),d(1,"Actions"),l())}function UDe(n,i){if(n&1){let e=z();s(0,"button",33),g("click",function(){k(e);let o=v().$implicit,r=v(2);return T(r.onRevoke(o))}),s(1,"mat-icon"),d(2,"block"),l()()}}function GDe(n,i){if(n&1){let e=z();s(0,"button",34),g("click",function(){k(e);let o=v().$implicit,r=v(2);return T(r.onRestore(o))}),s(1,"mat-icon"),d(2,"restart_alt"),l()(),s(3,"button",35),g("click",function(){k(e);let o=v().$implicit,r=v(2);return T(r.onPermanentDelete(o))}),s(4,"mat-icon"),d(5,"delete_forever"),l()()}}function WDe(n,i){if(n&1&&(s(0,"mat-cell",31),A(1,UDe,3,0,"button",32)(2,GDe,6,0),l()),n&2){let e=i.$implicit;m(),O(e.revoked?2:1)}}function qDe(n,i){n&1&&R(0,"mat-header-row")}function QDe(n,i){if(n&1&&R(0,"mat-row"),n&2){let e=i.$implicit;Be("mat-row--revoked",e.revoked)}}function XDe(n,i){if(n&1){let e=z();s(0,"table",10),g("matSortChange",function(o){k(e);let r=v();return T(r.onSortChange(o))}),Le(1,11),xe(2,ODe,2,0,"mat-header-cell",12)(3,NDe,2,1,"mat-cell",13),Ve(),Le(4,14),xe(5,FDe,2,0,"mat-header-cell",15)(6,RDe,3,1,"mat-cell",16),Ve(),Le(7,17),xe(8,LDe,2,0,"mat-header-cell",12)(9,VDe,2,1,"mat-cell",13),Ve(),Le(10,18),xe(11,BDe,2,0,"mat-header-cell",19)(12,$De,3,1,"mat-cell",20),Ve(),Le(13,21),xe(14,HDe,2,0,"mat-header-cell",22)(15,WDe,3,1,"mat-cell",23),Ve(),xe(16,qDe,1,0,"mat-header-row",24)(17,QDe,1,2,"mat-row",25),l()}if(n&2){let e=v();C("dataSource",e.dataSource),m(16),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns)}}var hj=(()=>{class n{data;dialogRef=f(Ie);apiKeyService=f(mj);toasterService=f(te);dialog=f(nt);destroyRef=f(Pl);displayedColumns=["name","key_prefix","created_at","status","actions"];_keys=ae([]);isLoading=ae(!0);_sortActive=ae("");_sortDirection=ae("");sortedKeys=Jt(()=>{let e=this._keys(),t=this._sortActive(),o=this._sortDirection();return!t||!o?e:[...e].sort((r,a)=>{let c=r[t],p=a[t];if(c==null)return 1;if(p==null)return-1;let u=typeof c=="string"?c.toLowerCase():c,h=typeof p=="string"?p.toLowerCase():p;return(u<h?-1:1)*(o==="asc"?1:-1)})});_sortedKeys$=jS(this.sortedKeys);dataSource=this._sortedKeys$;constructor(e){this.data=e}ngOnInit(){this.loadKeys()}onSortChange(e){this._sortActive.set(e.active),this._sortDirection.set(e.direction)}loadKeys(){this.isLoading.set(!0),this.apiKeyService.list(this.data.controller).pipe(Ls(this.destroyRef)).subscribe({next:e=>{this._keys.set(e),this.isLoading.set(!1)},error:e=>{this.isLoading.set(!1),this.toasterService.error(e.error?.message||e.message||"Failed to load API keys")}})}onCreate(){this.dialog.open(pj,{panelClass:["base-dialog-panel","simple-dialog-panel","add-api-key-dialog-panel"],autoFocus:!1,disableClose:!0}).afterClosed().pipe(ai(Boolean),Ls(this.destroyRef)).subscribe(e=>{this.apiKeyService.create(this.data.controller,e).pipe(Ls(this.destroyRef)).subscribe({next:t=>{this.loadKeys(),this.dialog.open(uj,{panelClass:["base-dialog-panel","simple-dialog-panel"],autoFocus:!1,disableClose:!0,data:{response:t}})},error:t=>{this.toasterService.error(t.error?.message||t.message||"Failed to create API key")}})})}onRevoke(e){this.dialog.open(Ns,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{title:"Revoke API Key",message:`Are you sure you want to revoke "${e.name}"? Any services using this key will immediately lose access. You can restore it later.`,confirmButtonText:"Revoke",cancelButtonText:"Cancel"}}).afterClosed().pipe(ai(Boolean),Ls(this.destroyRef)).subscribe(()=>{this.apiKeyService.revoke(this.data.controller,e.api_key_id).pipe(Ls(this.destroyRef)).subscribe({next:t=>{this.toasterService.success(t.message||"API key revoked"),this.loadKeys()},error:t=>{this.toasterService.error(t.error?.message||t.message||"Failed to revoke API key")}})})}onRestore(e){this.dialog.open(Ns,{panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],data:{title:"Restore API Key",message:`Restore "${e.name}"? It will become active again.`,confirmButtonText:"Restore",cancelButtonText:"Cancel"}}).afterClosed().pipe(ai(Boolean),Ls(this.destroyRef)).subscribe(()=>{this.apiKeyService.restore(this.data.controller,e.api_key_id).pipe(Ls(this.destroyRef)).subscribe({next:t=>{this.toasterService.success(t.message||"API key restored"),this.loadKeys()},error:t=>{this.toasterService.error(t.error?.message||t.message||"Failed to restore API key")}})})}onPermanentDelete(e){this.dialog.open(Ns,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{title:"Permanently Delete API Key",message:`Delete "${e.name}" permanently? This action cannot be undone.`,confirmButtonText:"Delete",cancelButtonText:"Cancel"}}).afterClosed().pipe(ai(Boolean),Ls(this.destroyRef)).subscribe(()=>{this.apiKeyService.delete(this.data.controller,e.api_key_id).pipe(Ls(this.destroyRef)).subscribe({next:()=>{this.toasterService.success("API key permanently deleted"),this.loadKeys()},error:t=>{this.toasterService.error(t.error?.message||t.message||"Failed to delete API key")}})})}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-api-key-management-dialog"]],decls:14,vars:1,consts:[["mat-dialog-title",""],[1,"dialog-header-actions"],["mat-flat-button","","color","primary",3,"click"],[1,"loading-container"],[1,"empty-state"],["mat-table","","matSort","",1,"keys-table",3,"dataSource"],["align","end"],["mat-button","",3,"click"],["mode","indeterminate","diameter","32"],["mat-stroked-button","","color","primary",3,"click"],["mat-table","","matSort","",1,"keys-table",3,"matSortChange","dataSource"],["matColumnDef","name"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","key_prefix"],["class","col-key-prefix",4,"matHeaderCellDef"],["class","col-key-prefix",4,"matCellDef"],["matColumnDef","created_at"],["matColumnDef","status"],["class","col-status",4,"matHeaderCellDef"],["class","col-status",4,"matCellDef"],["matColumnDef","actions"],["class","col-actions",4,"matHeaderCellDef"],["class","col-actions",4,"matCellDef"],[4,"matHeaderRowDef"],[3,"mat-row--revoked",4,"matRowDef","matRowDefColumns"],["mat-sort-header",""],[1,"col-key-prefix"],[1,"col-status"],[1,"status-badge","status-badge--revoked"],[1,"status-badge","status-badge--active"],[1,"col-actions"],["mat-icon-button","","color","warn","matTooltip","Revoke API key"],["mat-icon-button","","color","warn","matTooltip","Revoke API key",3,"click"],["mat-icon-button","","matTooltip","Restore API key",3,"click"],["mat-icon-button","","color","warn","matTooltip","Permanently delete",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1," API Keys "),s(2,"span",1)(3,"button",2),g("click",function(){return o.onCreate()}),s(4,"mat-icon"),d(5,"add"),l(),d(6," Create "),l()()(),s(7,"mat-dialog-content"),A(8,IDe,2,0,"div",3)(9,ADe,7,0,"div",4)(10,XDe,18,3,"table",5),l(),s(11,"mat-dialog-actions",6)(12,"button",7),g("click",function(){return o.onClose()}),d(13,"Close"),l()()),t&2&&(m(8),O(o.isLoading()?8:o.sortedKeys().length===0?9:10))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,je,ie,de,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,ar,mo,Tr,wt,It,pn,li],styles:[".loading-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:120px}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:160px;gap:12px;color:var(--mat-sys-on-surface-variant)}.empty-state[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;opacity:.5}.empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:15px}.keys-table[_ngcontent-%COMP%]{width:100%}.keys-table[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%], .keys-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{justify-content:center}.keys-table[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:13px;background:var(--mat-sys-surface-container-highest);padding:2px 6px;border-radius:3px}.status-badge[_ngcontent-%COMP%]{display:inline-block;padding:2px 10px;border-radius:12px;font-size:12px;font-weight:500}.status-badge--active[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}.status-badge--revoked[_ngcontent-%COMP%]{background:var(--mat-sys-error-container);color:var(--mat-sys-on-error-container)}.mat-row--revoked[_ngcontent-%COMP%]{opacity:.55}.mat-row--revoked[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]{text-decoration:line-through}.mat-column-created_at[_ngcontent-%COMP%]{flex:0 0 200px}.col-key-prefix[_ngcontent-%COMP%]{flex:0 0 160px}.col-status[_ngcontent-%COMP%]{flex:0 0 100px}.col-actions[_ngcontent-%COMP%]{flex:0 0 120px}h2[mat-dialog-title][_ngcontent-%COMP%]{position:relative}.dialog-header-actions[_ngcontent-%COMP%]{position:absolute;right:24px;top:16px}"],changeDetection:0})}return n})();var KDe=["*",[["mat-toolbar-row"]]],YDe=["*","mat-toolbar-row"],ZDe=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]})}return n})(),fj=(()=>{class n{_elementRef=f(Zt);_platform=f($s);_document=f(Xi);color;_toolbarRows;constructor(){}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){this._toolbarRows.length}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-toolbar"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,ZDe,5),t&2){let a;mt(a=pt())&&(o._toolbarRows=a)}},hostAttrs:[1,"mat-toolbar"],hostVars:6,hostBindings:function(t,o){t&2&&(er(o.color?"mat-"+o.color:""),Be("mat-toolbar-multiple-rows",o._toolbarRows.length>0)("mat-toolbar-single-row",o._toolbarRows.length===0))},inputs:{color:"color"},exportAs:["matToolbar"],ngContentSelectors:YDe,decls:2,vars:0,template:function(t,o){t&1&&(ii(KDe),on(0),on(1,1))},styles:[`.mat-toolbar{background:var(--mat-toolbar-container-background-color, var(--mat-sys-surface));color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font, var(--mat-sys-title-large-font));font-size:var(--mat-toolbar-title-text-size, var(--mat-sys-title-large-size));line-height:var(--mat-toolbar-title-text-line-height, var(--mat-sys-title-large-line-height));font-weight:var(--mat-toolbar-title-text-weight, var(--mat-sys-title-large-weight));letter-spacing:var(--mat-toolbar-title-text-tracking, var(--mat-sys-title-large-tracking));margin:0}@media(forced-colors: active){.mat-toolbar{outline:solid 1px}}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-mdc-button-base.mat-unthemed{--mat-button-text-label-text-color: var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface));--mat-button-outlined-label-text-color: var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height, 56px)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height, 56px)}}
`],encapsulation:2,changeDetection:0})}return n})();var pM=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[hi]})}return n})();var ePe=n=>["controller",n,"systemstatus"],tPe=n=>["controller",n,"settings"],nPe=n=>["controller",n,"management","users"],iPe=n=>["controller",n,"help"],oPe=()=>["/controllers"],rPe=n=>["/controller",n,"projects"],aPe=n=>["controller",n,"preferences"],sPe=n=>["controller",n,"computes"],lPe=n=>["controller",n,"image-manager"];function cPe(n,i){if(n&1){let e=z();s(0,"button",14),g("click",function(){k(e);let o=v();return T(o.listProjects())}),d(1,"Projects"),l()}}function dPe(n,i){if(n&1){let e=z();s(0,"button",15),g("click",function(){k(e);let o=v();return T(o.backToProject())}),d(1,"Back to project"),l()}}var uM=(()=>{class n{isInstalledSoftwareAvailable=!1;isLoginPage=!1;routeSubscription;controllerStatusSubscription;shouldStopControllersOnClosing=!0;recentlyOpenedcontrollerId;recentlyOpenedProjectId;controllerIdProjectList;controllerId;controller;project;projectMapSubscription=new So;recentlyOpenedProjectService=f(qd);controllerManagement=f(yg);toasterService=f(te);userService=f(Er);progressService=f(no);dialog=f(nt);router=f(ht);route=f(lt);controllerService=f(Je);projectService=f(ki);cd=f(Q);connectionManager=f(Tm);ngOnInit(){this.routeSubscription=this.router.events.pipe(ai(e=>e instanceof bp)).subscribe(()=>{this.controllerId=this.getParamFromRoute(this.route,"controller_id"),this.getData(),this.checkIfUserIsLoginPage(),this.cd.markForCheck()}),this.controllerId=this.getParamFromRoute(this.route,"controller_id"),this.getData(),this.recentlyOpenedcontrollerId=this.recentlyOpenedProjectService.getcontrollerId(),this.recentlyOpenedProjectId=this.recentlyOpenedProjectService.getProjectId(),this.controllerIdProjectList=this.recentlyOpenedProjectService.getcontrollerIdProjectList(),this.isInstalledSoftwareAvailable=!1,this.controllerStatusSubscription=this.controllerManagement.controllerStatusChanged.subscribe(e=>{e.status==="errored"&&(console.error(e.message),this.toasterService.error(e.message)),e.status==="stderr"&&(console.error(e.message),this.toasterService.error(e.message))}),this.shouldStopControllersOnClosing=!1}getParamFromRoute(e,t){let o=e;for(;o.firstChild;){o=o.firstChild;let r=o.snapshot.paramMap.get(t);if(r)return r}return o.snapshot.paramMap.get(t)}openLoggedUserDialog(){this.dialog.open(cj,{panelClass:["base-dialog-panel"],autoFocus:!1,data:{controllerId:+this.controllerId}})}openApiKeyManagementDialog(){this.controllerService.get(+this.controllerId).then(e=>{this.dialog.open(hj,{panelClass:["base-dialog-panel","configurator-dialog-panel"],autoFocus:!1,data:{controller:e}})})}openAiProfileDialog(){this.controllerService.get(+this.controllerId).then(e=>{this.userService.getInformationAboutLoggedUser(e).subscribe(t=>{this.dialog.open(mM,{panelClass:["base-dialog-panel","configurator-dialog-panel"],autoFocus:!1,data:{user:t,controller:e}})})})}goToDocumentation(){this.controllerService.get(+this.controllerId).then(e=>{window.open(`${e.protocol}//${e.host}:${e.port}/docs`)})}checkIfUserIsLoginPage(){this.router.url.includes("login")?this.isLoginPage=!0:this.isLoginPage=!1}logout(){this.controllerService.get(+this.controllerId).then(e=>{localStorage.removeItem(`refresh_token_${e.id}`),e.authToken=null,this.controllerService.update(e).then(t=>{this.connectionManager.disconnect(),this.router.navigate(["/controller",e.id,"login"])})})}listProjects(){this.router.navigate(["/controller",this.controllerIdProjectList,"projects"]).catch(e=>this.toasterService.error("Cannot list projects"))}backToProject(){this.router.navigate(["/controller",this.recentlyOpenedcontrollerId,"project",this.recentlyOpenedProjectId]).catch(e=>this.toasterService.error("Cannot navigate to the last opened project"))}async onBeforeUnload(e){if(this.shouldStopControllersOnClosing)return e.preventDefault(),e.returnValue=!1,this.progressService.activate(),await this.controllerManagement.stopAll(),this.shouldStopControllersOnClosing=!1,this.progressService.deactivate(),window.close(),!1}getData(){this.controllerService.get(+this.controllerId).then(e=>{this.controller=e})}addNewTemplate(){if(!this.controller){this.toasterService.error("Please select a controller first");return}let t=this.dialog.open(cg,{width:"800px",maxHeight:"800px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","configurator-dialog-panel","new-template-dialog-panel"]}).componentInstance;t.controller=this.controller,t.project=this.project}ngOnDestroy(){this.controllerStatusSubscription.unsubscribe(),this.routeSubscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-default-layout"]],hostBindings:function(t,o){t&1&&g("beforeunload",function(a){return o.onBeforeUnload(a)},lr)},decls:92,vars:44,consts:[["menu","matMenu"],["mainMenu","matMenu"],[1,"header"],[1,"toolbar-primary"],["mat-icon-button","",1,"gns3-button","menu-button",3,"matMenuTriggerFor"],["svgIcon","gns3"],["mat-button",""],["mat-button","",1,"back-to-project-button"],[1,"spacer"],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"disabled","routerLink"],["mat-menu-item","",3,"click","disabled"],["mat-menu-item","",3,"routerLink"],[1,"main-content"],["mat-button","",3,"click"],["mat-button","",1,"back-to-project-button",3,"click"]],template:function(t,o){if(t&1&&(s(0,"header",2)(1,"mat-toolbar",3)(2,"button",4),R(3,"mat-icon",5),l(),A(4,cPe,2,0,"button",6),A(5,dPe,2,0,"button",7),R(6,"span",8),s(7,"button",9)(8,"mat-icon"),d(9,"more_vert"),l()(),s(10,"mat-menu",null,0)(12,"button",10)(13,"mat-icon"),d(14,"info"),l(),s(15,"span"),d(16,"System status"),l()(),s(17,"button",10)(18,"mat-icon"),d(19,"settings"),l(),s(20,"span"),d(21,"Settings"),l()(),s(22,"button",10)(23,"mat-icon"),d(24,"groups"),l(),s(25,"span"),d(26,"Management"),l()(),s(27,"button",10)(28,"mat-icon"),d(29,"help"),l(),s(30,"span"),d(31,"Help"),l()(),s(32,"button",11),g("click",function(){return o.openLoggedUserDialog()}),s(33,"mat-icon"),d(34,"person"),l(),s(35,"span"),d(36,"User info"),l()(),s(37,"button",11),g("click",function(){return o.openApiKeyManagementDialog()}),s(38,"mat-icon"),d(39,"vpn_key"),l(),s(40,"span"),d(41,"API Keys"),l()(),s(42,"button",11),g("click",function(){return o.openAiProfileDialog()}),s(43,"mat-icon"),d(44,"psychology"),l(),s(45,"span"),d(46,"AI Profile"),l()(),s(47,"button",11),g("click",function(){return o.goToDocumentation()}),s(48,"mat-icon"),d(49,"person"),l(),s(50,"span"),d(51,"API documentation"),l()(),s(52,"button",11),g("click",function(){return o.logout()}),s(53,"mat-icon"),d(54,"highlight_off"),l(),s(55,"span"),d(56,"Logout"),l()()(),s(57,"mat-menu",null,1)(59,"button",12)(60,"mat-icon"),d(61,"developer_board"),l(),s(62,"span"),d(63,"Controllers"),l()(),s(64,"button",10)(65,"mat-icon"),d(66,"work"),l(),s(67,"span"),d(68,"Projects"),l()(),s(69,"button",10)(70,"mat-icon"),d(71,"settings_applications"),l(),s(72,"span"),d(73,"Template preferences"),l()(),s(74,"button",10)(75,"mat-icon"),d(76,"cloud"),l(),s(77,"span"),d(78,"Computes"),l()(),s(79,"button",10)(80,"mat-icon"),d(81,"collections"),l(),s(82,"span"),d(83,"Image manager"),l()(),s(84,"button",11),g("click",function(){return o.addNewTemplate()}),s(85,"mat-icon"),d(86,"control_point"),l(),s(87,"span"),d(88,"New template"),l()()()()(),s(89,"main",13),R(90,"router-outlet"),l(),R(91,"app-progress")),t&2){let r=Pe(11),a=Pe(58);m(2),C("matMenuTriggerFor",a),m(2),O(!o.recentlyOpenedProjectId&&o.controllerIdProjectList?4:-1),m(),O(o.recentlyOpenedProjectId&&o.recentlyOpenedcontrollerId?5:-1),m(2),C("matMenuTriggerFor",r),m(5),C("disabled",!o.controllerId)("routerLink",dn(27,ePe,o.controllerId)),m(5),C("disabled",!o.controllerId)("routerLink",dn(29,tPe,o.controllerId)),m(5),C("disabled",!o.controllerId)("routerLink",dn(31,nPe,o.controllerId)),m(5),C("disabled",!o.controllerId)("routerLink",dn(33,iPe,o.controllerId)),m(5),C("disabled",!o.controllerId),m(5),C("disabled",!o.controllerId),m(5),C("disabled",!o.controllerId),m(5),C("disabled",!o.controllerId),m(5),C("disabled",!o.controllerId),m(7),C("routerLink",Bt(35,oPe)),m(5),C("disabled",!o.controllerId)("routerLink",dn(36,rPe,o.controllerId)),m(5),C("disabled",!o.controllerId)("routerLink",dn(38,aPe,o.controllerId)),m(5),C("disabled",!o.controllerId)("routerLink",dn(40,sPe,o.controllerId)),m(5),C("disabled",!o.controllerId)("routerLink",dn(42,lPe,o.controllerId)),m(5),C("disabled",!o.controllerId)}},dependencies:[ne,dt,Ku,vn,pM,fj,W,pe,je,ie,de,Ge,Qn,Ze,Fn,wt,xm],styles:["[_nghost-%COMP%]{display:grid;grid-template-rows:auto 1fr;min-height:100vh;background:linear-gradient(135deg,var(--mat-sys-primary-container) 0%,var(--mat-sys-background) 100%)}.header[_ngcontent-%COMP%]{position:sticky;top:0;box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent);z-index:10}.toolbar-primary[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary);color:var(--mat-sys-white)}.toolbar-primary[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}.toolbar-primary[_ngcontent-%COMP%] .gns3-button[_ngcontent-%COMP%]{position:relative;top:-2px}.toolbar-primary[_ngcontent-%COMP%] .gns3-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:30px;height:30px}.toolbar-primary[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:40px;width:40px;border-radius:20px;margin:2px 0;transition:transform .1s ease}.toolbar-primary[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary)}.toolbar-primary[_ngcontent-%COMP%] .menu-button[_ngcontent-%COMP%]:hover{transform:scale(1.3)}.toolbar-primary[_ngcontent-%COMP%] .back-to-project-button[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary);transition:transform .1s ease}.toolbar-primary[_ngcontent-%COMP%] .back-to-project-button[_ngcontent-%COMP%]:hover{transform:scale(1.05)}.spacer[_ngcontent-%COMP%]{flex:1 1 auto}.main-content[_ngcontent-%COMP%]{overflow-y:auto;background:transparent}.footer[_ngcontent-%COMP%]{flex-shrink:0;padding:16px 24px;margin:auto 0 0;text-align:center;font-size:14px;border-top:1px solid color-mix(in srgb,var(--mat-sys-outline) 20%,transparent)}"],changeDetection:0})}return n})();var Mg=(()=>{class n{controllerService;constructor(e){this.controllerService=e}resolve(e){return this.controllerService.get(parseInt(e.params.controller_id))}static \u0275fac=function(t){return new(t||n)(ge(Je))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var hM=(n,i,e="")=>t=>Qa(500).pipe(Un(()=>i.list(n)),Lt(o=>o.find(r=>r.username===t.value&&t.value!==e)?{userExists:!0}:null));var fM=(n,i,e="")=>t=>Qa(500).pipe(Un(()=>i.list(n)),Lt(o=>o.find(r=>r.email===t.value&&t.value!==e)?{emailExists:!0}:null));var kl=(()=>{class n{httpController;constructor(e){this.httpController=e}getGroups(e){return this.httpController.get(e,"/access/groups")}getGroupMember(e,t){return this.httpController.get(e,`/access/groups/${t}/members`)}addGroup(e,t){return this.httpController.post(e,"/access/groups",{name:t})}delete(e,t){return this.httpController.delete(e,`/access/groups/${t}`)}get(e,t){return this.httpController.get(e,`/access/groups/${t}`)}addMemberToGroup(e,t,o){return this.httpController.put(e,`/access/groups/${t.user_group_id}/members/${o.user_id}`,{})}removeUser(e,t,o){return this.httpController.delete(e,`/access/groups/${t.user_group_id}/members/${o.user_id}`)}update(e,t){return this.httpController.put(e,`/access/groups/${t.user_group_id}`,{name:t.name})}getGroupRole(e,t){return this.httpController.get(e,`/access/groups/${t}/roles`)}removeRole(e,t,o){return this.httpController.delete(e,`/access/groups/${t.user_group_id}/roles/${o.role_id}`)}addRoleToGroup(e,t,o){return this.httpController.put(e,`/access/groups/${t.user_group_id}/roles/${o.role_id}`,{})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var mPe=(n,i)=>i.name;function pPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Username is required"),l())}function uPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Username is incorrect"),l())}function hPe(n,i){n&1&&(s(0,"mat-error"),d(1,"User with this username exists"),l())}function fPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Email is required"),l())}function gPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Email must include a valid domain (e.g., user@example.com)"),l())}function _Pe(n,i){n&1&&(s(0,"mat-error"),d(1,"A password between 6 and 100 characters is required."),l())}function vPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Password and Confirm password must be the same."),l())}function CPe(n,i){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e.name," ")}}function bPe(n,i){if(n&1){let e=z();s(0,"mat-chip",22),g("removed",function(){let o=k(e).$implicit,r=v();return T(r.deleteGroup(o))}),d(1),s(2,"button",23)(3,"mat-icon"),d(4,"cancel"),l()()()}if(n&2){let e=i.$implicit;m(),ee(" ",e.name," ")}}var gM=(()=>{class n{dialogRef=f(Ie);userService=f(Er);toasterService=f(te);groupService=f(kl);cd=f(Q);addUserForm;controller;hidePassword=!0;hideConfirmPassword=!0;groups=[];groupsToAdd=new Set([]);autocompleteControl=new Ye;filteredGroups;autocompleteTrigger;constructor(){}ngOnInit(){this.addUserForm=new gr({username:new Ye(null,[Ue.required,Ue.minLength(3),Ue.pattern("[a-zA-Z0-9_-]+$")],[hM(this.controller,this.userService)]),full_name:new Ye,email:new Ye(null,[Ue.email,Ue.pattern(/^[^\s@]+@[^\s@]+\.[^\s@]+$/),Ue.required],[fM(this.controller,this.userService)]),password:new Ye(null,[Ue.required,Ue.minLength(6),Ue.maxLength(100)]),confirmPassword:new Ye(null,[Ue.minLength(6),Ue.maxLength(100),Ue.required]),is_active:new Ye(!0)},{validators:[cM]}),this.groupService.getGroups(this.controller).subscribe({next:e=>{this.groups=e,this.filteredGroups=this.autocompleteControl.valueChanges.pipe(pi(""),Lt(t=>this._filter(t))),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load groups";this.toasterService.error(t),this.cd.markForCheck()}})}_filter(e){let t=typeof e=="string"?e.toLowerCase():"";return this.groups.filter(o=>o.name.toLowerCase().includes(t))}get form(){return this.addUserForm.controls}onCancelClick(){this.dialogRef.close()}onAddClick(){if(!this.addUserForm.valid)return;let e=this.addUserForm.value,t=Array.from(this.groupsToAdd.values());this.userService.add(this.controller,e).subscribe({next:o=>{this.toasterService.success(`User ${o.username} added`),t.forEach(r=>{this.groupService.addMemberToGroup(this.controller,r,o).subscribe({next:()=>{this.toasterService.success(`user ${o.username} was added to group ${r.name}`)},error:a=>{let c=a.error?.message||a.message||"Failed to add user to group";this.toasterService.error(c),this.cd.markForCheck()}})}),this.dialogRef.close()},error:o=>{let r=o.error?.message||o.message||"Failed to create user";this.toasterService.error(r),this.cd.markForCheck()}})}deleteGroup(e){this.groupsToAdd.delete(e)}openGroupPanel(){this.autocompleteControl.setValue("",{emitEvent:!0}),this.autocompleteTrigger&&this.autocompleteTrigger.openPanel()}selectedGroup(e){this.groupsToAdd.add(e),this.autocompleteControl.reset()}displayFn(e){return e&&e.name?e.name:""}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-add-user-dialog"]],viewQuery:function(t,o){if(t&1&&xn(Ko,5),t&2){let r;mt(r=pt())&&(o.autocompleteTrigger=r.first)}},decls:60,vars:18,consts:[["groupInput",""],["auto","matAutocomplete"],["mat-dialog-title",""],[3,"formGroup"],["mat-dialog-content",""],[1,"form-row"],["appearance","fill"],["matInput","","type","text","formControlName","username","placeholder","Username"],["matInput","","type","text","formControlName","full_name","placeholder","Full name"],["appearance","fill",1,"full-width-field"],["matInput","","type","text","formControlName","email","placeholder","Email"],["matInput","","formControlName","password","placeholder","Password",3,"type"],["matSuffix","",2,"cursor","pointer","font-size","18px",3,"click"],["matInput","","formControlName","confirmPassword","placeholder","Confirm Password",3,"type"],["formControlName","is_active"],[1,"my-2"],["type","text","matInput","",3,"click","matAutocomplete","formControl"],[3,"optionSelected","displayWith"],[3,"value"],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click","disabled"],[3,"removed"],["matChipRemove",""]],template:function(t,o){if(t&1&&(s(0,"h1",2),d(1,"Create new user"),l(),s(2,"form",3)(3,"div",4)(4,"div",5)(5,"mat-form-field",6)(6,"mat-label"),d(7,"Username"),l(),R(8,"input",7),A(9,pPe,2,0,"mat-error"),A(10,uPe,2,0,"mat-error"),A(11,hPe,2,0,"mat-error"),l(),s(12,"mat-form-field",6)(13,"mat-label"),d(14,"Full name"),l(),R(15,"input",8),l()(),s(16,"mat-form-field",9)(17,"mat-label"),d(18,"Email"),l(),R(19,"input",10),A(20,fPe,2,0,"mat-error"),A(21,gPe,2,0,"mat-error"),l(),s(22,"div",5)(23,"mat-form-field",6)(24,"mat-label"),d(25,"Password"),l(),R(26,"input",11),s(27,"mat-icon",12),g("click",function(){return o.hidePassword=!o.hidePassword}),d(28),l(),A(29,_Pe,2,0,"mat-error"),l(),s(30,"mat-form-field",6)(31,"mat-label"),d(32,"Confirm Password"),l(),R(33,"input",13),s(34,"mat-icon",12),g("click",function(){return o.hideConfirmPassword=!o.hideConfirmPassword}),d(35),l(),A(36,vPe,2,0,"mat-error"),l()(),s(37,"mat-checkbox",14),d(38,"Is active"),l(),R(39,"mat-divider",15),s(40,"h6"),d(41,"Add user to groups:"),l(),s(42,"mat-form-field",9)(43,"mat-label"),d(44,"Groups"),l(),s(45,"input",16,0),g("click",function(){return o.openGroupPanel()}),l(),s(47,"mat-autocomplete",17,1),g("optionSelected",function(a){return o.selectedGroup(a.option.value)}),Y(49,CPe,2,2,"mat-option",18,Ae),en(51,"async"),l()(),s(52,"mat-chip-set"),Y(53,bPe,5,1,"mat-chip",null,mPe),l()(),s(55,"div",19)(56,"button",20),g("click",function(){return o.onCancelClick()}),d(57,"Cancel"),l(),s(58,"button",21),g("click",function(){return o.onAddClick()}),d(59," Add user "),l()()()),t&2){let r=Pe(48);m(2),C("formGroup",o.addUserForm),m(7),O(o.form.username!=null&&o.form.username.touched&&(o.form.username!=null&&o.form.username.errors)&&(o.form.username!=null&&o.form.username.errors.required)?9:-1),m(),O(o.form.username!=null&&o.form.username.errors&&(o.form.username!=null&&o.form.username.errors.pattern)?10:-1),m(),O(o.form.username!=null&&o.form.username.errors&&(o.form.username!=null&&o.form.username.errors.userExists)?11:-1),m(9),O(o.form.email!=null&&o.form.email.touched&&(o.form.email!=null&&o.form.email.errors)&&(o.form.email!=null&&o.form.email.errors.required)?20:-1),m(),O(o.form.email!=null&&o.form.email.errors&&(o.form.email!=null&&o.form.email.errors.email)?21:-1),m(5),C("type",o.hidePassword?"password":"text"),m(2),j(o.hidePassword?"visibility_off":"visibility"),m(),O(o.form.password!=null&&o.form.password.touched&&(o.form.password!=null&&o.form.password.errors)?29:-1),m(4),C("type",o.hideConfirmPassword?"password":"text"),m(2),j(o.hideConfirmPassword?"visibility_off":"visibility"),m(),O(o.form.confirmPassword!=null&&o.form.confirmPassword.touched&&(o.form.confirmPassword!=null&&o.form.confirmPassword.errors)?36:-1),m(9),C("matAutocomplete",r)("formControl",o.autocompleteControl),m(2),C("displayWith",o.displayFn),m(2),Z(jn(51,16,o.filteredGroups)),m(4),Z(o.groupsToAdd),m(5),C("disabled",!o.addUserForm.valid)}},dependencies:[ne,Dt,at,Ft,Pt,rt,Hs,Rt,zt,_e,Ne,Fe,bt,W,pe,ie,de,wt,ti,Jn,mi,tP,we,Me,et,fi,Mi,Se,Ee,Ot,Gt,jr,ga,Yr,Sa,_t,Ko,zr],styles:[".form-row[_ngcontent-%COMP%]{display:flex;gap:16px}.form-row[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{flex:1}.full-width-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var xPe=(n,i)=>i.username;function yPe(n,i){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=i.$implicit;m(),ui("",e.username,"",e.full_name?" ("+e.full_name+")":"")}}var Uv=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}onCancel(){this.dialogRef.close()}onDelete(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-delete-user-dialog"]],decls:10,vars:0,consts:[["mat-dialog-title",""],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following users ?"),l(),s(2,"ul"),Y(3,yPe,2,2,"li",null,xPe),l(),s(5,"div",1)(6,"button",2),g("click",function(){return o.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),g("click",function(){return o.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Z(o.data.users))},dependencies:[ne,_e,Ne,Fe,W,pe],encapsulation:2,changeDetection:0})}return n})();var gj=(()=>{class n{transform(e,t){return e?t?(t=t.toLowerCase(),e.data.filter(o=>o.username&&o.username.toLowerCase().includes(t)||o.full_name&&o.full_name.toLowerCase().includes(t)||o.email&&o.email.toLowerCase().includes(t))):e:[]}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"userFilter",type:n,pure:!0})}return n})();var fp=(()=>{class n{httpController;constructor(e){this.httpController=e}getEndpoints(e){return this.httpController.get(e,"/access/acl/endpoints")}list(e){return this.httpController.get(e,"/access/acl")}add(e,t){return this.httpController.post(e,"/access/acl",t)}get(e,t){return this.httpController.get(e,`/access/acl/${t}`)}delete(e,t){return this.httpController.delete(e,`/access/acl/${t}`)}update(e,t){return this.httpController.put(e,`/access/acl/${t.ace_id}`,t)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Tl=(()=>{class n{httpController;constructor(e){this.httpController=e}get(e){return this.httpController.get(e,"/access/roles")}delete(e,t){return this.httpController.delete(e,`/access/roles/${t}`)}create(e,t){return this.httpController.post(e,"/access/roles",t)}getById(e,t){return this.httpController.get(e,`/access/roles/${t}`)}update(e,t){return this.httpController.put(e,`/access/roles/${t.role_id}`,{name:t.name,description:t.description})}setPrivileges(e,t,o){return this.httpController.put(e,`/access/roles/${t}/privileges/${o}`,void 0)}removePrivileges(e,t,o){return this.httpController.delete(e,`/access/roles/${t}/privileges/${o}`)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var wPe=(n,i)=>i.user_group_id;function MPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Username is required"),l())}function kPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Username is incorrect"),l())}function TPe(n,i){n&1&&(s(0,"mat-error"),d(1,"User with this username exists"),l())}function EPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Email is required"),l())}function DPe(n,i){n&1&&(s(0,"mat-error"),d(1,"Email is invalid"),l())}function PPe(n,i){n&1&&(s(0,"mat-error"),d(1,"User with this email exists"),l())}function IPe(n,i){n&1&&(s(0,"p",21),d(1,"Loading..."),l())}function APe(n,i){n&1&&(s(0,"p",22),d(1,"User is not member of any group"),l())}function OPe(n,i){if(n&1&&(s(0,"li")(1,"span",26),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.name)}}function NPe(n,i){if(n&1&&(s(0,"ul"),Y(1,OPe,3,1,"li",null,wPe),l()),n&2){let e=v();m(),Z(e.groups)}}function FPe(n,i){n&1&&(s(0,"p",21),d(1,"Loading..."),l())}function RPe(n,i){n&1&&(s(0,"p",22),d(1,"No ACEs found for this user"),l())}function LPe(n,i){n&1&&(s(0,"th",35),d(1,"Endpoint"),l())}function VPe(n,i){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=i.$implicit;m(),j(e.endpoint_name)}}function BPe(n,i){n&1&&(s(0,"th",35),d(1,"Role"),l())}function zPe(n,i){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=i.$implicit;m(),j(e.role_name)}}function jPe(n,i){n&1&&(s(0,"th",35),d(1,"Propagate"),l())}function $Pe(n,i){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=i.$implicit;m(),j(e.propagate)}}function HPe(n,i){n&1&&(s(0,"th",35),d(1,"Allowed"),l())}function UPe(n,i){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=i.$implicit;m(),j(e.allowed)}}function GPe(n,i){n&1&&R(0,"tr",37)}function WPe(n,i){n&1&&R(0,"tr",38)}function qPe(n,i){if(n&1&&(s(0,"table",23),Le(1,27),xe(2,LPe,2,0,"th",28)(3,VPe,2,1,"td",29),Ve(),Le(4,30),xe(5,BPe,2,0,"th",28)(6,zPe,2,1,"td",29),Ve(),Le(7,31),xe(8,jPe,2,0,"th",28)(9,$Pe,2,1,"td",29),Ve(),Le(10,32),xe(11,HPe,2,0,"th",28)(12,UPe,2,1,"td",29),Ve(),xe(13,GPe,1,0,"tr",33)(14,WPe,1,0,"tr",34),l()),n&2){let e=v();C("dataSource",e.aceDatasource),m(13),C("matHeaderRowDef",e.aceDisplayedColumns),m(),C("matRowDefColumns",e.aceDisplayedColumns)}}var _M=(()=>{class n{data;dialogRef=f(Ie);userService=f(Er);toasterService=f(te);aclService=f(fp);roleService=f(Tl);dialog=f(nt);cd=f(Q);editUserForm;groups=[];aces=[];aceDatasource=new pr;aceDisplayedColumns=["endpoint","role","propagate","allowed"];groupsLoaded=!1;acesLoaded=!1;constructor(e){this.data=e,this.user=e.user,this.controller=e.controller}user;controller;ngOnInit(){this.initForm(),this.loadGroupsData(),this.loadAceData()}initForm(){this.editUserForm=new gr({username:new Ye(this.user.username,[Ue.required,Ue.minLength(3),Ue.pattern("[a-zA-Z0-9_-]+$")],[hM(this.controller,this.userService,this.user.username)]),full_name:new Ye(this.user.full_name),email:new Ye(this.user.email,[Ue.email,Ue.required],[fM(this.controller,this.userService,this.user.email)]),is_active:new Ye(this.user.is_active)})}get form(){return this.editUserForm.controls}loadGroupsData(){this.userService.getGroupsByUserId(this.controller,this.user.user_id).subscribe({next:e=>{this.groups=e,this.groupsLoaded=!0,this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load groups";this.toasterService.error(t),this.groupsLoaded=!0,this.cd.markForCheck()}})}loadAceData(){qi({roles:this.roleService.get(this.controller),endpoints:this.aclService.getEndpoints(this.controller),aces:this.aclService.list(this.controller)}).subscribe({next:({roles:e,endpoints:t,aces:o})=>{this.aces=o.filter(r=>r.ace_type==="user"&&r.user_id===this.user.user_id),this.aceDatasource.data=this.aces.map(r=>{let a=t.filter(p=>p.endpoint===r.path)[0],c=e.filter(p=>p.role_id===r.role_id)[0];return it(K({},r),{endpoint_name:a?.name||r.path,role_name:c?.name||"Unknown"})}),this.acesLoaded=!0,this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load access control entries";this.toasterService.error(t),this.acesLoaded=!0,this.cd.markForCheck()}})}onSaveChanges(){if(!this.editUserForm.valid)return;let e=this.getUpdatedValues();e.user_id=this.user.user_id,this.userService.update(this.controller,e,!1).subscribe({next:t=>{this.toasterService.success(`User ${t.username} updated`),this.dialogRef.close(t)},error:t=>{let o=t.error?.message||t.message||"Failed to update user";this.toasterService.error(o),this.cd.markForCheck()}})}getUpdatedValues(){let e={};return Object.keys(this.editUserForm.controls).forEach(t=>{let o=this.editUserForm.get(t);o.dirty&&o.value!==this.user[t]&&(e[t]=o.value)}),e}onChangePassword(){this.dialog.open(Sg,{panelClass:["base-dialog-panel","change-user-password-dialog-panel"],data:{user:this.user,controller:this.controller}})}onCancel(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-user-detail-dialog"]],decls:84,vars:16,consts:[["mat-dialog-title",""],[1,"user-detail-dialog__content"],[1,"user-detail-dialog__section"],[1,"user-detail-dialog__section-title"],[1,"user-detail-dialog__card"],[1,"user-detail-dialog__form",3,"formGroup"],[1,"user-detail-dialog__form-row"],["appearance","fill",1,"user-detail-dialog__field"],["matInput","","type","text","formControlName","username"],["matInput","","type","text","formControlName","full_name"],["matInput","","type","text","formControlName","email"],[1,"user-detail-dialog__checkbox"],["formControlName","is_active"],[1,"user-detail-dialog__card","user-detail-dialog__card--muted"],[1,"user-detail-dialog__info-grid"],[1,"user-detail-dialog__info-item"],[1,"user-detail-dialog__info-label"],[1,"user-detail-dialog__info-value"],[1,"user-detail-dialog__info-item","user-detail-dialog__info-item--full"],[1,"user-detail-dialog__info-value","user-detail-dialog__info-value--mono"],[1,"user-detail-dialog__groups-list"],[1,"user-detail-dialog__loading"],[1,"user-detail-dialog__empty-message"],["mat-table","",1,"user-detail-dialog__ace-table",3,"dataSource"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"user-detail-dialog__group-name"],["matColumnDef","endpoint"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","role"],["matColumnDef","propagate"],["matColumnDef","allowed"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"section",2)(5,"h3",3),d(6,"Details"),l(),s(7,"mat-card",4)(8,"mat-card-content")(9,"form",5)(10,"div",6)(11,"mat-form-field",7)(12,"mat-label"),d(13,"Username"),l(),R(14,"input",8),A(15,MPe,2,0,"mat-error"),A(16,kPe,2,0,"mat-error"),A(17,TPe,2,0,"mat-error"),l(),s(18,"mat-form-field",7)(19,"mat-label"),d(20,"Full name"),l(),R(21,"input",9),l()(),s(22,"div",6)(23,"mat-form-field",7)(24,"mat-label"),d(25,"Email"),l(),R(26,"input",10),A(27,EPe,2,0,"mat-error"),A(28,DPe,2,0,"mat-error"),A(29,PPe,2,0,"mat-error"),l(),s(30,"div",11)(31,"mat-checkbox",12),d(32,"Is active"),l()()()()()(),s(33,"mat-card",13)(34,"mat-card-header")(35,"mat-card-title"),d(36,"User Information"),l()(),s(37,"mat-card-content")(38,"div",14)(39,"div",15)(40,"span",16),d(41,"Is Superadmin"),l(),s(42,"span",17),d(43),l()(),s(44,"div",15)(45,"span",16),d(46,"Creation date"),l(),s(47,"span",17),d(48),l()(),s(49,"div",15)(50,"span",16),d(51,"Last update"),l(),s(52,"span",17),d(53),l()(),s(54,"div",15)(55,"span",16),d(56,"Last login"),l(),s(57,"span",17),d(58),l()(),s(59,"div",18)(60,"span",16),d(61,"UUID"),l(),s(62,"span",19),d(63),l()()()()()(),s(64,"section",2)(65,"h3",3),d(66,"Groups"),l(),s(67,"div",20),A(68,IPe,2,0,"p",21)(69,APe,2,0,"p",22)(70,NPe,3,0,"ul"),l()(),s(71,"section",2)(72,"h3",3),d(73,"ACEs"),l(),A(74,FPe,2,0,"p",21)(75,RPe,2,0,"p",22)(76,qPe,15,3,"table",23),l()()(),s(77,"mat-dialog-actions")(78,"button",24),g("click",function(){return o.onChangePassword()}),d(79,"Change Password"),l(),s(80,"button",24),g("click",function(){return o.onCancel()}),d(81,"Cancel"),l(),s(82,"button",25),g("click",function(){return o.onSaveChanges()}),d(83," Save changes "),l()()),t&2&&(m(),ee("User ",o.user.username),m(8),C("formGroup",o.editUserForm),m(6),O(o.form.username!=null&&o.form.username.touched&&(o.form.username!=null&&o.form.username.errors)&&(o.form.username!=null&&o.form.username.errors.required)?15:-1),m(),O(o.form.username!=null&&o.form.username.errors&&(o.form.username!=null&&o.form.username.errors.pattern)?16:-1),m(),O(o.form.username!=null&&o.form.username.errors&&(o.form.username!=null&&o.form.username.errors.userExists)?17:-1),m(10),O(o.form.email!=null&&o.form.email.touched&&(o.form.email!=null&&o.form.email.errors)&&(o.form.email!=null&&o.form.email.errors.required)?27:-1),m(),O(o.form.email!=null&&o.form.email.errors&&(o.form.email!=null&&o.form.email.errors.email)?28:-1),m(),O(o.form.email!=null&&o.form.email.errors&&(o.form.email!=null&&o.form.email.errors.emailExists)?29:-1),m(14),j(o.user.is_superadmin?"YES":"NO"),m(5),j(o.user.created_at),m(5),j(o.user.updated_at),m(5),j(o.user.last_login||"Never"),m(5),j(o.user.user_id),m(5),O(o.groupsLoaded?o.groups.length===0?69:70:68),m(6),O(o.acesLoaded?o.aces.length===0?75:76:74),m(8),C("disabled",!o.editUserForm.valid))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,dt,_e,Ne,Fe,bt,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W,pe,ie,we,Me,et,fi,Se,Ee,Ot,Gt,Mt,On,ll,Nc,Oc],styles:[".user-detail-dialog__content[_ngcontent-%COMP%]{padding:0}.user-detail-dialog__section[_ngcontent-%COMP%]{margin-bottom:24px}.user-detail-dialog__section[_ngcontent-%COMP%]:last-child{margin-bottom:0}.user-detail-dialog__section-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:var(--mat-sys-on-surface);margin:0 0 12px}.user-detail-dialog__card[_ngcontent-%COMP%]{margin-bottom:16px;border-radius:12px}.user-detail-dialog__card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{padding-top:16px}.user-detail-dialog__card--muted[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-low)}.user-detail-dialog__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.user-detail-dialog__form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:flex-start}@media(max-width:600px){.user-detail-dialog__form-row[_ngcontent-%COMP%]{grid-template-columns:1fr}}.user-detail-dialog__field[_ngcontent-%COMP%]{width:100%}.user-detail-dialog__checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:4px}.user-detail-dialog__info-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}@media(max-width:600px){.user-detail-dialog__info-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.user-detail-dialog__info-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.user-detail-dialog__info-item--full[_ngcontent-%COMP%]{grid-column:1/-1}.user-detail-dialog__info-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px}.user-detail-dialog__info-value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.user-detail-dialog__info-value--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:12px}.user-detail-dialog__groups-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-low);border-radius:8px;padding:12px 16px}.user-detail-dialog__groups-list[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0}.user-detail-dialog__groups-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:8px 0;border-bottom:1px solid var(--mat-sys-outline-variant)}.user-detail-dialog__groups-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-bottom:none}.user-detail-dialog__group-name[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface)}.user-detail-dialog__ace-table[_ngcontent-%COMP%]{width:100%;background:var(--mat-sys-surface-container-low);border-radius:8px;overflow:hidden}.user-detail-dialog__ace-table[_ngcontent-%COMP%] .mat-header-row[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container)}.user-detail-dialog__ace-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);text-transform:uppercase}.user-detail-dialog__ace-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.user-detail-dialog__ace-table[_ngcontent-%COMP%] mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent)}.user-detail-dialog__empty-message[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);font-style:italic;text-align:center;padding:24px}.user-detail-dialog__loading[_ngcontent-%COMP%]{text-align:center;padding:24px;color:var(--mat-sys-on-surface-variant)}"],changeDetection:0})}return n})();var QPe=["usersPaginator"],XPe=["usersSort"],KPe=()=>[5,10,20];function YPe(n,i){if(n&1){let e=z();s(0,"mat-header-cell",32)(1,"mat-checkbox",33),g("change",function(o){k(e);let r=v(2);return T(o?r.masterToggle():null)}),l()()}if(n&2){let e=v(2);m(),C("checked",e.selection.hasValue()&&e.isAllSelected())("indeterminate",e.selection.hasValue()&&!e.isAllSelected())}}function ZPe(n,i){if(n&1){let e=z();s(0,"mat-cell",32)(1,"mat-checkbox",34),g("click",function(o){return o.stopPropagation()})("change",function(o){let r=k(e).$implicit,a=v(2);return T(o?a.selection.toggle(r):null)}),l()()}if(n&2){let e=i.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function JPe(n,i){n&1&&(s(0,"mat-header-cell",35),d(1,"Username"),l())}function eIe(n,i){if(n&1){let e=z();s(0,"mat-cell")(1,"span",36),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openUserDetailDialog(o))}),d(2),l()()}if(n&2){let e=i.$implicit;m(2),j(e.username)}}function tIe(n,i){n&1&&(s(0,"mat-header-cell",35),d(1,"Full Name"),l())}function nIe(n,i){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.full_name)}}function iIe(n,i){n&1&&(s(0,"mat-header-cell",35),d(1,"Mail"),l())}function oIe(n,i){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.email)}}function rIe(n,i){n&1&&(s(0,"mat-header-cell",38),d(1,"Active"),l())}function aIe(n,i){if(n&1&&(s(0,"mat-cell",39),d(1),l()),n&2){let e=i.$implicit;m(),j(e.is_active)}}function sIe(n,i){n&1&&(s(0,"mat-header-cell",35),d(1,"Last Login"),l())}function lIe(n,i){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.last_login)}}function cIe(n,i){n&1&&(s(0,"mat-header-cell",35),d(1,"Last Update"),l())}function dIe(n,i){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.updated_at?e.updated_at:e.created_at)}}function mIe(n,i){n&1&&(s(0,"mat-header-cell"),d(1,"Actions"),l())}function pIe(n,i){if(n&1){let e=z();s(0,"mat-cell",40)(1,"button",41),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openUserDetailDialog(o))}),s(2,"mat-icon"),d(3,"edit"),l()(),s(4,"button",42),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openAiProfileDialog(o))}),s(5,"mat-icon"),d(6,"psychology"),l()()()}}function uIe(n,i){n&1&&R(0,"mat-header-row")}function hIe(n,i){n&1&&R(0,"mat-row")}function fIe(n,i){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Users"),l(),s(3,"div",5)(4,"button",6),g("click",function(){k(e);let o=v();return T(o.deleteMultiple())}),d(5," Delete Users "),l(),s(6,"button",7),g("click",function(){k(e);let o=v();return T(o.addUser())}),d(7,"Add User"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),g("input",function(o){k(e);let r=v();return T(r.searchText.set(o.target.value))}),l()()(),s(11,"div",11)(12,"mat-table",12,0),en(14,"userFilter"),Le(15,13),xe(16,YPe,2,2,"mat-header-cell",14)(17,ZPe,2,1,"mat-cell",15),Ve(),Le(18,16),xe(19,JPe,2,0,"mat-header-cell",17)(20,eIe,3,1,"mat-cell",18),Ve(),Le(21,19),xe(22,tIe,2,0,"mat-header-cell",17)(23,nIe,3,1,"mat-cell",18),Ve(),Le(24,20),xe(25,iIe,2,0,"mat-header-cell",17)(26,oIe,3,1,"mat-cell",18),Ve(),Le(27,21),xe(28,rIe,2,0,"mat-header-cell",22)(29,aIe,2,1,"mat-cell",23),Ve(),Le(30,24),xe(31,sIe,2,0,"mat-header-cell",17)(32,lIe,3,1,"mat-cell",18),Ve(),Le(33,25),xe(34,cIe,2,0,"mat-header-cell",17)(35,dIe,3,1,"mat-cell",18),Ve(),Le(36,26),xe(37,mIe,2,0,"mat-header-cell",27)(38,pIe,7,0,"mat-cell",28),Ve(),xe(39,uIe,1,0,"mat-header-row",29)(40,hIe,1,0,"mat-row",30),l(),R(41,"mat-paginator",31,1),l()}if(n&2){let e=v();m(4),C("disabled",e.selection.selected.length===0),m(6),C("value",e.searchText()),m(2),C("dataSource",na(14,6,e.dataSource,e.searchText())),m(27),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Bt(9,KPe))}}function gIe(n,i){n&1&&(s(0,"div",2),R(1,"mat-spinner",43),l())}var vM=(()=>{class n{route=f(lt);userService=f(Er);progressService=f(no);controllerService=f(Je);dialog=f(nt);toasterService=f(te);location=f(iC);cd=f(Q);controller;dataSource=new pr;displayedColumns=["select","username","full_name","email","is_active","last_login","updated_at","actions"];selection=new Oa(!0,[]);searchText=U("");usersPaginator;usersSort;isReady=!1;ngOnInit(){let e=this.route.parent.snapshot.paramMap.get("controller_id");this.controllerService.get(+e).then(t=>{this.controller=t,this.refresh()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.location.back()})}ngAfterViewInit(){this.usersPaginator.changes.subscribe(e=>{this.dataSource.paginator=e.first}),this.usersSort.changes.subscribe(e=>{this.dataSource.sort=e.first}),this.dataSource.sortingDataAccessor=(e,t)=>{switch(t){case"username":case"full_name":case"email":return e[t]?e[t].toLowerCase():"";default:return e[t]}}}refresh(){this.userService.list(this.controller).subscribe({next:e=>{this.isReady=!0,this.dataSource.data=e,this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load users";this.progressService.setError(e),this.toasterService.error(t),this.location.back()}})}addUser(){let e=this.dialog.open(gM,{panelClass:["base-dialog-panel","add-user-dialog-panel"],autoFocus:!1,disableClose:!0}),t=e.componentInstance;t.controller=this.controller,e.afterClosed().subscribe(()=>this.refresh())}onDelete(e){this.dialog.open(Uv,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{users:[e]}}).afterClosed().subscribe(t=>{t&&this.userService.delete(this.controller,e.user_id).subscribe({next:()=>{this.refresh()},error:o=>{let r=o.error?.message||o.message||`Failed to delete user ${e.username}`;this.toasterService.error(r),this.cd.markForCheck()}})})}isAllSelected(){let e=this.selection.selected.length,t=this.dataSource.data.length;return e===t}masterToggle(){this.isAllSelected()?this.selection.clear():this.dataSource.data.forEach(e=>this.selection.select(e))}deleteMultiple(){this.dialog.open(Uv,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{users:this.selection.selected}}).afterClosed().subscribe(e=>{e&&(this.selection.selected.forEach(t=>{this.userService.delete(this.controller,t.user_id).subscribe({next:()=>{this.refresh()},error:o=>{let r=o.error?.message||o.message||`Failed to delete user ${t.username}`;this.toasterService.error(r),this.cd.markForCheck()}})}),this.selection.clear())})}openUserDetailDialog(e){this.userService.get(this.controller,e.user_id).subscribe({next:t=>{let o={user:t,controller:this.controller};this.dialog.open(_M,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:o,disableClose:!1}).afterClosed().subscribe(()=>{this.refresh()})},error:t=>{let o=t.error?.message||t.message||"Failed to load user data";this.toasterService.error(o),this.cd.markForCheck()}})}openAiProfileDialog(e){let t={user:e,controller:this.controller};this.dialog.open(mM,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:t,disableClose:!1})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-user-management"]],viewQuery:function(t,o){if(t&1&&xn(QPe,5)(XPe,5),t&2){let r;mt(r=pt())&&(o.usersPaginator=r),mt(r=pt())&&(o.usersSort=r)}},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:2,vars:1,consts:[["usersSort","matSort"],["usersPaginator","matPaginator"],[1,"user-management__loader"],[1,"user-management__header"],[1,"user-management__title"],[1,"user-management__actions"],["mat-raised-button","","color","primary",1,"user-management__button",3,"click","disabled"],["mat-raised-button","","color","primary",1,"user-management__button",3,"click"],[1,"user-management__search-form"],[1,"user-management__search"],["matInput","","placeholder","Search by username, full name or email",3,"input","value"],[1,"user-management__table-container"],["matSort","",3,"dataSource"],["matColumnDef","select"],["class","user-management__small-col",4,"matHeaderCellDef"],["class","user-management__small-col",4,"matCellDef"],["matColumnDef","username"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","full_name"],["matColumnDef","email"],["matColumnDef","is_active"],["mat-sort-header","","class","user-management__active-col",4,"matHeaderCellDef"],["class","user-management__active-col",4,"matCellDef"],["matColumnDef","last_login"],["matColumnDef","updated_at"],["matColumnDef","actions"],[4,"matHeaderCellDef"],["class","user-management__actions-cell",4,"matCellDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","","aria-label","Select page",3,"pageSizeOptions"],[1,"user-management__small-col"],[3,"change","checked","indeterminate"],[3,"click","change","checked"],["mat-sort-header",""],[1,"user-management__username","user-management__username--clickable",3,"click"],[1,"user-management__overflow-text"],["mat-sort-header","",1,"user-management__active-col"],[1,"user-management__active-col"],[1,"user-management__actions-cell"],["mat-icon-button","","matTooltip","Edit user",3,"click"],["mat-icon-button","","matTooltip","AI Profiles",3,"click"],[1,"user-management__spinner"]],template:function(t,o){t&1&&A(0,fIe,43,10)(1,gIe,2,0,"div",2),t&2&&O(o.isReady?0:1)},dependencies:[ne,Xe,at,rt,Gn,dt,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,Ot,Gt,we,Me,Se,Ee,W,pe,je,ie,de,hr,ar,mo,Tr,_e,pn,li,gj],styles:['[_nghost-%COMP%]{display:block;width:100%}.user-management__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 0;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.user-management__title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.user-management__actions[_ngcontent-%COMP%]{display:flex;gap:12px}.user-management__button[_ngcontent-%COMP%]{margin:12px 0;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1)}.user-management__button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.user-management__button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.user-management__search-form[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:16px auto;width:100%;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.user-management__search[_ngcontent-%COMP%]{width:100%;max-width:1000px}.user-management__table-container[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;width:100%;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both}.user-management__table-container--hidden[_ngcontent-%COMP%]{display:none}mat-row[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);cursor:default;position:relative}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent);transform:scale(1.002)}mat-row[_ngcontent-%COMP%]:nth-child(2n){background-color:color-mix(in srgb,var(--mat-sys-on-surface) 1%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n):hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent)}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.mat-header-row[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px;text-transform:uppercase}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}mat-cell[mat-column=username][_ngcontent-%COMP%]{justify-content:flex-start;font-weight:500}.user-management__username--clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--mat-sys-primary);transition:all .2s cubic-bezier(.4,0,.2,1)}.user-management__username--clickable[_ngcontent-%COMP%]:hover{color:color-mix(in srgb,var(--mat-sys-primary) 80%,black);text-decoration:underline}.user-management__link[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);display:inline-block;transform-origin:left center;color:var(--mat-sys-primary);text-decoration:none;font-weight:500;position:relative}.user-management__link[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-2px;left:0;width:0;height:2px;background-color:currentColor;transition:width .2s cubic-bezier(.4,0,.2,1)}.user-management__link[_ngcontent-%COMP%]:hover{color:color-mix(in srgb,var(--mat-sys-primary) 80%,black);transform:translateY(-2px)}.user-management__link[_ngcontent-%COMP%]:hover:after{width:100%}.user-management__overflow-text[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding-right:5px}.user-management__active-col[_ngcontent-%COMP%]{flex-grow:.5;justify-content:center}mat-cell[mat-column=actions][_ngcontent-%COMP%], mat-header-cell[mat-column=actions][_ngcontent-%COMP%]{justify-content:flex-end;padding:0 16px}mat-cell[mat-column=actions][_ngcontent-%COMP%]{overflow:visible}.user-management__small-col[_ngcontent-%COMP%]{width:60px;min-width:60px}.user-management__loader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:200px}.user-management__spinner[_ngcontent-%COMP%]{width:48px;height:48px}mat-paginator[_ngcontent-%COMP%]{background:var(--mat-sys-surface);color:var(--mat-sys-on-surface)}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.user-management__header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:16px;padding:16px 0}.user-management__actions[_ngcontent-%COMP%]{width:100%;flex-direction:column}.user-management__button[_ngcontent-%COMP%]{width:100%;height:44px;font-size:15px}.user-management__actions-cell[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px}mat-cell[_ngcontent-%COMP%]{padding:0 12px;font-size:13px}}'],changeDetection:0})}return n})();var kg=(()=>{class n{uploadEvents=new He;cancelRequests=new He;cancelHandlers=new Map;get events$(){return this.uploadEvents.asObservable()}get cancelRequests$(){return this.cancelRequests.asObservable()}emit(e){this.uploadEvents.next(e)}requestCancel(e){let t=this.cancelHandlers.get(e);if(t){t();return}this.cancelRequests.next(e)}registerCancelHandler(e,t){!e||!t||this.cancelHandlers.set(e,t)}unregisterCancelHandler(e){e&&this.cancelHandlers.delete(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var _j=(()=>{class n{http;imageService;imageUploadSessionService;toasterService;queue=[];activeUploads=new Set;activeUploadSizes=new Map;activeCountSource=new an(0);activeCount$=this.activeCountSource.asObservable();constructor(e,t,o,r){this.http=e,this.imageService=t,this.imageUploadSessionService=o,this.toasterService=r,this.imageUploadSessionService.cancelRequests$.subscribe(a=>{this.cancelUploadByTempId(a)})}queueFile(e,t,o){let r=`img-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,a={tempId:r,file:t,controller:e,installAppliance:o,cancel$:new He,status:"queued",progress:0};return this.queue.push(a),this.imageUploadSessionService.registerCancelHandler(r,()=>this.cancelUploadByTempId(r)),this.emitEvent(a),this.processQueue(),this.updateActiveCount(),r}cancelUploadByTempId(e){let t=this.queue.find(o=>o.tempId===e);t&&(t.cancel$.next(),t.cancel$.complete(),t.status="canceled",this.emitEvent(t),this.imageUploadSessionService.unregisterCancelHandler(e),this.releaseSlot(t),this.removeFromQueue(t),this.processQueue(),this.updateActiveCount())}processQueue(){let e=this.getHardConcurrencyCapFromEnvironment();for(;this.activeUploads.size<e;){let t=this.pickNextTask();if(!t||!this.canStartUpload(t))break;this.startUpload(t)}}startUpload(e){this.activeUploads.add(e.tempId),this.activeUploadSizes.set(e.tempId,e.file.size),e.status="uploading",this.emitEvent(e);let t=this.imageService.getImagePath(e.controller,e.installAppliance,e.file.name),o={};e.controller.authToken&&!e.controller.tokenExpired&&(o.Authorization=`Bearer ${e.controller.authToken}`);let r=new jO("POST",t,e.file,{headers:new aC(o),reportProgress:!0});this.http.request(r).pipe(tt(e.cancel$)).subscribe({next:a=>{if(a.type===$u.UploadProgress)e.progress=a.total?Math.round(100*a.loaded/a.total):0,this.emitEvent(e),this.updateActiveCount();else if(a.type===$u.Response){let c=a.body,p=c?.filename||c?.message?.filename||e.file.name;e.status="uploaded",e.progress=100,this.emitEvent(e),this.toasterService.success(`Image ${p} imported successfully`),this.releaseSlot(e),this.removeFromQueue(e),this.processQueue(),this.updateActiveCount()}},error:a=>{let c=a?.error?.message||a?.message||"Upload failed";e.status="error",this.emitEvent(e,c),this.toasterService.error(c),this.releaseSlot(e),this.removeFromQueue(e),this.processQueue(),this.updateActiveCount()}})}pickNextTask(){let e=this.getPendingTasks();if(!e.length)return null;let t=this.getInFlightBytesBudget()-this.getApproxInFlightBytes(),o=e.filter(r=>r.file.size<=t);return o.length?o.sort((r,a)=>r.file.size-a.file.size)[0]:this.activeUploads.size===0?e.sort((r,a)=>r.file.size-a.file.size)[0]:null}canStartUpload(e){if(this.activeUploads.size===0)return!0;let t=this.getApproxInFlightBytes(),o=e.file.size,r=this.getInFlightBytesBudget(),a=this.getPendingTasks(),c=a.length?a.reduce((h,_)=>h+_.file.size,0)/a.length:this.getAverageKnownSize(),p=Math.max(1,Math.floor(r/Math.max(c,this.getAverageKnownSize()))),u=Math.min(this.getHardConcurrencyCapFromEnvironment(),p);return this.activeUploads.size>=u?!1:t+o<=r}getPendingTasks(){return this.queue.filter(e=>e.status==="queued")}releaseSlot(e){this.activeUploads.delete(e.tempId),this.activeUploadSizes.delete(e.tempId)}removeFromQueue(e){let t=this.queue.indexOf(e);t>=0&&this.queue.splice(t,1)}getHardConcurrencyCapFromEnvironment(){let e=this.getRuntimeSignals(),t=Math.max(1,Math.round(Math.log2(e.cores+1)*2)),o=Math.max(1,Math.round(e.memoryGiB*1.2)),r=this.getPendingTasks().map(p=>p.file.size).filter(p=>p>0),a=r.length?r.reduce((p,u)=>p+u,0)/r.length:0,c=Math.min(t,Math.max(1,o*2));if(c=Math.max(1,Math.round(c*this.getNetworkMultiplier(e.effectiveType))),a>0){let p=Math.max(1,Math.round(e.memoryGiB*1024*1024*1024*.15/a));c=Math.min(c,p)}return this.clampConcurrency(c)}getInFlightBytesBudget(){let e=this.getRuntimeSignals(),t=this.getHardConcurrencyCapFromEnvironment(),o=this.getAverageKnownSize(),r=e.memoryGiB*1024*1024*1024*.18,a=o*t*1.5,p=Math.max(r,a)*this.getNetworkMultiplier(e.effectiveType);return Math.max(o,Math.round(p))}getApproxInFlightBytes(){let e=0;return this.activeUploadSizes.forEach(t=>e+=t),e}getAverageKnownSize(){let e=this.queue.map(r=>r.file.size).filter(r=>r>0),t=Array.from(this.activeUploadSizes.values()).filter(r=>r>0),o=[...e,...t];return o.length?Math.round(o.reduce((r,a)=>r+a,0)/o.length):32*1024*1024}clampConcurrency(e){return Math.max(1,Math.min(12,Math.floor(e||1)))}getRuntimeSignals(){let e=navigator;return{cores:Math.max(1,Number(e.hardwareConcurrency||4)),memoryGiB:Math.max(1,Number(e.deviceMemory||4)),effectiveType:e.connection&&e.connection.effectiveType?String(e.connection.effectiveType).toLowerCase():""}}getNetworkMultiplier(e){return e.includes("slow-2g")?.25:e.includes("2g")?.35:e.includes("3g")?.6:e.includes("4g")?1:e.includes("5g")?1.15:.85}emitEvent(e,t){this.imageUploadSessionService.emit({tempId:e.tempId,filename:e.file.name,image_size:e.file.size,image_type:this.resolveImageType(e.file.name),progress:e.progress,status:e.status,errorMessage:t,controller_id:e.controller.id}),(e.status==="uploaded"||e.status==="error"||e.status==="canceled")&&this.imageUploadSessionService.unregisterCancelHandler(e.tempId)}resolveImageType(e){let t=(e||"").split(".");return t.length>1?t[t.length-1].toLowerCase():"unknown"}updateActiveCount(){this.activeCountSource.next(this.activeUploads.size+this.getPendingTasks().length)}static \u0275fac=function(t){return new(t||n)(ge(js),ge(Lc),ge(kg),ge(te))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function vIe(n,i){if(n&1){let e=z();s(0,"h1",1),d(1,` Would you like to automatically install appliances for this image?
`),l(),s(2,"mat-dialog-content")(3,"mat-radio-group",2),g("change",function(o){k(e);let r=v();return T(r.selectInstallApplianceOption(o))}),s(4,"mat-radio-button",3),d(5," Yes "),l(),s(6,"mat-radio-button",3),d(7," No "),l()()(),s(8,"mat-dialog-actions",4)(9,"button",5),g("click",function(){k(e);let o=v();return T(o.closeDialog())}),d(10,"Cancel"),l(),s(11,"button",6),g("click",function(){k(e);let o=v();return T(o.isInstallAppliance=!o.isInstallAppliance)}),d(12,"Next"),l()()}if(n&2){let e=v();m(3),C("value",e.install_appliance),m(),C("value",!0)("checked",e.install_appliance),m(2),C("value",!1)("checked",!e.install_appliance)}}function CIe(n,i){if(n&1){let e=z();s(0,"h1",1),d(1,"Select image file(s) to upload"),l(),s(2,"mat-dialog-content")(3,"p",7)(4,"mat-icon",8),d(5,"info_outline"),l(),d(6," Uploads run in the background \u2014 you can navigate away freely. "),l(),s(7,"input",9,0),g("change",function(o){k(e);let r=v();return T(r.onFilesSelected(o))}),l()(),s(9,"mat-dialog-actions",4)(10,"button",5),g("click",function(){k(e);let o=v();return T(o.isInstallAppliance=!1)}),d(11,"Back"),l(),s(12,"button",6),g("click",function(){k(e);let o=Pe(8);return T(o.click())}),d(13,"Browse"),l()()}}var CM=(()=>{class n{controller;dialogRef;backgroundUploadService=f(_j);toasterService=f(te);cd=f(Q);isInstallAppliance=!1;install_appliance=!1;constructor(e,t){this.controller=e,this.dialogRef=t}ngOnInit(){this.cd.markForCheck()}onFilesSelected(e){let t=e.target;if(!t.files||!t.files.length)return;let o=t.files.length;for(let a=0;a<o;a++)this.backgroundUploadService.queueFile(this.controller,t.files[a],this.install_appliance);t.value="";let r=o===1?"1 file":`${o} files`;this.toasterService.success(`${r} queued \u2014 uploading in the background`),this.dialogRef.close(!0)}selectInstallApplianceOption(e){this.install_appliance=e.value===!0,this.cd.markForCheck()}closeDialog(){this.dialogRef.close(!1)}static \u0275fac=function(t){return new(t||n)(ot(gt),ot(Ie))};static \u0275cmp=F({type:n,selectors:[["app-add-image-dialog"]],decls:2,vars:2,consts:[["fileInput",""],["mat-dialog-title",""],["name","install_appliances",3,"change","value"],[3,"value","checked"],["align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click"],[1,"add-image-dialog-hint"],[1,"add-image-dialog-hint-icon"],["type","file","accept",".bin,.image,.iol,.qcow2,.vmdk","multiple","",1,"add-image-dialog-file-input",3,"change"]],template:function(t,o){t&1&&(A(0,vIe,13,5),A(1,CIe,14,0)),t&2&&(O(o.isInstallAppliance?-1:0),m(),O(o.isInstallAppliance?1:-1))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,ie,de,io,xo,ho],encapsulation:2,changeDetection:0})}return n})();function bIe(n,i){if(n&1&&(s(0,"li",5),d(1),l()),n&2){let e=i.$implicit,t=i.$index;m(),ui("",t+1,". ",e==null?null:e.filename)}}function xIe(n,i){if(n&1){let e=z();s(0,"h1",1),d(1,"Do you want delete all files?"),l(),s(2,"mat-dialog-content",2)(3,"p",3),d(4,"Your selected files"),l(),s(5,"ul",4),Y(6,bIe,2,2,"li",5,Hi),l()(),s(8,"mat-dialog-actions",6)(9,"button",7),g("click",function(){k(e);let o=v();return T(o.deleteAll())}),d(10,"Delete"),l(),s(11,"button",8),d(12,"Cancel"),l()()}if(n&2){let e=v();m(6),Z(e.deleteData==null?null:e.deleteData.deleteFilesPaths)}}function yIe(n,i){n&1&&(s(0,"h1",9),d(1,"Please wait."),l(),s(2,"mat-dialog-content",10),R(3,"mat-spinner",11),l())}function SIe(n,i){if(n&1&&d(0),n&2){let e=v(),t=e.$implicit,o=e.$index;ui(" ",o+1,". ",t==null||t.error==null?null:t.error.message," ")}}function wIe(n,i){if(n&1&&(s(0,"li",5),A(1,SIe,1,2),l()),n&2){let e=i.$implicit;Be("delete-files__list-item--error",e==null||e.error==null?null:e.error.message),m(),O(e!==null?1:-1)}}function MIe(n,i){if(n&1&&(s(0,"h5",14),d(1,"Images can't be deleted because image used in one or more template."),l(),s(2,"ul",4),Y(3,wIe,2,3,"li",15,Hi),l()),n&2){let e=v(2);m(3),Z(e.deleteFliesDetails)}}function kIe(n,i){if(n&1&&(s(0,"h5",12),d(1),l()),n&2){let e=v(2);m(),ee("",e.fileNotDeleted.length," Images deleted successfully.")}}function TIe(n,i){if(n&1){let e=z();s(0,"mat-dialog-content",2),A(1,MIe,5,0),A(2,kIe,2,1,"h5",12),l(),s(3,"mat-dialog-actions",6)(4,"button",13),g("click",function(){k(e);let o=v();return T(o.dialogRef.close(!1))}),d(5,"Close"),l()()}if(n&2){let e=v();m(),O(e.deleteFliesDetails.length>0?1:-1),m(),O(e.fileNotDeleted.length>0?2:-1)}}var bM=(()=>{class n{deleteData;dialogRef;imageService=f(Lc);toasterService=f(te);cd=f(Q);isDelete=!1;isUsedFiles=!1;deleteFliesDetails=[];fileNotDeleted=[];constructor(e,t){this.deleteData=e,this.dialogRef=t}async deleteAll(){this.isDelete=!0,await this.deleteFile()}deleteFile(){let e=[];this.deleteData.deleteFilesPaths.forEach(t=>{e.push(this.imageService.deleteFile(this.deleteData.controller,t.filename).pipe(po(o=>Nn(o))))}),qi(e).subscribe({next:t=>{this.deleteFliesDetails=t.filter(o=>o!==null),this.fileNotDeleted=t.filter(o=>o===null),this.isUsedFiles=!0,this.isDelete=!0,this.cd.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to delete files";this.toasterService.error(o),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)(ot(gt),ot(Ie))};static \u0275cmp=F({type:n,selectors:[["app-deleteallfiles-dialog"]],decls:4,vars:3,consts:[[1,"delete-files"],["mat-dialog-title","",1,"delete-files__title"],[1,"delete-files__content"],[1,"delete-files__subtitle"],[1,"delete-files__list"],[1,"delete-files__list-item"],[1,"delete-files__actions"],["mat-button","",3,"click"],["mat-button","","mat-dialog-close","","cdkFocusInitial",""],["mat-dialog-title","",1,"delete-files__title","delete-files__title--center"],[1,"delete-files__content","delete-files__content--center"],["color","accent"],[1,"delete-files__success-title"],["mat-raised-button","","color","primary",3,"click"],[1,"delete-files__error-title"],[1,"delete-files__list-item",3,"delete-files__list-item--error"]],template:function(t,o){t&1&&(s(0,"div",0),A(1,xIe,13,0),A(2,yIe,4,0),A(3,TIe,6,2),l()),t&2&&(m(),O(!o.isDelete&&!o.isUsedFiles?1:-1),m(),O(o.isDelete&&!o.isUsedFiles?2:-1),m(),O(o.isDelete&&o.isUsedFiles?3:-1))},dependencies:[ne,_e,pc,Ne,Fe,bt,W,pe,pn,li],styles:[".delete-files[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:400px}.delete-files__title[_ngcontent-%COMP%]{margin:0;padding:24px 24px 16px;font-size:18px;font-weight:500;color:var(--mat-sys-on-surface)}.delete-files__title--center[_ngcontent-%COMP%]{text-align:center}.delete-files__content[_ngcontent-%COMP%]{padding:0 24px 16px}.delete-files__content--center[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:24px}.delete-files__subtitle[_ngcontent-%COMP%]{margin:0 0 12px;font-size:14px;color:var(--mat-sys-on-surface-variant)}.delete-files__list[_ngcontent-%COMP%]{margin:0;padding-left:20px;list-style:decimal}.delete-files__list-item[_ngcontent-%COMP%]{padding:4px 0;font-size:14px;color:var(--mat-sys-on-surface)}.delete-files__list-item--error[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.delete-files__error-title[_ngcontent-%COMP%]{margin:0 0 12px;font-size:14px;font-weight:500;color:var(--mat-sys-error)}.delete-files__success-title[_ngcontent-%COMP%]{margin:16px 0 0;font-size:14px;font-weight:500;color:var(--mat-sys-primary)}.delete-files__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;padding:16px 24px 24px;gap:12px}@media(max-width:480px){.delete-files[_ngcontent-%COMP%]{min-width:300px}.delete-files__title[_ngcontent-%COMP%]{padding:16px 16px 12px}.delete-files__content[_ngcontent-%COMP%]{padding:0 16px 12px}.delete-files__actions[_ngcontent-%COMP%]{padding:12px 16px 16px;flex-direction:column}}"],changeDetection:0})}return n})();var xM=class{dataChange=new an([]);get data(){return this.dataChange.value}addImages(i){this.dataChange.next(i)}},yM=class extends cd{controllerDatabase;sort;paginator;filterChange=new an("");constructor(i,e,t){super(),this.controllerDatabase=i,this.sort=e,this.paginator=t}setFilter(i){this.filterChange.next((i||"").trim().toLowerCase())}connect(){let i=this.sort?this.sort.sortChange:new an(null),e=this.paginator?this.paginator.page:new an(null);return Hn(this.controllerDatabase.dataChange,i,this.filterChange,e).pipe(Lt(()=>{let t=this.controllerDatabase.data.slice(),o=this.filterChange.value;if(o&&(t=t.filter(r=>[r.filename,r.image_type,r.image_size,r.created_at,r.uploadStatus].map(c=>String(c||"").toLowerCase()).join(" ").includes(o))),!this.sort||!this.sort.active||this.sort.direction===""||(t=t.sort((r,a)=>{let c=this.getSortValue(r,this.sort.active),p=this.getSortValue(a,this.sort.active);return(c<p?-1:1)*(this.sort.direction==="asc"?1:-1)})),this.paginator&&(this.paginator.length=t.length),this.paginator){let r=this.paginator.pageIndex*this.paginator.pageSize,a=r+this.paginator.pageSize;t=t.slice(r,a)}return t}))}getSortValue(i,e){let t=i[e];if(e==="image_size")return Number(t||0);if(e==="created_at"||e==="updated_at"){let o=Date.parse(String(t||""));return isNaN(o)?0:o}return String(t||"").toLowerCase()}disconnect(){}};function EIe(n,i){if(n&1){let e=z();s(0,"mat-header-cell")(1,"mat-checkbox",28),g("change",function(o){k(e);let r=v();return T(o?r.selectAllImages():null)}),l()()}if(n&2){let e=v();m(),C("checked",e.hasSelection()&&e.isAllSelected())("indeterminate",e.hasSelection()&&!e.isAllSelected())}}function DIe(n,i){if(n&1){let e=z();s(0,"mat-cell")(1,"mat-checkbox",29),g("click",function(o){let r=k(e).$implicit,a=v();return T(a.onRowCheckboxClick(o,r))}),l()()}if(n&2){let e=i.$implicit,t=v();m(),C("checked",t.isRowSelected(e))("disabled",!t.isPersistedRow(e))}}function PIe(n,i){n&1&&(s(0,"mat-header-cell",30),d(1," File Name "),l())}function IIe(n,i){if(n&1&&(s(0,"span"),d(1),l()),n&2){let e=v(2).$implicit;m(),ee(" - ",e.errorMessage)}}function AIe(n,i){if(n&1&&(s(0,"div",33),R(1,"mat-progress-bar",34),s(2,"span",35),d(3),en(4,"titlecase"),A(5,IIe,2,1,"span"),l()()),n&2){let e=v().$implicit;m(),C("value",e.uploadProgress||0),m(),Be("image-manager__upload-error",e.uploadStatus==="error"),m(),ui(" ",jn(4,6,e.uploadStatus)," ",e.uploadProgress||0,"% "),m(2),O(e.errorMessage?5:-1)}}function OIe(n,i){if(n&1&&(s(0,"mat-cell")(1,"div",31)(2,"span",32),d(3),l(),A(4,AIe,6,8,"div",33),l()()),n&2){let e=i.$implicit,t=v();m(3),j(e.filename),m(),O(t.hasUploadState(e)?4:-1)}}function NIe(n,i){n&1&&(s(0,"mat-header-cell",30),d(1," Image Type "),l())}function FIe(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit;m(),ee(" ",e.image_type," ")}}function RIe(n,i){n&1&&(s(0,"mat-header-cell",30),d(1," Image Size "),l())}function LIe(n,i){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=i.$implicit,t=v();m(),ee(" ",t.formatImageSize(e)," ")}}function VIe(n,i){n&1&&(s(0,"mat-header-cell",30),d(1," Created "),l())}function BIe(n,i){if(n&1&&(s(0,"mat-cell"),d(1),en(2,"date"),l()),n&2){let e=i.$implicit;m(),ee(" ",e.created_at?na(2,1,e.created_at,"short"):"-"," ")}}function zIe(n,i){if(n&1){let e=z();s(0,"button",37),g("click",function(){k(e);let o=v(2);return T(o.deleteAllFiles())}),s(1,"mat-icon"),d(2,"delete"),l()()}}function jIe(n,i){if(n&1&&(s(0,"mat-header-cell"),A(1,zIe,3,0,"button",36),l()),n&2){let e=v();m(),O(e.hasSelection()&&e.isAllSelected()||e.selectedCount()>1?1:-1)}}function $Ie(n,i){if(n&1){let e=z();s(0,"button",37),g("click",function(){k(e);let o=v().$implicit,r=v();return T(r.deleteFile(o.path))}),s(1,"mat-icon"),d(2,"delete"),l()()}}function HIe(n,i){if(n&1){let e=z();s(0,"button",39),g("click",function(){k(e);let o=v().$implicit,r=v();return T(r.cancelUpload(o))}),s(1,"mat-icon"),d(2,"cancel"),l()()}}function UIe(n,i){if(n&1&&(s(0,"mat-cell"),A(1,$Ie,3,0,"button",36),A(2,HIe,3,0,"button",38),l()),n&2){let e=i.$implicit,t=v();m(),O(t.isPersistedRow(e)&&t.isRowSelected(e)?1:-1),m(),O(t.hasUploadState(e)&&(e.uploadStatus==="uploading"||e.uploadStatus==="queued")?2:-1)}}function GIe(n,i){n&1&&R(0,"mat-header-row")}function WIe(n,i){if(n&1){let e=z();s(0,"mat-row",40),g("click",function(o){let r=k(e).$implicit,a=v();return T(a.onRowCheckboxClick(o,r))}),l()}if(n&2){let e=i.$implicit,t=v();Be("image-manager__row-highlight",t.isHighlighted(e))}}var SM=(()=>{class n{controller;controllerId;version;dataSource;imageDatabase=new xM;searchText=U("");isAllDelete=!1;selectedPaths=new Set;images=[];uploadRows=new Map;uploadEventsSubscription;dataRowsSubscription;refreshAfterUploadTimer;displayedRows=[];lastSelectedPath=null;highlightedFilename=null;highlightTimer;pageSizeOptions=[5,10,25,50,100];defaultPageSize=10;currentPage=0;displayedColumns=ae(["select","filename","image_type","image_size","created_at","delete"]);sort=Nt(mo);paginator=Nt(hr);imageService=f(Lc);route=f(lt);controllerService=f(Je);dialog=f(nt);toasterService=f(te);imageUploadSessionService=f(kg);router=f(ht);cd=f(Q);constructor(){}ngOnInit(){this.controllerId=parseInt(this.route.snapshot.paramMap.get("controller_id"),10);let e=this.sort();e&&e.sort({id:"filename",start:"asc"});let t=this.paginator();t&&(t.pageIndex=this.currentPage,t.pageSize=this.defaultPageSize),this.dataSource=new yM(this.imageDatabase,e,t),this.dataRowsSubscription=this.dataSource.connect().subscribe(o=>{this.displayedRows=o||[]}),this.uploadEventsSubscription=this.imageUploadSessionService.events$.subscribe(o=>{this.onUploadEvent(o)}),this.route.queryParams.subscribe(o=>{o.highlight&&(this.flashRow(o.highlight),this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0}))}),this.controllerService.get(this.controllerId).then(o=>{this.controller=o,o.authToken&&this.getImages()},o=>{let r=o.error?.message||o.message||"Failed to load controller";this.toasterService.error(r),this.cd.markForCheck()})}ngOnDestroy(){this.uploadEventsSubscription&&this.uploadEventsSubscription.unsubscribe(),this.dataRowsSubscription&&this.dataRowsSubscription.unsubscribe(),this.refreshAfterUploadTimer&&clearTimeout(this.refreshAfterUploadTimer),this.highlightTimer&&clearTimeout(this.highlightTimer)}getImages(){this.imageService.getImages(this.controller).subscribe({next:e=>{this.images=e||[],this.syncUploadedRowsWithPersistedData(),this.refreshTableRows(),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to get images";this.toasterService.error(t),this.cd.markForCheck()}})}onPageEvent(e){this.currentPage=e.pageIndex}onSearchChange(e){if(this.searchText.set(e),this.dataSource){this.dataSource.setFilter(e);let t=this.paginator();t&&(t.pageIndex=0)}}isHighlighted(e){return!!this.highlightedFilename&&e.filename===this.highlightedFilename}flashRow(e){this.highlightTimer&&clearTimeout(this.highlightTimer),this.highlightedFilename=e,this.highlightTimer=setTimeout(()=>{this.highlightedFilename=null},2e3)}isPersistedRow(e){return e&&e.rowType==="image"}hasUploadState(e){return e&&e.rowType==="upload"}formatImageSize(e){let t=Number(e.image_size||0);return t?`${(t/1e6).toFixed(2)} MB`:"0 MB"}deleteFile(e){this.dialog.open(Vd,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel","question-dialog-panel"],data:{title:"Delete image",question:"Are you sure you want to delete this image?"}}).afterClosed().subscribe(o=>{o&&this.imageService.deleteFile(this.controller,e).subscribe({next:()=>{this.getImages(),this.unChecked(),this.toasterService.success("File deleted"),this.cd.markForCheck()},error:r=>{let a=r.error?.message||r.message||"Failed to delete file";this.toasterService.error(a),this.getImages(),this.unChecked(),this.cd.markForCheck()}})})}cancelUpload(e){!e||!e.tempId||(this.imageUploadSessionService.requestCancel(e.tempId),this.toasterService.warning("Image file uploading canceled"))}onRowCheckboxClick(e,t){if(e.preventDefault(),e.stopPropagation(),!this.isPersistedRow(t))return;let r=!this.isRowSelected(t);e.shiftKey&&this.lastSelectedPath?this.selectRowRange(this.lastSelectedPath,t.path,r)||this.toggleRowSelection(t,r):this.toggleRowSelection(t,r),this.lastSelectedPath=t.path||null}trackByRow(e,t){return t.tempId||t.path||`${t.filename}-${e}`}isAllSelected(){let e=new Set(this.getSelectableRows().map(r=>r.path)),t=Array.from(this.selectedPaths).filter(r=>e.has(r)).length,o=e.size;return o===0?!1:t===o}selectAllImages(){this.isAllSelected()?this.unChecked():this.allChecked()}unChecked(){this.selectedPaths.clear(),this.isAllDelete=!1,this.lastSelectedPath=null}allChecked(){this.getSelectableRows().forEach(e=>{e.path&&this.selectedPaths.add(e.path)}),this.isAllDelete=!0}hasSelection(){return this.selectedPaths.size>0}selectedCount(){return this.selectedPaths.size}installAllImages(){this.dialog.open(Vd,{panelClass:["base-confirmation-dialog-panel","confirmation-info-panel","question-dialog-panel"],data:{title:"Install all images",question:"This will attempt to automatically create templates based on image checksums. Continue?"}}).afterClosed().subscribe(t=>{t&&this.imageService.installImages(this.controller).subscribe({next:()=>{this.toasterService.success("Images installed"),this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to install images";this.toasterService.error(r),this.cd.markForCheck()}})})}pruneImages(){this.dialog.open(Vd,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel","question-dialog-panel"],data:{title:"Prune images",question:"Delete all images not used by a template? This cannot be reverted."}}).afterClosed().subscribe(t=>{t&&this.imageService.pruneImages(this.controller).subscribe({next:()=>{this.getImages(),this.unChecked(),this.toasterService.success("Images pruned"),this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to prune images";this.toasterService.error(r),this.getImages(),this.unChecked(),this.cd.markForCheck()}})})}addImageDialog(){this.dialog.open(CM,{panelClass:["base-dialog-panel","add-image-dialog-panel"],autoFocus:!1,data:this.controller}).afterClosed().subscribe(t=>{this.getImages(),this.unChecked()})}deleteAllFiles(){this.dialog.open(bM,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel","delete-all-images-dialog-panel"],autoFocus:!1,disableClose:!0,data:{controller:this.controller,deleteFilesPaths:this.getSelectedRows()}}).afterClosed().subscribe(t=>{if(t)this.unChecked(),this.getImages(),this.toasterService.success("All files deleted");else return this.unChecked(),this.getImages(),!1})}onUploadEvent(e){if(!e)return;if(e.status==="canceled"){this.uploadRows.delete(e.tempId),this.refreshTableRows();return}let t=this.uploadRows.get(e.tempId),o={rowType:"upload",tempId:e.tempId,filename:e.filename,image_type:e.image_type,image_size:e.image_size,uploadProgress:e.progress,uploadStatus:e.status,errorMessage:e.errorMessage,created_at:"",updated_at:""};this.uploadRows.set(e.tempId,K(K({},t||{}),o)),this.refreshTableRows(),e.status==="uploaded"&&this.scheduleImagesRefresh()}scheduleImagesRefresh(){this.refreshAfterUploadTimer&&clearTimeout(this.refreshAfterUploadTimer),this.refreshAfterUploadTimer=setTimeout(()=>{this.getImages()},300)}refreshTableRows(){let e=this.images.map(o=>it(K({},o),{rowType:"image"})),t=Array.from(this.uploadRows.values());this.removeInvalidSelections(e),this.imageDatabase.addImages([...t,...e])}removeInvalidSelections(e){let t=new Set(e.map(o=>o.path).filter(o=>!!o));Array.from(this.selectedPaths).forEach(o=>{t.has(o)||this.selectedPaths.delete(o)}),this.lastSelectedPath&&!e.some(o=>o.path===this.lastSelectedPath)&&(this.lastSelectedPath=null)}syncUploadedRowsWithPersistedData(){let e=new Set(this.images.map(t=>t.filename));this.uploadRows.forEach((t,o)=>{t.uploadStatus==="uploaded"&&e.has(t.filename)&&this.uploadRows.delete(o)})}getSelectableRows(){return this.imageDatabase.data.filter(e=>this.isPersistedRow(e))}getVisibleSelectableRows(){return(this.displayedRows&&this.displayedRows.length?this.displayedRows:this.getSelectableRows()).filter(t=>this.isPersistedRow(t))}selectRowRange(e,t,o){let r=this.getVisibleSelectableRows(),a=r.findIndex(h=>h.path===e),c=r.findIndex(h=>h.path===t);if(a<0||c<0)return!1;let p=Math.min(a,c),u=Math.max(a,c);return r.slice(p,u+1).forEach(h=>this.toggleRowSelection(h,o)),!0}toggleRowSelection(e,t){if(t){this.selectRow(e);return}this.deselectRow(e)}isRowSelected(e){return!e||!e.path?!1:this.selectedPaths.has(e.path)}selectRow(e){!e||!e.path||this.selectedPaths.add(e.path)}deselectRow(e){!e||!e.path||this.selectedPaths.delete(e.path)}getSelectedRows(){return this.getSelectableRows().filter(t=>t.path&&this.selectedPaths.has(t.path))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-image-manager"]],viewQuery:function(t,o){t&1&&Xt(o.sort,mo,5)(o.paginator,hr,5),t&2&&Kt(2)},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:47,vars:8,consts:[["table",""],[1,"image-manager"],[1,"image-manager__header"],["mat-icon-button","",1,"image-manager__back-btn",3,"routerLink"],[1,"image-manager__title"],[1,"image-manager__actions"],["mat-icon-button","","matTooltip","Install all images","matTooltipClass","custom-tooltip",3,"click"],["mat-icon-button","","matTooltip","Prune images","matTooltipClass","custom-tooltip",3,"click"],["mat-icon-button","","matTooltip","Add image","matTooltipClass","custom-tooltip",3,"click"],[1,"image-manager__content"],[1,"image-manager__search-form"],["appearance","fill",1,"image-manager__search-field"],["matPrefix",""],["matInput","","placeholder","Search images",3,"input","value"],[1,"image-manager__table-container"],["matSort","",3,"dataSource","trackBy"],["matColumnDef","select"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","filename"],["mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","image_type"],["matColumnDef","image_size"],["matColumnDef","created_at"],["matColumnDef","delete"],[4,"matHeaderRowDef","matHeaderRowDefSticky"],[3,"image-manager__row-highlight","click",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],[3,"change","checked","indeterminate"],[3,"click","checked","disabled"],["mat-sort-header",""],[1,"image-manager__row-content"],[1,"image-manager__filename"],[1,"image-manager__upload-status"],["mode","determinate",3,"value"],[1,"image-manager__upload-text"],["mat-icon-button",""],["mat-icon-button","",3,"click"],["mat-icon-button","","matTooltip","Cancel upload","matTooltipClass","custom-tooltip"],["mat-icon-button","","matTooltip","Cancel upload","matTooltipClass","custom-tooltip",3,"click"],[3,"click"]],template:function(t,o){t&1&&(s(0,"div",1)(1,"header",2)(2,"button",3)(3,"mat-icon"),d(4,"arrow_back"),l()(),s(5,"h1",4),d(6,"Image Manager"),l(),s(7,"div",5)(8,"button",6),g("click",function(){return o.installAllImages()}),s(9,"mat-icon"),d(10,"done_all"),l()(),s(11,"button",7),g("click",function(){return o.pruneImages()}),s(12,"mat-icon"),d(13,"delete"),l()(),s(14,"button",8),g("click",function(){return o.addImageDialog()}),s(15,"mat-icon"),d(16,"add_circle_outline"),l()()()(),s(17,"main",9)(18,"form",10)(19,"mat-form-field",11)(20,"mat-icon",12),d(21,"search"),l(),s(22,"input",13),g("input",function(a){return o.onSearchChange(a.target.value)}),l()()(),s(23,"div",14)(24,"mat-table",15,0),Le(26,16),xe(27,EIe,2,2,"mat-header-cell",17)(28,DIe,2,2,"mat-cell",18),Ve(),Le(29,19),xe(30,PIe,2,0,"mat-header-cell",20)(31,OIe,5,2,"mat-cell",18),Ve(),Le(32,21),xe(33,NIe,2,0,"mat-header-cell",20)(34,FIe,2,1,"mat-cell",18),Ve(),Le(35,22),xe(36,RIe,2,0,"mat-header-cell",20)(37,LIe,2,1,"mat-cell",18),Ve(),Le(38,23),xe(39,VIe,2,0,"mat-header-cell",20)(40,BIe,3,4,"mat-cell",18),Ve(),Le(41,24),xe(42,jIe,2,1,"mat-header-cell",17)(43,UIe,3,2,"mat-cell",18),Ve(),xe(44,GIe,1,0,"mat-header-row",25)(45,WIe,1,2,"mat-row",26),l(),R(46,"mat-paginator",27),l()()()),t&2&&(m(2),C("routerLink","/controller/"+o.controllerId+"/projects"),m(20),C("value",o.searchText()),m(2),C("dataSource",o.dataSource)("trackBy",o.trackByRow),m(20),C("matHeaderRowDef",o.displayedColumns())("matHeaderRowDefSticky",!0),m(),C("matRowDefColumns",o.displayedColumns()),m(),C("pageSizeOptions",o.pageSizeOptions))},dependencies:[ne,dt,vn,Xe,at,rt,Gn,_e,ar,mo,Tr,sg,hr,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W,je,ie,de,we,Me,Gs,Se,Ee,Ot,Gt,ms,Rc,Zi,wt,It,LO,oC],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.image-manager__header[_ngcontent-%COMP%]{max-width:1200px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.image-manager__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.image-manager__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.image-manager__title[_ngcontent-%COMP%]{flex:1;font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.image-manager__actions[_ngcontent-%COMP%]{display:flex;gap:8px}.image-manager__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.image-manager__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.image-manager__content[_ngcontent-%COMP%]{max-width:1200px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.image-manager__search-form[_ngcontent-%COMP%]{margin-bottom:16px}.image-manager__search-field[_ngcontent-%COMP%]{width:100%}.image-manager__search-field[_ngcontent-%COMP%] .mat-mdc-form-icon[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant)}.image-manager__table-container[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.image-manager__row-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;width:100%}.image-manager__filename[_ngcontent-%COMP%]{word-break:break-word}.image-manager__upload-status[_ngcontent-%COMP%]{margin-top:4px}.image-manager__upload-text[_ngcontent-%COMP%]{display:inline-block;font-size:12px;margin-top:4px;word-break:break-word}.image-manager__upload-error[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.image-manager__row-highlight[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_row-flash 1.8s ease}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent);cursor:pointer}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center}mat-cell[_ngcontent-%COMP%], mat-header-cell[_ngcontent-%COMP%], mat-footer-cell[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;overflow:initial;min-height:inherit}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:3}.mat-header-cell[_ngcontent-%COMP%]{background:inherit}.mat-table-sticky[_ngcontent-%COMP%]{top:0;z-index:3}.mat-column-filename[_ngcontent-%COMP%]{flex:2;min-width:250px}.mat-column-image_type[_ngcontent-%COMP%], .mat-column-image_size[_ngcontent-%COMP%]{flex:1;min-width:120px}.mat-column-created_at[_ngcontent-%COMP%]{flex:1;min-width:140px}.mat-column-select[_ngcontent-%COMP%], .mat-column-delete[_ngcontent-%COMP%]{flex:0 0 60px;min-width:60px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_row-flash{0%{background-color:transparent}20%,80%{background-color:color-mix(in srgb,var(--mat-sys-shadow) 4%,transparent)}to{background-color:transparent}}@media(max-width:768px){.image-manager__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px;flex-wrap:wrap}.image-manager__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.image-manager__title[_ngcontent-%COMP%]{font-size:24px;order:1;flex:1 1 100%}.image-manager__actions[_ngcontent-%COMP%]{order:2;margin-left:auto}.image-manager__content[_ngcontent-%COMP%]{padding:0 16px 16px}.image-manager__table-container[_ngcontent-%COMP%]{overflow-x:auto}.mat-column-filename[_ngcontent-%COMP%]{min-width:180px}.mat-column-image_type[_ngcontent-%COMP%], .mat-column-image_size[_ngcontent-%COMP%]{min-width:90px}.mat-column-created_at[_ngcontent-%COMP%]{min-width:100px}mat-cell[_ngcontent-%COMP%], mat-header-cell[_ngcontent-%COMP%]{font-size:12px}}@media(max-width:640px){.mat-column-created_at[_ngcontent-%COMP%]{display:none}}"],changeDetection:0})}return n})();var qIe=(n,i)=>i.route;function QIe(n,i){if(n&1&&(s(0,"a",7,1)(2,"mat-icon",9),d(3),l(),d(4),l()),n&2){let e=i.$implicit;C("routerLink",Ui("./",e.route)),m(3),j(e.icon),m(),ee(" ",e.label," ")}}var wM=(()=>{class n{route=f(lt);router=f(ht);controllerService=f(Je);toasterService=f(te);cd=f(Q);controller;links=ae([{label:"Users",icon:"people",route:"users"},{label:"Groups",icon:"group",route:"groups"},{label:"Roles",icon:"badge",route:"roles"},{label:"Pools",icon:"folder_special",route:"pools"},{label:"ACL",icon:"security",route:"ACL"}]);constructor(){}ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(+e).then(t=>{this.controller=t,this.cd.markForCheck()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-management"]],decls:12,vars:1,consts:[["tabPanel",""],["rla","routerLinkActive"],[1,"management__header"],[1,"management__header-content"],[1,"management__title"],[1,"management__tab-nav"],["mat-tab-nav-bar","",3,"tabPanel"],["mat-tab-link","","routerLinkActive","",1,"management__tab-link",3,"routerLink"],[1,"management__content"],[1,"management__tab-icon"]],template:function(t,o){if(t&1&&(s(0,"section",2)(1,"div",3)(2,"h1",4),d(3,"Controller Management"),l()()(),s(4,"section",5),R(5,"mat-tab-nav-panel",null,0),s(7,"nav",6),Y(8,QIe,5,4,"a",7,qIe),l()(),s(10,"section",8),R(11,"router-outlet"),l()),t&2){let r=Pe(6);m(7),C("tabPanel",r),m(),Z(o.links())}},dependencies:[ne,dt,Ku,vn,v4,To,B4,j4,z4,ie,de],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.management__header[_ngcontent-%COMP%]{max-width:1000px;margin:0 auto;padding:32px 20px 16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.management__header-content[_ngcontent-%COMP%]{display:flex;align-items:flex-end;justify-content:flex-start;gap:16px;animation:_ngcontent-%COMP%_fadeIn .5s ease-out}.management__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.management__tab-nav[_ngcontent-%COMP%]{max-width:1000px;margin:0 auto;padding:0 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.management__tab-link[_ngcontent-%COMP%]{font-weight:500;letter-spacing:.3px;transition:color .2s cubic-bezier(.4,0,.2,1)}.management__tab-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;margin-right:4px;vertical-align:middle}.management__content[_ngcontent-%COMP%]{max-width:1000px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@media(max-width:768px){.management__header[_ngcontent-%COMP%]{padding:24px 16px 12px}.management__title[_ngcontent-%COMP%]{font-size:24px}.management__tab-nav[_ngcontent-%COMP%]{padding:0 16px}.management__content[_ngcontent-%COMP%]{padding:0 16px 16px}}"],changeDetection:0})}return n})();var vj=(n,i)=>e=>Qa(500).pipe(Un(()=>i.getGroups(n)),Lt(t=>t.find(o=>o.name===e.value)?{projectExist:!0}:null));var MM=(()=>{class n{get(e){return new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\":<>\?]/).test(e.value)?{invalidName:!0}:null}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var KIe=(n,i)=>i.username;function YIe(n,i){n&1&&(s(0,"mat-error"),d(1,"Group name is required"),l())}function ZIe(n,i){n&1&&(s(0,"mat-error"),d(1,"Group name is incorrect"),l())}function JIe(n,i){n&1&&(s(0,"mat-error"),d(1,"Group with this name exists"),l())}function e3e(n,i){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ui(" ",e.username," - ",e.email," ")}}function t3e(n,i){if(n&1){let e=z();s(0,"div")(1,"div",13)(2,"div"),d(3),l(),s(4,"div"),d(5),l(),s(6,"mat-icon",14),g("click",function(){let o=k(e).$implicit,r=v();return T(r.delUser(o))}),d(7,"delete"),l()()()}if(n&2){let e=i.$implicit;m(3),j(e.username),m(2),j(e.email)}}var kM=(()=>{class n{data;groupNameValidator;dialogRef=f(Ie);formBuilder=f(Vn);groupService=f(kl);userService=f(Er);toasterService=f(te);cd=f(Q);groupNameForm;controller;users=[];usersToAdd=new Set([]);filteredUsers;loading=!1;autocompleteControl=new Ye;constructor(e,t){this.data=e,this.groupNameValidator=t}ngOnInit(){this.controller=this.data.controller,this.groupNameForm=this.formBuilder.group({groupName:new Ye(null,[Ue.required,this.groupNameValidator.get],[vj(this.data.controller,this.groupService)])}),this.userService.list(this.controller).subscribe({next:e=>{this.users=e,this.filteredUsers=this.autocompleteControl.valueChanges.pipe(pi(""),Lt(t=>this._filter(t))),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load users";this.toasterService.error(t),this.cd.markForCheck()}})}onKeyDown(e){e.key==="Enter"&&this.onAddClick()}get form(){return this.groupNameForm.controls}onAddClick(){if(this.groupNameForm.invalid)return;let e=this.groupNameForm.controls.groupName.value,t=Array.from(this.usersToAdd.values());this.groupService.addGroup(this.controller,e).subscribe({next:o=>{t.forEach(r=>{this.groupService.addMemberToGroup(this.controller,o,r).subscribe({next:()=>{this.toasterService.success(`user ${r.username} was added`)},error:a=>{let c=a.error?.message||a.message||"Failed to add user to group";this.toasterService.error(c),this.cd.markForCheck()}})}),this.dialogRef.close(!0)},error:o=>{let r=o.error?.message||o.message||"Failed to create group";this.toasterService.error(r),this.dialogRef.close(!1)}})}onNoClick(){this.dialogRef.close()}selectedUser(e){this.usersToAdd.add(e)}delUser(e){this.usersToAdd.delete(e)}_filter(e){if(typeof e=="string"){let t=e.toLowerCase();return this.users.filter(o=>o.username.toLowerCase().includes(t)||o.email?.toLowerCase().includes(t))}}displayFn(e){return e&&e.username?e.username:""}static \u0275fac=function(t){return new(t||n)(ot(gt),ot(MM))};static \u0275cmp=F({type:n,selectors:[["app-add-group-dialog"]],features:[fn([MM])],decls:30,vars:9,consts:[["auto","matAutocomplete"],["mat-dialog-title",""],[3,"formGroup"],["mat-dialog-content",""],["appearance","fill",1,"full-width-field"],["matInput","","type","text","formControlName","groupName","placeholder","Please enter group name",3,"keydown"],["type","text","matInput","",3,"matAutocomplete","formControl"],[3,"optionSelected","displayWith"],[3,"value"],[1,"users"],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],[1,"userList"],[3,"click"]],template:function(t,o){if(t&1&&(s(0,"h1",1),d(1,"Create new group"),l(),s(2,"form",2)(3,"div",3)(4,"mat-form-field",4)(5,"mat-label"),d(6,"Group name"),l(),s(7,"input",5),g("keydown",function(a){return o.onKeyDown(a)}),l(),A(8,YIe,2,0,"mat-error"),A(9,ZIe,2,0,"mat-error"),A(10,JIe,2,0,"mat-error"),l(),s(11,"h5"),d(12,"Add users to group:"),l(),s(13,"mat-form-field",4)(14,"mat-label"),d(15,"Users"),l(),R(16,"input",6),s(17,"mat-autocomplete",7,0),g("optionSelected",function(a){return o.selectedUser(a.option.value)}),Y(19,e3e,2,3,"mat-option",8,Ae),en(21,"async"),l()(),s(22,"div",9),Y(23,t3e,8,2,"div",null,KIe),l()(),s(25,"div",10)(26,"button",11),g("click",function(){return o.onNoClick()}),d(27,"Cancel"),l(),s(28,"button",12),g("click",function(){return o.onAddClick()}),d(29,"Add group"),l()()()),t&2){let r=Pe(18);m(2),C("formGroup",o.groupNameForm),m(6),O(o.form.groupName!=null&&o.form.groupName.touched&&(o.form.groupName!=null&&o.form.groupName.errors)&&(o.form.groupName!=null&&o.form.groupName.errors.required)?8:-1),m(),O(o.form.groupName!=null&&o.form.groupName.errors&&(o.form.groupName!=null&&o.form.groupName.errors.invalidName)?9:-1),m(),O(o.form.groupName!=null&&o.form.groupName.errors&&(o.form.groupName!=null&&o.form.groupName.errors.projectExist)?10:-1),m(6),C("matAutocomplete",r)("formControl",o.autocompleteControl),m(),C("displayWith",o.displayFn),m(2),Z(jn(21,7,o.filteredUsers)),m(4),Z(o.usersToAdd)}},dependencies:[ne,Dt,at,Ft,Pt,rt,Hs,Rt,zt,_e,Ne,Fe,bt,W,pe,we,Me,et,fi,Se,Ee,Yr,Sa,_t,Ko,ie,de,zr],styles:[".full-width-field[_ngcontent-%COMP%]{width:100%}.userList[_ngcontent-%COMP%]{display:flex;margin:10px;justify-content:space-between;flex:1 1 auto}.users[_ngcontent-%COMP%]{display:flex;min-height:40px;overflow:auto;flex-direction:column}"],changeDetection:0})}return n})();var n3e=(n,i)=>i.name;function i3e(n,i){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}var TM=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}onCancel(){this.dialogRef.close()}onDelete(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-delete-group-dialog"]],decls:10,vars:0,consts:[["mat-dialog-title",""],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following groups?"),l(),s(2,"ul"),Y(3,i3e,2,1,"li",null,n3e),l(),s(5,"div",1)(6,"button",2),g("click",function(){return o.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),g("click",function(){return o.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Z(o.data.groups))},dependencies:[ne,_e,Ne,Fe,W,pe],encapsulation:2,changeDetection:0})}return n})();var Cj=(()=>{class n{transform(e,t){return t&&(t=t.trim().toLowerCase(),e.filter=t),e}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"groupFilter",type:n,pure:!0})}return n})();var o3e=(n,i)=>i.username;function r3e(n,i){if(n&1){let e=z();s(0,"div",8)(1,"mat-checkbox",15),g("change",function(){let o=k(e).$implicit,r=v();return T(r.toggleUserSelection(o.user_id))}),l(),s(2,"div",16)(3,"div",17),d(4),l(),s(5,"div",18),d(6),l()()()}if(n&2){let e=i.$implicit,t=v();m(),C("checked",t.isUserSelected(e.user_id)),m(3),j(e.username),m(2),j(e.email)}}function a3e(n,i){n&1&&(s(0,"div",19)(1,"mat-icon"),d(2,"person_off"),l(),s(3,"p"),d(4,"No users found"),l()())}function s3e(n,i){n&1&&A(0,a3e,5,0,"div",19),n&2&&O(i.length===0?0:-1)}var EM=(()=>{class n{data;dialogRef=f(Ie);userService=f(Er);groupService=f(kl);toastService=f(te);cd=f(Q);users=new an([]);displayedUsers=new an([]);searchText=U("");loading=!1;selectedUserIds=ae(new Set);selectedCount=Jt(()=>this.selectedUserIds().size);allSelected=Jt(()=>{let e=this.displayedUsers.value;return e.length>0&&e.every(t=>this.selectedUserIds().has(t.user_id))});constructor(e){this.data=e}ngOnInit(){this.getUsers()}onSearch(){Qa(500).subscribe(()=>{let e=this.users.value.filter(t=>t.username.includes(this.searchText())||t.email?.includes(this.searchText()));this.displayedUsers.next(e),this.cd.markForCheck()})}getUsers(){qi([this.userService.list(this.data.controller),this.groupService.getGroupMember(this.data.controller,this.data.group.user_group_id)]).subscribe({next:e=>{let[t,o]=e,r=t.filter(a=>!o.find(c=>c.user_id===a.user_id));this.users.next(r),this.displayedUsers.next(r),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load users";this.toastService.error(t),this.cd.markForCheck()}})}addUser(e){this.loading=!0,this.groupService.addMemberToGroup(this.data.controller,this.data.group,e).subscribe({next:()=>{this.toastService.success(`user ${e.username} was added`),this.removeUserFromList(e),this.selectedUserIds.update(t=>{let o=new Set(t);return o.delete(e.user_id),o}),this.loading=!1,this.cd.markForCheck()},error:t=>{let o=t.error?.message||t.message||"Failed to add user to group";this.toastService.error(o),this.loading=!1,this.cd.markForCheck()}})}toggleUserSelection(e){this.selectedUserIds.update(t=>{let o=new Set(t);return o.has(e)?o.delete(e):o.add(e),o})}isUserSelected(e){return this.selectedUserIds().has(e)}toggleSelectAll(){let e=this.displayedUsers.value,t=this.selectedUserIds();if(this.allSelected())this.selectedUserIds.set(new Set);else{let o=new Set(t);e.forEach(r=>o.add(r.user_id)),this.selectedUserIds.set(o)}}addSelectedUsers(){let e=this.selectedUserIds();if(e.size===0){this.toastService.warning("Please select at least one user");return}let t=this.displayedUsers.value.filter(o=>e.has(o.user_id));this.loading=!0,qi(t.map(o=>this.groupService.addMemberToGroup(this.data.controller,this.data.group,o))).subscribe({next:()=>{this.toastService.success(`${t.length} user(s) added to group`),this.dialogRef.close(!0)},error:o=>{let r=o.error?.message||o.message||"Failed to add users to group";this.toastService.error(r),this.loading=!1,this.cd.markForCheck()}})}onClose(){this.dialogRef.close()}removeUserFromList(e){let t=this.users.value,o=this.displayedUsers.value;this.users.next(t.filter(r=>r.user_id!==e.user_id)),this.displayedUsers.next(o.filter(r=>r.user_id!==e.user_id))}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-add-user-to-group-dialog"]],inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:26,vars:12,consts:[[1,"dialog-header"],[1,"dialog-title"],[1,"dialog-content"],[1,"search-section"],["appearance","outline",1,"search-field"],["matInput","","type","text","placeholder","Type to filter users...",3,"input","keydown","value"],["matPrefix",""],[1,"users-list"],[1,"user-item"],[1,"dialog-actions"],[1,"selection-info"],[3,"change","checked","indeterminate"],[1,"action-buttons"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"user-checkbox",3,"change","checked"],[1,"user-info"],[1,"user-name"],[1,"user-email"],[1,"empty-state"]],template:function(t,o){if(t&1&&(s(0,"div",0)(1,"h2",1),d(2),l()(),s(3,"div",2)(4,"div",3)(5,"mat-form-field",4)(6,"mat-label"),d(7,"Search users"),l(),s(8,"input",5),g("input",function(a){return o.searchText.set(a.target.value)})("keydown",function(){return o.onSearch()}),l(),s(9,"mat-icon",6),d(10,"search"),l()()(),s(11,"div",7),Y(12,r3e,7,3,"div",8,o3e),en(14,"async"),A(15,s3e,1,1),en(16,"async"),l()(),s(17,"div",9)(18,"div",10)(19,"mat-checkbox",11),g("change",function(){return o.toggleSelectAll()}),d(20),l()(),s(21,"div",12)(22,"button",13),g("click",function(){return o.onClose()}),d(23,"Cancel"),l(),s(24,"button",14),g("click",function(){return o.addSelectedUsers()}),d(25),l()()()),t&2){let r;m(2),ee("Add User To Group: ",o.data.group.name),m(6),C("value",o.searchText()),m(4),Z(jn(14,8,o.displayedUsers)),m(3),O((r=jn(16,10,o.displayedUsers))?15:-1,r),m(4),C("checked",o.allSelected())("indeterminate",o.selectedCount()>0&&!o.allSelected()),m(),ee(" Select All (",o.selectedCount(),") "),m(4),C("disabled",o.selectedCount()===0||o.loading),m(),ee(" Add Selected (",o.selectedCount(),") ")}},dependencies:[ne,Xe,_e,we,Me,et,Gs,Se,Ee,ie,de,pn,W,pe,Ot,Gt,zr],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%}.dialog-header[_ngcontent-%COMP%]{padding:20px 24px 16px;border-bottom:1px solid var(--mat-sys-outline-variant)}.dialog-title[_ngcontent-%COMP%]{margin:0;font-size:20px;font-weight:500;color:var(--mat-sys-on-surface);line-height:1.4}.dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;overflow:hidden}.search-section[_ngcontent-%COMP%]{padding:16px 24px;border-bottom:1px solid var(--mat-sys-outline-variant)}.search-field[_ngcontent-%COMP%]{width:100%}.users-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:8px}.user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 16px;margin-bottom:4px;border-radius:12px;background:var(--mat-sys-surface-container-low);transition:all .2s ease}.user-item[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container)}.user-item[_ngcontent-%COMP%]:last-child{margin-bottom:0}.user-checkbox[_ngcontent-%COMP%]{flex-shrink:0}.user-info[_ngcontent-%COMP%]{flex:1;min-width:0}.user-name[_ngcontent-%COMP%]{font-size:15px;font-weight:500;color:var(--mat-sys-on-surface);margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-email[_ngcontent-%COMP%]{font-size:13px;color:var(--mat-sys-on-surface-variant);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;color:var(--mat-sys-on-surface-variant)}.empty-state[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;margin-bottom:12px;opacity:.5}.empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:14px}.dialog-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-top:1px solid var(--mat-sys-outline-variant);background:var(--mat-sys-surface-container-low)}.selection-info[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{margin:0}.action-buttons[_ngcontent-%COMP%]{display:flex;gap:8px}"],changeDetection:0})}return n})();var DM=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}onCancel(){this.dialogRef.close(!1)}onConfirm(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-remove-user-to-group-dialog"]],decls:13,vars:1,consts:[["mat-dialog-title",""],["mat-dialog-actions",""],["mat-button","",3,"click"],["mat-raised-button","","color","warn",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1,"Remove User"),l(),s(2,"mat-dialog-content")(3,"p"),d(4," Are you sure you want to remove "),s(5,"strong"),d(6),l(),d(7," from this group? "),l()(),s(8,"div",1)(9,"button",2),g("click",function(){return o.onCancel()}),d(10,"Cancel"),l(),s(11,"button",3),g("click",function(){return o.onConfirm()}),d(12,"Remove"),l()()),t&2&&(m(6),j(o.data.name))},dependencies:[_e,Ne,Fe,bt,W,pe],encapsulation:2,changeDetection:0})}return n})();var l3e=(n,i)=>i.user_id;function c3e(n,i){n&1&&(s(0,"p",24),d(1,"No members in this group"),l())}function d3e(n,i){if(n&1){let e=z();s(0,"li")(1,"span",27),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openUserDetailDialog(o))}),d(2),l(),s(3,"button",28),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openRemoveUserDialog(o))}),s(4,"mat-icon"),d(5,"delete"),l()()()}if(n&2){let e=i.$implicit;m(2),j(e.username)}}function m3e(n,i){if(n&1&&(s(0,"ul"),Y(1,d3e,6,1,"li",null,l3e),l()),n&2){let e=v();m(),Z(e.filteredMembers())}}function p3e(n,i){n&1&&(s(0,"p",24),d(1,"No ACEs configured for this group"),l())}function u3e(n,i){n&1&&(s(0,"th",37),d(1,"Endpoint"),l())}function h3e(n,i){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=i.$implicit;m(),j(e.endpoint_name)}}function f3e(n,i){n&1&&(s(0,"th",37),d(1,"Role"),l())}function g3e(n,i){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=i.$implicit;m(),j(e.role_name)}}function _3e(n,i){n&1&&(s(0,"th",37),d(1,"Propagate"),l())}function v3e(n,i){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=i.$implicit;m(),j(e.propagate)}}function C3e(n,i){n&1&&(s(0,"th",37),d(1,"Allowed"),l())}function b3e(n,i){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=i.$implicit;m(),j(e.allowed)}}function x3e(n,i){n&1&&R(0,"tr",39)}function y3e(n,i){n&1&&R(0,"tr",40)}function S3e(n,i){if(n&1&&(s(0,"table",25),Le(1,29),xe(2,u3e,2,0,"th",30)(3,h3e,2,1,"td",31),Ve(),Le(4,32),xe(5,f3e,2,0,"th",30)(6,g3e,2,1,"td",31),Ve(),Le(7,33),xe(8,_3e,2,0,"th",30)(9,v3e,2,1,"td",31),Ve(),Le(10,34),xe(11,C3e,2,0,"th",30)(12,b3e,2,1,"td",31),Ve(),xe(13,x3e,1,0,"tr",35)(14,y3e,1,0,"tr",36),l()),n&2){let e=v();C("dataSource",e.aceDatasource),m(13),C("matHeaderRowDef",e.aceDisplayedColumns),m(),C("matRowDefColumns",e.aceDisplayedColumns)}}var bj=(()=>{class n{data;dialogRef=f(Ie);dialog=f(nt);groupService=f(kl);aclService=f(fp);roleService=f(Tl);toastService=f(te);cd=f(Q);group;controller;editGroupForm;members=ae([]);aces=[];aceDatasource=new pr;aceDisplayedColumns=["endpoint","role","propagate","allowed"];searchMembers=U("");filteredMembers=Jt(()=>{let e=this.searchMembers().toLowerCase(),t=this.members();return e?t.filter(o=>o.username.toLowerCase().includes(e)):t});constructor(e){this.data=e,this.group=e.group,this.controller=e.controller}ngOnInit(){this.editGroupForm=new gr({groupname:new Ye(this.group.name,[Ue.required])}),this.loadMembers(),this.loadAces()}loadMembers(){this.groupService.getGroupMember(this.controller,this.group.user_group_id).subscribe({next:e=>{this.members.set(e.sort((t,o)=>t.username.toLowerCase().localeCompare(o.username.toLowerCase()))),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load members";this.toastService.error(t),this.cd.markForCheck()}})}loadAces(){this.roleService.get(this.controller).subscribe({next:e=>{this.aclService.getEndpoints(this.controller).subscribe({next:t=>{this.aclService.list(this.controller).subscribe({next:o=>{let r=o.filter(a=>a.ace_type==="group"&&a.group_id===this.group.user_group_id);this.aces=r.map(a=>{let c=t.filter(u=>u.endpoint===a.path)[0],p=e.filter(u=>u.role_id===a.role_id)[0];return it(K({},a),{endpoint_name:c?.name||a.path,role_name:p?.name||"Unknown"})}),this.aceDatasource.data=this.aces,this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to load ACEs";this.toastService.error(r),this.cd.markForCheck()}})},error:t=>{let o=t.error?.message||t.message||"Failed to load endpoints";this.toastService.error(o),this.cd.markForCheck()}})},error:e=>{let t=e.error?.message||e.message||"Failed to load roles";this.toastService.error(t),this.cd.markForCheck()}})}onUpdate(){if(!this.editGroupForm.valid)return;let e=it(K({},this.group),{name:this.editGroupForm.get("groupname").value});this.groupService.update(this.controller,e).subscribe({next:()=>{this.group.name=e.name,this.toastService.success("Group updated successfully")},error:t=>{let o=t.error?.message||t.message||"Failed to update group";this.toastService.error(o),this.cd.markForCheck()}})}onClose(){this.dialogRef.close()}openAddUserDialog(){this.dialog.open(EM,{panelClass:["base-dialog-panel","simple-dialog-panel","add-user-to-group-dialog-panel"],data:{controller:this.controller,group:this.group}}).afterClosed().subscribe(e=>{e&&this.loadMembers()})}openRemoveUserDialog(e){this.dialog.open(DM,{panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],data:{name:e.username}}).afterClosed().subscribe(t=>{t&&this.groupService.removeUser(this.controller,this.group,e).subscribe({next:()=>{this.toastService.success(`User ${e.username} was removed`),this.loadMembers()},error:o=>{let r=o.error?.message||o.message||"Failed to remove user";this.toastService.error(r),this.cd.markForCheck()}})})}openUserDetailDialog(e){this.dialog.open(_M,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:{user:e,controller:this.controller}})}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-group-detail-dialog"]],inputs:{searchMembers:[1,"searchMembers"]},outputs:{searchMembers:"searchMembersChange"},decls:68,vars:10,consts:[["mat-dialog-title",""],[1,"group-detail-dialog__content"],[1,"group-detail-dialog__section"],[1,"group-detail-dialog__section-title"],[1,"group-detail-dialog__card"],[1,"group-detail-dialog__form",3,"formGroup"],["appearance","fill",1,"group-detail-dialog__field"],["matInput","","type","text","formControlName","groupname"],[1,"group-detail-dialog__checkbox"],["disabled","",3,"checked"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"group-detail-dialog__card","group-detail-dialog__card--muted"],[1,"group-detail-dialog__info-grid"],[1,"group-detail-dialog__info-item"],[1,"group-detail-dialog__info-label"],[1,"group-detail-dialog__info-value"],[1,"group-detail-dialog__info-item","group-detail-dialog__info-item--full"],[1,"group-detail-dialog__info-value","group-detail-dialog__info-value--mono"],[1,"group-detail-dialog__section-header"],["mat-icon-button","","matTooltip","Add user",3,"click"],[1,"group-detail-dialog__search"],["appearance","fill",1,"group-detail-dialog__search-field"],["matInput","",3,"input","value"],[1,"group-detail-dialog__members-list"],[1,"group-detail-dialog__empty-message"],["mat-table","",1,"group-detail-dialog__ace-table",3,"dataSource"],["mat-button","",3,"click"],[1,"group-detail-dialog__member-name",3,"click"],["mat-icon-button","","matTooltip","Remove user",3,"click"],["matColumnDef","endpoint"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","role"],["matColumnDef","propagate"],["matColumnDef","allowed"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"section",2)(5,"h3",3),d(6,"Details"),l(),s(7,"mat-card",4)(8,"mat-card-content")(9,"form",5)(10,"mat-form-field",6)(11,"mat-label"),d(12,"Group name"),l(),R(13,"input",7),l(),s(14,"div",8)(15,"mat-checkbox",9),d(16,"Is built-in"),l()()()(),s(17,"mat-card-actions")(18,"button",10),g("click",function(){return o.onUpdate()}),d(19," Update Group "),l()()(),s(20,"mat-card",11)(21,"mat-card-header")(22,"mat-card-title"),d(23,"Group Information"),l()(),s(24,"mat-card-content")(25,"div",12)(26,"div",13)(27,"span",14),d(28,"Creation date"),l(),s(29,"span",15),d(30),l()(),s(31,"div",13)(32,"span",14),d(33,"Last update"),l(),s(34,"span",15),d(35),l()(),s(36,"div",16)(37,"span",14),d(38,"UUID"),l(),s(39,"span",17),d(40),l()()()()()(),s(41,"section",2)(42,"div",18)(43,"h3",3),d(44,"Members"),l(),s(45,"button",19),g("click",function(){return o.openAddUserDialog()}),s(46,"mat-icon"),d(47,"person_add"),l()()(),s(48,"mat-card",4)(49,"mat-card-content")(50,"div",20)(51,"mat-form-field",21)(52,"mat-label"),d(53,"Filter members"),l(),s(54,"input",22),g("input",function(a){return o.searchMembers.set(a.target.value)}),l()()(),s(55,"div",23),A(56,c3e,2,0,"p",24)(57,m3e,3,0,"ul"),l()()()(),s(58,"section",2)(59,"h3",3),d(60,"ACEs"),l(),s(61,"mat-card",4)(62,"mat-card-content"),A(63,p3e,2,0,"p",24)(64,S3e,15,3,"table",25),l()()()()(),s(65,"mat-dialog-actions")(66,"button",26),g("click",function(){return o.onClose()}),d(67,"Close"),l()()),t&2&&(m(),ee("Group ",o.group.name),m(8),C("formGroup",o.editGroupForm),m(6),C("checked",o.group.is_builtin),m(3),C("disabled",!o.editGroupForm.valid||o.group.is_builtin),m(12),j(o.group.created_at),m(5),j(o.group.updated_at),m(5),j(o.group.user_group_id),m(14),C("value",o.searchMembers()),m(2),O(o.members().length===0?56:57),m(7),O(o.aces.length===0?63:64))},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Rt,zt,_e,Ne,Fe,bt,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W,pe,je,ie,de,we,Me,et,Se,Ee,Ot,Gt,Mt,On,$b,ll,Nc,Oc,vt,wt,It],styles:[".group-detail-dialog__content[_ngcontent-%COMP%]{padding:0}.group-detail-dialog__section[_ngcontent-%COMP%]{margin-bottom:24px}.group-detail-dialog__section[_ngcontent-%COMP%]:last-child{margin-bottom:0}.group-detail-dialog__section-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.group-detail-dialog__section-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:var(--mat-sys-on-surface);margin:0 0 12px;padding-bottom:8px;border-bottom:2px solid var(--mat-sys-primary);display:inline-block}.group-detail-dialog__section-header[_ngcontent-%COMP%] .group-detail-dialog__section-title[_ngcontent-%COMP%]{margin-bottom:0;padding-bottom:0;border-bottom:none}.group-detail-dialog__card[_ngcontent-%COMP%]{margin-bottom:16px;border-radius:12px}.group-detail-dialog__card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{padding-top:16px}.group-detail-dialog__card[_ngcontent-%COMP%] mat-card-actions[_ngcontent-%COMP%]{padding:16px;border-top:1px solid var(--mat-sys-outline-variant)}.group-detail-dialog__card--muted[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-low)}.group-detail-dialog__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.group-detail-dialog__field[_ngcontent-%COMP%]{width:100%;max-width:400px}.group-detail-dialog__checkbox[_ngcontent-%COMP%]{display:flex;align-items:center}.group-detail-dialog__info-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}@media(max-width:600px){.group-detail-dialog__info-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.group-detail-dialog__info-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.group-detail-dialog__info-item--full[_ngcontent-%COMP%]{grid-column:1/-1}.group-detail-dialog__info-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px}.group-detail-dialog__info-value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.group-detail-dialog__info-value--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:12px}.group-detail-dialog__search[_ngcontent-%COMP%]{margin-bottom:16px}.group-detail-dialog__search-field[_ngcontent-%COMP%]{width:100%}.group-detail-dialog__members-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-low);border-radius:8px;padding:8px 0}.group-detail-dialog__members-list[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0}.group-detail-dialog__members-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid var(--mat-sys-outline-variant)}.group-detail-dialog__members-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-bottom:none}.group-detail-dialog__member-name[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-primary);cursor:pointer}.group-detail-dialog__member-name[_ngcontent-%COMP%]:hover{text-decoration:underline}.group-detail-dialog__empty-message[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);font-style:italic;text-align:center;padding:24px}.group-detail-dialog__ace-table[_ngcontent-%COMP%]{width:100%;background:var(--mat-sys-surface-container-low);border-radius:8px;overflow:hidden}.group-detail-dialog__ace-table[_ngcontent-%COMP%] .mat-header-row[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container)}.group-detail-dialog__ace-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);text-transform:uppercase}.group-detail-dialog__ace-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.group-detail-dialog__ace-table[_ngcontent-%COMP%] mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent)}"],changeDetection:0})}return n})();function w3e(n,i){n&1&&(s(0,"div",8),R(1,"mat-spinner",10),s(2,"p"),d(3,"Loading..."),l()())}function M3e(n,i){n&1&&(s(0,"th",24),d(1,"Name"),l())}function k3e(n,i){if(n&1&&(s(0,"td",25)(1,"span",26),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.name)}}function T3e(n,i){n&1&&(s(0,"th",24),d(1,"API Domain"),l())}function E3e(n,i){if(n&1&&(s(0,"td",25)(1,"span",27),d(2),l()()),n&2){let e=i.$implicit,t=v(3);m(2),j(t.getProviderDisplay(e))}}function D3e(n,i){n&1&&(s(0,"th",24),d(1,"Model"),l())}function P3e(n,i){if(n&1&&(s(0,"td",25)(1,"span",28),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.config.model)}}function I3e(n,i){n&1&&(s(0,"th",24),d(1,"Context Limit"),l())}function A3e(n,i){if(n&1&&(s(0,"span",30),d(1),l()),n&2){let e=v().$implicit;m(),ee(" ",e.config.context_strategy," ")}}function O3e(n,i){if(n&1&&(s(0,"td",25)(1,"span",29),d(2),l(),A(3,A3e,2,1,"span",30),l()),n&2){let e=i.$implicit;m(2),ee("",e.config.context_limit,"K"),m(),O(e.config.context_strategy?3:-1)}}function N3e(n,i){n&1&&(s(0,"th",24),d(1,"Actions"),l())}function F3e(n,i){if(n&1){let e=z();s(0,"td",25)(1,"div",31)(2,"button",32),en(3,"async"),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.toggleDefaultConfig(o))}),s(4,"mat-icon"),d(5,"check_circle"),l()(),s(6,"button",33),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.openEditDialog(o))}),s(7,"mat-icon"),d(8,"edit"),l()(),s(9,"button",34),g("click",function(){let o=k(e).$implicit,r=v(3);return T(r.deleteConfig(o))}),s(10,"mat-icon"),d(11,"delete"),l()()()()}if(n&2){let e,t=i.$implicit,o=v(3);m(2),Be("active-btn",o.isDefault(t)),C("disabled",(e=jn(3,4,o.settingDefault$))==null?null:e.has(t.config_id))("matTooltip",o.isDefault(t)?"Remove as default":"Set as default")}}function R3e(n,i){n&1&&R(0,"tr",35)}function L3e(n,i){if(n&1&&R(0,"tr",36),n&2){let e=i.$implicit,t=v(3);Be("active-row",t.isDefault(e))}}function V3e(n,i){if(n&1&&(s(0,"div",12)(1,"table",14),Le(2,15),xe(3,M3e,2,0,"th",16)(4,k3e,3,1,"td",17),Ve(),Le(5,18),xe(6,T3e,2,0,"th",16)(7,E3e,3,1,"td",17),Ve(),Le(8,19),xe(9,D3e,2,0,"th",16)(10,P3e,3,1,"td",17),Ve(),Le(11,20),xe(12,I3e,2,0,"th",16)(13,O3e,4,2,"td",17),Ve(),Le(14,21),xe(15,N3e,2,0,"th",16)(16,F3e,12,6,"td",17),Ve(),xe(17,R3e,1,0,"tr",22)(18,L3e,1,2,"tr",23),l()()),n&2){let e=v(2);m(),C("dataSource",e.configs),m(16),C("matHeaderRowDef",e.displayedColumns()),m(),C("matRowDefColumns",e.displayedColumns())}}function B3e(n,i){n&1&&(s(0,"div",13)(1,"mat-icon",37),d(2,"folder_open"),l(),s(3,"p"),d(4,"No configurations yet"),l(),s(5,"p",38),d(6,'Click "New Configuration" above to create your first LLM model configuration'),l()())}function z3e(n,i){if(n&1&&(s(0,"div",9)(1,"mat-card",11)(2,"mat-card-header")(3,"mat-card-title"),d(4,"All Configurations"),l()(),s(5,"mat-card-content"),A(6,V3e,19,3,"div",12),A(7,B3e,7,0,"div",13),l()()()),n&2){let e=v();m(6),O(e.configs.length>0?6:-1),m(),O(e.configs.length===0?7:-1)}}var PM=(()=>{class n{destroy$=new He;controller=le(void 0);group=le(void 0);loading$=new an(!1);settingDefault$=new an(new Set);error$=new an(null);configs$=new an([]);defaultConfig$=new an(null);configs=[];defaultConfig=null;settingDefaultConfigs=new Set;displayedColumns=ae(["name","provider","model","context_limit","actions"]);aiProfilesService=f(ug);dialog=f(nt);snackBar=f(vr);constructor(){}ngOnInit(){this.loadConfigs(),Pr([this.configs$,this.defaultConfig$]).pipe(tt(this.destroy$)).subscribe(([e,t])=>{this.configs=e,this.defaultConfig=t}),this.error$.pipe(tt(this.destroy$),ai(e=>e!==null)).subscribe(e=>{this.showError(e)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadConfigs(){this.loading$.next(!0),this.error$.next(null),this.aiProfilesService.getGroupConfigs(this.controller(),this.group().user_group_id).pipe(tt(this.destroy$)).subscribe({next:e=>{this.configs$.next(e.configs),this.defaultConfig$.next(e.default_config),this.loading$.next(!1)},error:e=>{this.handleError(e,"Failed to load configurations")}})}isDefault(e){return this.defaultConfig?.config_id===e.config_id}getProviderDisplay(e){let t=e.config.base_url;if(!t)return e.config.provider;try{return new URL(t).hostname.replace(/^api\./,"")}catch{return e.config.provider}}openCreateDialog(){this.dialog.open(hp,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"],data:{mode:"create",config:null,existingNames:this.configs.map(t=>t.name)}}).afterClosed().pipe(tt(this.destroy$)).subscribe(t=>{t&&this.createConfig(t)})}openEditDialog(e){this.dialog.open(hp,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"],data:{mode:"edit",config:K({},e),existingNames:this.configs.filter(o=>o.config_id!==e.config_id).map(o=>o.name)}}).afterClosed().pipe(tt(this.destroy$)).subscribe(o=>{o&&this.updateConfig(e.config_id,o)})}createConfig(e){this.loading$.next(!0),this.aiProfilesService.createGroupConfig(this.controller(),this.group().user_group_id,e).pipe(tt(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration created successfully")},error:t=>{this.handleError(t,"Failed to create configuration")}})}updateConfig(e,t){this.loading$.next(!0),this.aiProfilesService.updateGroupConfig(this.controller(),this.group().user_group_id,e,t).pipe(tt(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration updated successfully")},error:o=>{o.status===409?this.handleConflict(o):this.handleError(o,"Failed to update configuration")}})}deleteConfig(e){this.dialog.open(wg,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{title:"Delete Configuration",message:`Are you sure you want to delete configuration "${e.name}"? This action cannot be undone.`,confirmText:"Delete",cancelText:"Cancel"}}).afterClosed().pipe(tt(this.destroy$)).subscribe(o=>{o&&(this.loading$.next(!0),this.aiProfilesService.deleteGroupConfig(this.controller(),this.group().user_group_id,e.config_id).pipe(tt(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration deleted successfully")},error:r=>{this.handleError(r,"Failed to delete configuration")}}))})}toggleDefaultConfig(e){let t=e.config_id;if(this.settingDefaultConfigs.has(t))return;let o=e.is_default,r=this.defaultConfig,a=[...this.configs],c=a.map(p=>it(K({},p),{is_default:o?!1:p.config_id===t}));this.configs=c,this.configs$.next(c),this.defaultConfig=o?null:e,this.defaultConfig$.next(o?null:e),this.settingDefaultConfigs.add(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),o?this.aiProfilesService.unsetDefaultGroupConfig(this.controller(),this.group().user_group_id,t).pipe(tt(this.destroy$)).subscribe({next:()=>{this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),this.showSuccess("Default configuration removed"),this.loadConfigsWithoutLoading()},error:p=>{this.configs=a,this.configs$.next(a),this.defaultConfig=r,this.defaultConfig$.next(r),this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),p.status===409?this.handleConflict(p):this.handleError(p,"Failed to remove default configuration")}}):this.aiProfilesService.setDefaultGroupConfig(this.controller(),this.group().user_group_id,t).pipe(tt(this.destroy$)).subscribe({next:()=>{this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),this.showSuccess("Default configuration set successfully"),this.loadConfigsWithoutLoading()},error:p=>{this.configs=a,this.configs$.next(a),this.defaultConfig=r,this.defaultConfig$.next(r),this.settingDefaultConfigs.delete(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),p.status===409?this.handleConflict(p):this.handleError(p,"Failed to set default configuration")}})}loadConfigsWithoutLoading(){this.error$.next(null),this.aiProfilesService.getGroupConfigs(this.controller(),this.group().user_group_id).pipe(tt(this.destroy$)).subscribe({next:e=>{this.configs$.next(e.configs),this.defaultConfig$.next(e.default_config)},error:e=>{this.handleError(e,"Failed to refresh configurations")}})}handleConflict(e){this.loadConfigs(),this.showWarning("Data has been modified by another user, auto-refreshed")}handleError(e,t){console.error(`${t}:`,e);let o=e.error?.message||e.message||t;this.error$.next(o),this.loading$.next(!1),this.showError(o)}showSuccess(e){this.snackBar.open(e,"Close",{duration:3e3,panelClass:["success-snackbar"]})}showWarning(e){this.snackBar.open(e,"Close",{duration:5e3,panelClass:["warning-snackbar"]})}showError(e){this.snackBar.open(e,"Close",{duration:5e3,panelClass:["error-snackbar"]})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-group-ai-profile-tab"]],inputs:{controller:[1,"controller"],group:[1,"group"]},decls:23,vars:9,consts:[[1,"ai-profile-container"],[1,"toolbar"],[1,"toolbar-info"],[1,"compatibility-badge"],[1,"subtitle"],[1,"toolbar-actions"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click"],[1,"loading-container"],[1,"content-area"],["diameter","40"],[1,"list-card"],[1,"table-container"],[1,"empty-state"],["mat-table","",1,"profiles-table",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","provider"],["matColumnDef","model"],["matColumnDef","context_limit"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"active-row",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],[1,"profile-name"],[1,"provider-badge"],[1,"model-name"],[1,"context-limit-value"],[1,"context-strategy-badge"],[1,"action-buttons"],["mat-icon-button","","matTooltipClass","custom-tooltip",3,"click","disabled","matTooltip"],["mat-icon-button","",3,"click"],["mat-icon-button","","color","warn",1,"delete-btn",3,"click"],["mat-header-row",""],["mat-row",""],[1,"empty-icon"],[1,"empty-hint"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3"),d(4,"Group LLM Model Configurations "),s(5,"span",3),d(6,"OpenAI-Compatible"),l()(),s(7,"p",4),d(8,"Manage group OpenAI-compatible LLM model configurations. These configs will be inherited by group members."),l()(),s(9,"div",5)(10,"button",6),en(11,"async"),g("click",function(){return o.loadConfigs()}),s(12,"mat-icon"),d(13,"refresh"),l(),d(14," Refresh "),l(),s(15,"button",7),g("click",function(){return o.openCreateDialog()}),s(16,"mat-icon"),d(17,"add"),l(),d(18," New Configuration "),l()()(),A(19,w3e,4,0,"div",8),en(20,"async"),A(21,z3e,8,2,"div",9),en(22,"async"),l()),t&2&&(m(10),C("disabled",jn(11,3,o.loading$)),m(9),O(jn(20,5,o.loading$)?19:-1),m(2),O(jn(22,7,o.loading$)?-1:21))},dependencies:[ne,_e,Ya,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,W,pe,je,ie,de,we,Se,vt,Ot,Mt,On,ll,Nc,Oc,pn,li,zr],styles:['.ai-profile-container[_ngcontent-%COMP%]{padding:20px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;font-size:18px;font-weight:500;display:flex;align-items:center;gap:12px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-info[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{margin:0;font-size:13px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-info[_ngcontent-%COMP%] .compatibility-badge[_ngcontent-%COMP%]{display:inline-block;padding:2px 10px;font-size:11px;font-weight:600;letter-spacing:.3px;background:var(--mat-sys-primary-container);color:var(--mat-sys-primary);border-radius:12px;line-height:20px;text-transform:uppercase}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-actions[_ngcontent-%COMP%]{display:flex;gap:8px}.ai-profile-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.ai-profile-container[_ngcontent-%COMP%] .loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px}.ai-profile-container[_ngcontent-%COMP%] .loading-container[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{margin-bottom:16px}.ai-profile-container[_ngcontent-%COMP%] .loading-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-header[_ngcontent-%COMP%] mat-card-title[_ngcontent-%COMP%]{font-size:16px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{padding:0}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow-x:auto}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%]{width:100%}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-header-row[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:500}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-outline-variant)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-primary) 8%,transparent)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.active-row[_ngcontent-%COMP%]{background-color:var(--mat-sys-tertiary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.active-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-tertiary)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] mat-row.active-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-tertiary) 12%,var(--mat-sys-tertiary-container))}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .name-cell[_ngcontent-%COMP%] .profile-name[_ngcontent-%COMP%]{font-weight:500}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .provider-badge[_ngcontent-%COMP%]{padding:4px 8px;background:var(--mat-sys-primary-container);border-radius:4px;font-size:12px;color:var(--mat-sys-on-primary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .model-name[_ngcontent-%COMP%]{font-family:monospace;font-size:13px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .temperature-value[_ngcontent-%COMP%]{font-family:monospace;font-size:13px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex;gap:4px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:32px;height:32px;padding:6px;transition:all .2s cubic-bezier(.4,0,.2,1);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;position:relative}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:before{content:"";position:absolute;width:100%;height:100%;border-radius:50%;background-color:currentColor;opacity:0;transition:opacity .2s cubic-bezier(.4,0,.2,1);transform:scale(.75)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;transition:transform .2s cubic-bezier(.4,0,.2,1);position:relative;z-index:1}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.active-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-tertiary)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.active-btn[_ngcontent-%COMP%]:hover:before{opacity:1;background-color:var(--mat-sys-tertiary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.active-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.35)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(.active-btn):not(.delete-btn):hover:before{opacity:1;background-color:var(--mat-sys-primary-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(.active-btn):not(.delete-btn):hover mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);transform:scale(1.35)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.delete-btn[_ngcontent-%COMP%]:hover:before{opacity:1;background-color:var(--mat-sys-error-container)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] table.profiles-table[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] button.delete-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{transform:scale(1.35)}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] .empty-icon[_ngcontent-%COMP%]{font-size:64px;margin-bottom:16px;opacity:.3}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0}.ai-profile-container[_ngcontent-%COMP%] .content-area[_ngcontent-%COMP%] mat-card.list-card[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] p.empty-hint[_ngcontent-%COMP%]{font-size:13px}'],changeDetection:0})}return n})();var xj=(()=>{class n{dialogRef=f(Ie);data=f(gt);close(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-group-ai-profile-dialog"]],decls:7,vars:3,consts:[["mat-dialog-title",""],[3,"controller","group"],["mat-button","",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content"),R(3,"app-group-ai-profile-tab",1),l(),s(4,"mat-dialog-actions")(5,"button",2),g("click",function(){return o.close()}),d(6,"Close"),l()()),t&2&&(m(),ee("AI Profiles - ",o.data.group.name),m(2),C("controller",o.data.controller)("group",o.data.group))},dependencies:[ne,_e,Ne,Fe,bt,W,pe,ie,PM],styles:[".group-ai-profile-dialog__content[_ngcontent-%COMP%]{padding:16px 0}"],changeDetection:0})}return n})();var j3e=["groupsPaginator"],$3e=["groupsSort"],H3e=()=>[5,10,20];function U3e(n,i){if(n&1){let e=z();s(0,"th",28)(1,"mat-checkbox",29),g("change",function(o){k(e);let r=v(2);return T(o?r.masterToggle():null)}),l()()}if(n&2){let e=v(2);m(),C("checked",e.selection.hasValue()&&e.isAllSelected())("indeterminate",e.selection.hasValue()&&!e.isAllSelected())}}function G3e(n,i){if(n&1){let e=z();s(0,"td",30)(1,"mat-checkbox",31),g("click",function(o){return o.stopPropagation()})("change",function(o){let r=k(e).$implicit,a=v(2);return T(o?a.selection.toggle(r):null)}),l()()}if(n&2){let e=i.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function W3e(n,i){n&1&&(s(0,"th",32),d(1,"Name"),l())}function q3e(n,i){if(n&1){let e=z();s(0,"td",33)(1,"span",34),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openGroupDetailDialog(o))}),d(2),l()()}if(n&2){let e=i.$implicit;m(2),ee(" ",e.name," ")}}function Q3e(n,i){n&1&&(s(0,"th",32),d(1,"Creation date"),l())}function X3e(n,i){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=i.$implicit;m(),j(e.created_at)}}function K3e(n,i){n&1&&(s(0,"th",32),d(1,"Last update"),l())}function Y3e(n,i){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=i.$implicit;m(),j(e.updated_at)}}function Z3e(n,i){n&1&&(s(0,"th",32),d(1,"Built-in"),l())}function J3e(n,i){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=i.$implicit;m(),j(e.is_builtin)}}function eAe(n,i){n&1&&(s(0,"th",35),d(1,"Actions"),l())}function tAe(n,i){if(n&1){let e=z();s(0,"td",36)(1,"button",37),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openGroupDetailDialog(o))}),s(2,"mat-icon"),d(3,"edit"),l()(),s(4,"button",38),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.openGroupAiProfileDialog(o))}),s(5,"mat-icon"),d(6,"psychology"),l()()()}}function nAe(n,i){n&1&&R(0,"tr",39)}function iAe(n,i){n&1&&R(0,"tr",40)}function oAe(n,i){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Groups"),l(),s(3,"div",5)(4,"button",6),g("click",function(){k(e);let o=v();return T(o.onDelete(o.selection.selected))}),d(5," Delete Selected "),l(),s(6,"button",7),g("click",function(){k(e);let o=v();return T(o.addGroup())}),d(7,"Add Group"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),g("input",function(o){k(e);let r=v();return T(r.searchText.set(o.target.value))}),l()()(),s(11,"div",11)(12,"table",12,0),en(14,"groupFilter"),Le(15,13),xe(16,U3e,2,2,"th",14)(17,G3e,2,1,"td",15),Ve(),Le(18,16),xe(19,W3e,2,0,"th",17)(20,q3e,3,1,"td",18),Ve(),Le(21,19),xe(22,Q3e,2,0,"th",17)(23,X3e,2,1,"td",18),Ve(),Le(24,20),xe(25,K3e,2,0,"th",17)(26,Y3e,2,1,"td",18),Ve(),Le(27,21),xe(28,Z3e,2,0,"th",17)(29,J3e,2,1,"td",18),Ve(),Le(30,22),xe(31,eAe,2,0,"th",23)(32,tAe,7,0,"td",24),Ve(),xe(33,nAe,1,0,"tr",25)(34,iAe,1,0,"tr",26),l(),R(35,"mat-paginator",27,1),l()}if(n&2){let e=v();m(4),C("disabled",e.selection.selected.length===0),m(6),C("value",e.searchText()),m(2),C("dataSource",na(14,6,e.dataSource,e.searchText())),m(21),C("matHeaderRowDef",e.displayedColumns()),m(),C("matRowDefColumns",e.displayedColumns()),m(),C("pageSizeOptions",Bt(9,H3e))}}function rAe(n,i){n&1&&(s(0,"div",2),R(1,"mat-spinner",41),l())}var IM=(()=>{class n{route=f(lt);controllerService=f(Je);toasterService=f(te);cd=f(Q);groupService=f(kl);dialog=f(nt);controller;groupsPaginator;groupsSort;displayedColumns=ae(["select","name","created_at","updated_at","is_builtin","actions"]);selection=new Oa(!0,[]);groups;dataSource=new pr;searchText=U("");isReady=ae(!1);constructor(){}ngOnInit(){let e=this.route.parent.snapshot.paramMap.get("controller_id");this.controllerService.get(+e).then(t=>{this.controller=t,this.refresh()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}ngAfterViewInit(){this.groupsPaginator.changes.subscribe(e=>{this.dataSource.paginator=e.first}),this.groupsSort.changes.subscribe(e=>{this.dataSource.sort=e.first}),this.dataSource.sortingDataAccessor=(e,t)=>t==="name"?e[t]?e[t].toLowerCase():"":e[t]}isAllSelected(){let e=this.selection.selected.length,t=this.groups.length;return e===t}masterToggle(){this.isAllSelected()?this.selection.clear():this.groups.forEach(e=>this.selection.select(e))}addGroup(){this.dialog.open(kM,{width:"400px",autoFocus:!1,disableClose:!0,data:{controller:this.controller}}).afterClosed().subscribe(e=>{e&&this.refresh()})}refresh(){this.groupService.getGroups(this.controller).subscribe({next:e=>{this.isReady.set(!0),this.groups=e,this.dataSource.data=e,this.selection.clear()},error:e=>{let t=e.error?.message||e.message||"Failed to load groups";this.toasterService.error(t),this.cd.markForCheck()}})}onDelete(e){this.dialog.open(TM,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{groups:e}}).afterClosed().subscribe(t=>{if(t){let o=e.map(r=>this.groupService.delete(this.controller,r.user_group_id));qi(o).subscribe({next:()=>{this.refresh()},error:r=>{let a=r.error?.message||r.message||"Failed to delete groups";this.toasterService.error(a),this.cd.markForCheck()}})}})}openGroupDetailDialog(e){this.dialog.open(bj,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:{group:e,controller:this.controller},maxWidth:"90vw"})}openGroupAiProfileDialog(e){this.dialog.open(xj,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:{group:e,controller:this.controller}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-group-management"]],viewQuery:function(t,o){if(t&1&&xn(j3e,5)($3e,5),t&2){let r;mt(r=pt())&&(o.groupsPaginator=r),mt(r=pt())&&(o.groupsSort=r)}},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:2,vars:1,consts:[["groupsSort","matSort"],["groupsPaginator","matPaginator"],[1,"group-management__loader"],[1,"group-management__header"],[1,"group-management__title"],[1,"group-management__actions"],["mat-raised-button","","color","primary",1,"group-management__button",3,"click","disabled"],["mat-raised-button","","color","primary",1,"group-management__button",3,"click"],[1,"group-management__search-form"],[1,"group-management__search"],["matInput","","placeholder","Search group by name",3,"input","value"],[1,"group-management__table-container"],["mat-table","","matSort","",3,"dataSource"],["matColumnDef","select"],["mat-header-cell","","class","group-management__small-col",4,"matHeaderCellDef"],["mat-cell","","class","group-management__small-col",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","created_at"],["matColumnDef","updated_at"],["matColumnDef","is_builtin"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","class","group-management__actions-cell",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","","aria-label","Select page",3,"pageSizeOptions"],["mat-header-cell","",1,"group-management__small-col"],[3,"change","checked","indeterminate"],["mat-cell","",1,"group-management__small-col"],[3,"click","change","checked"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"group-management__link",3,"click"],["mat-header-cell",""],["mat-cell","",1,"group-management__actions-cell"],["mat-icon-button","","matTooltip","Edit group",3,"click"],["mat-icon-button","","matTooltip","AI Profiles",3,"click"],["mat-header-row",""],["mat-row",""],[1,"group-management__spinner"]],template:function(t,o){t&1&&A(0,oAe,37,10)(1,rAe,2,0,"div",2),t&2&&O(o.isReady()?0:1)},dependencies:[ne,Xe,at,rt,Gn,dt,ar,mo,Tr,_e,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,hr,Ot,Gt,W,pe,je,ie,de,we,Me,Se,Ee,Mt,Cj],styles:['[_nghost-%COMP%]{display:block;width:100%}.group-management__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 0;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.group-management__title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.group-management__actions[_ngcontent-%COMP%]{display:flex;gap:12px}.group-management__button[_ngcontent-%COMP%]{margin:12px 0;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1)}.group-management__button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.group-management__button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.group-management__search-form[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:16px auto;width:100%;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.group-management__search[_ngcontent-%COMP%]{width:100%;max-width:1000px}.group-management__table-container[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;width:100%;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both}.group-management__table-container--hidden[_ngcontent-%COMP%]{display:none}mat-row[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);cursor:default;position:relative}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent);transform:scale(1.002)}mat-row[_ngcontent-%COMP%]:nth-child(2n){background-color:color-mix(in srgb,var(--mat-sys-on-surface) 1%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n):hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent)}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.mat-header-row[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px;text-transform:uppercase}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}mat-cell[mat-column=name][_ngcontent-%COMP%]{justify-content:flex-start;font-weight:500}.group-management__link[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);display:inline-block;transform-origin:left center;color:var(--mat-sys-primary);text-decoration:none;font-weight:500;position:relative;cursor:pointer}.group-management__link[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-2px;left:0;width:0;height:2px;background-color:currentColor;transition:width .2s cubic-bezier(.4,0,.2,1)}.group-management__link[_ngcontent-%COMP%]:hover{color:color-mix(in srgb,var(--mat-sys-primary) 80%,black);transform:translateY(-2px)}.group-management__link[_ngcontent-%COMP%]:hover:after{width:100%}.group-management__overflow-text[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding-right:5px}mat-cell[mat-column=actions][_ngcontent-%COMP%], mat-header-cell[mat-column=actions][_ngcontent-%COMP%]{justify-content:flex-end;padding:0 16px}mat-cell[mat-column=actions][_ngcontent-%COMP%]{overflow:visible}.group-management__small-col[_ngcontent-%COMP%]{width:60px;min-width:60px}.group-management__loader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:200px}.group-management__spinner[_ngcontent-%COMP%]{width:48px;height:48px}mat-paginator[_ngcontent-%COMP%]{background:var(--mat-sys-surface);color:var(--mat-sys-on-surface)}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.group-management__header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:16px;padding:16px 0}.group-management__actions[_ngcontent-%COMP%]{width:100%;flex-direction:column}.group-management__button[_ngcontent-%COMP%]{width:100%;height:44px;font-size:15px}.group-management__actions-cell[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px}mat-cell[_ngcontent-%COMP%]{padding:0 12px;font-size:13px}}'],changeDetection:0})}return n})();function aAe(n,i){n&1&&(s(0,"mat-error"),d(1,"Role name is required"),l())}function sAe(n,i){n&1&&(s(0,"mat-error"),d(1,"Role name is incorrect"),l())}var AM=(()=>{class n{data;dialogRef=f(Ie);formBuilder=f(Vn);cd=f(Q);roleNameForm;constructor(e){this.data=e}ngOnInit(){this.roleNameForm=this.formBuilder.group({name:new Ye,description:new Ye}),this.cd.markForCheck()}get form(){return this.roleNameForm.controls}onAddClick(){if(this.roleNameForm.invalid)return;let e=this.roleNameForm.controls.name.value,t=this.roleNameForm.controls.description.value;this.dialogRef.close({name:e,description:t})}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-add-role-dialog"]],decls:19,vars:3,consts:[["mat-dialog-title",""],[3,"formGroup"],["mat-dialog-content",""],["appearance","fill",1,"full-width-field"],["matInput","","type","text","formControlName","name","placeholder","Please enter role name"],["matInput","","type","text","formControlName","description","placeholder","Please enter a description"],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Create new role"),l(),s(2,"form",1)(3,"div",2)(4,"mat-form-field",3)(5,"mat-label"),d(6,"Role name"),l(),R(7,"input",4),A(8,aAe,2,0,"mat-error"),A(9,sAe,2,0,"mat-error"),l(),s(10,"mat-form-field",3)(11,"mat-label"),d(12,"Description"),l(),R(13,"input",5),l()(),s(14,"div",6)(15,"button",7),g("click",function(){return o.onNoClick()}),d(16,"Cancel"),l(),s(17,"button",8),g("click",function(){return o.onAddClick()}),d(18,"Add Role"),l()()()),t&2&&(m(2),C("formGroup",o.roleNameForm),m(6),O(o.form.name!=null&&o.form.name.touched&&(o.form.name!=null&&o.form.name.errors)&&(o.form.name!=null&&o.form.name.errors.required)?8:-1),m(),O(o.form.name!=null&&o.form.name.errors&&(o.form.name!=null&&o.form.name.errors.invalidName)?9:-1))},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,_e,Ne,Fe,bt,W,pe,we,Me,et,fi,Se,Ee],styles:[".full-width-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var lAe=(n,i)=>i.name;function cAe(n,i){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}var OM=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}onCancel(){this.dialogRef.close()}onDelete(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-delete-role-dialog"]],decls:10,vars:0,consts:[["mat-dialog-title",""],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following roles?"),l(),s(2,"ul"),Y(3,cAe,2,1,"li",null,lAe),l(),s(5,"div",1)(6,"button",2),g("click",function(){return o.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),g("click",function(){return o.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Z(o.data.roles))},dependencies:[ne,_e,Ne,Fe,W,pe],encapsulation:2,changeDetection:0})}return n})();var yj=(()=>{class n{transform(e,t){return t&&(t=t.trim().toLowerCase(),e.filter=t),e}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"roleFilter",type:n,pure:!0})}return n})();var dAe=["rolesPaginator"],mAe=["rolesSort"],pAe=()=>[5,10,20],uAe=(n,i)=>["/controller",n,"management","roles",i];function hAe(n,i){if(n&1){let e=z();s(0,"mat-header-cell",23)(1,"mat-checkbox",24),g("change",function(o){k(e);let r=v(2);return T(o?r.masterToggle():null)}),l()()}if(n&2){let e=v(2);m(),C("checked",e.selection.hasValue()&&e.isAllSelected())("indeterminate",e.selection.hasValue()&&!e.isAllSelected())}}function fAe(n,i){if(n&1){let e=z();s(0,"mat-cell",23)(1,"mat-checkbox",25),g("click",function(o){return o.stopPropagation()})("change",function(o){let r=k(e).$implicit,a=v(2);return T(o?a.selection.toggle(r):null)}),l()()}if(n&2){let e=i.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function gAe(n,i){n&1&&(s(0,"mat-header-cell",26),d(1,"Name"),l())}function _Ae(n,i){if(n&1&&(s(0,"mat-cell")(1,"a",27),d(2),l()()),n&2){let e=i.$implicit,t=v(2);m(),C("routerLink",zs(2,uAe,t.controller.id,e.role_id)),m(),ee(" ",e.name," ")}}function vAe(n,i){n&1&&(s(0,"mat-header-cell",26),d(1,"Description"),l())}function CAe(n,i){if(n&1&&(s(0,"mat-cell")(1,"span",28),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.description)}}function bAe(n,i){n&1&&R(0,"mat-header-row")}function xAe(n,i){n&1&&R(0,"mat-row")}function yAe(n,i){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Roles"),l(),s(3,"div",5)(4,"button",6),g("click",function(){k(e);let o=v();return T(o.onDelete(o.selection.selected))}),d(5," Delete roles "),l(),s(6,"button",7),g("click",function(){k(e);let o=v();return T(o.addRole())}),d(7,"Add Role"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),g("input",function(o){k(e);let r=v();return T(r.searchText.set(o.target.value))}),l()()(),s(11,"div",11)(12,"mat-table",12,0),en(14,"roleFilter"),Le(15,13),xe(16,hAe,2,2,"mat-header-cell",14)(17,fAe,2,1,"mat-cell",15),Ve(),Le(18,16),xe(19,gAe,2,0,"mat-header-cell",17)(20,_Ae,3,5,"mat-cell",18),Ve(),Le(21,19),xe(22,vAe,2,0,"mat-header-cell",17)(23,CAe,3,1,"mat-cell",18),Ve(),xe(24,bAe,1,0,"mat-header-row",20)(25,xAe,1,0,"mat-row",21),l(),R(26,"mat-paginator",22,1),l()}if(n&2){let e=v();m(4),C("disabled",e.selection.selected.length===0),m(6),C("value",e.searchText()),m(2),C("dataSource",na(14,6,e.dataSource,e.searchText())),m(12),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Bt(9,pAe))}}function SAe(n,i){n&1&&(s(0,"div",2),R(1,"mat-spinner",29),l())}var NM=(()=>{class n{route=f(lt);router=f(ht);roleService=f(Tl);progressService=f(no);controllerService=f(Je);dialog=f(nt);toasterService=f(te);cd=f(Q);controller;dataSource=new pr;displayedColumns=["select","name","description"];selection=new Oa(!0,[]);searchText=U("");rolesPaginator;rolesSort;isReady=ae(!1);constructor(){}ngOnInit(){let e=this.route.parent.snapshot.paramMap.get("controller_id");this.controllerService.get(+e).then(t=>{this.controller=t,this.refresh()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}ngAfterViewInit(){this.rolesPaginator.changes.subscribe(e=>{this.dataSource.paginator=e.first}),this.rolesSort.changes.subscribe(e=>{this.dataSource.sort=e.first}),this.dataSource.sortingDataAccessor=(e,t)=>t==="name"?e[t]?e[t].toLowerCase():"":e[t]}refresh(){this.roleService.get(this.controller).subscribe({next:e=>{this.isReady.set(!0),this.dataSource.data=e},error:e=>{let t=e.error?.message||e.message||"Failed to load roles";this.toasterService.error(t),this.progressService.setError(e),this.cd.markForCheck()}})}addRole(){let e=this.dialog.open(AM,{width:"400px",autoFocus:!1,disableClose:!0,data:{controller:this.controller}}).afterClosed().subscribe(t=>{t&&this.roleService.create(this.controller,t).subscribe({next:()=>{this.toasterService.success(`${t.name} role created`),this.refresh()},error:o=>{let r=o.error?.message||o.message||"Failed to create role";this.toasterService.error(r),this.cd.markForCheck()}})})}isAllSelected(){let e=this.selection.selected.length,t=this.dataSource.data.length;return e===t}masterToggle(){this.isAllSelected()?this.selection.clear():this.dataSource.data.forEach(e=>this.selection.select(e))}onDelete(e){this.dialog.open(OM,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{roles:e}}).afterClosed().subscribe(t=>{if(t){let o=e.map(r=>this.roleService.delete(this.controller,r.role_id));qi(o).subscribe({next:()=>{this.refresh()},error:r=>{let a=r.error?.message||r.message||"Failed to delete roles";this.toasterService.error(a),this.cd.markForCheck()}})}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-role-management"]],viewQuery:function(t,o){if(t&1&&xn(dAe,5)(mAe,5),t&2){let r;mt(r=pt())&&(o.rolesPaginator=r),mt(r=pt())&&(o.rolesSort=r)}},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:2,vars:1,consts:[["rolesSort","matSort"],["rolesPaginator","matPaginator"],[1,"role-management__loader"],[1,"role-management__header"],[1,"role-management__title"],[1,"role-management__actions"],["mat-raised-button","","color","primary",1,"role-management__button",3,"click","disabled"],["mat-raised-button","","color","primary",1,"role-management__button",3,"click"],[1,"role-management__search-form"],[1,"role-management__search"],["matInput","","placeholder","Search role by name",3,"input","value"],[1,"role-management__table-container"],["matSort","",3,"dataSource"],["matColumnDef","select"],["class","role-management__small-col",4,"matHeaderCellDef"],["class","role-management__small-col",4,"matCellDef"],["matColumnDef","name"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","description"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","","aria-label","Select page",3,"pageSizeOptions"],[1,"role-management__small-col"],[3,"change","checked","indeterminate"],[3,"click","change","checked"],["mat-sort-header",""],[1,"role-management__link",3,"routerLink"],[1,"role-management__overflow-text"],[1,"role-management__spinner"]],template:function(t,o){t&1&&A(0,yAe,28,10)(1,SAe,2,0,"div",2),t&2&&O(o.isReady()?0:1)},dependencies:[ne,Xe,at,rt,Gn,dt,vn,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,hr,ar,mo,Tr,Ot,Gt,W,pe,ie,we,Me,Se,Ee,_e,pn,li,yj],styles:['[_nghost-%COMP%]{display:block;width:100%}.role-management__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 0;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.role-management__title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.role-management__actions[_ngcontent-%COMP%]{display:flex;gap:12px}.role-management__button[_ngcontent-%COMP%]{margin:12px 0;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1)}.role-management__button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.role-management__button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.role-management__search-form[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:16px auto;width:100%;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.role-management__search[_ngcontent-%COMP%]{width:100%;max-width:1000px}.role-management__table-container[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;width:100%;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both}.role-management__table-container--hidden[_ngcontent-%COMP%]{display:none}mat-row[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);cursor:default;position:relative}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent);transform:scale(1.002)}mat-row[_ngcontent-%COMP%]:nth-child(2n){background-color:color-mix(in srgb,var(--mat-sys-on-surface) 1%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n):hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent)}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.mat-header-row[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px;text-transform:uppercase}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}mat-cell[mat-column=name][_ngcontent-%COMP%]{justify-content:flex-start;font-weight:500}.role-management__link[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);display:inline-block;transform-origin:left center;color:var(--mat-sys-primary);text-decoration:none;font-weight:500;position:relative}.role-management__link[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-2px;left:0;width:0;height:2px;background-color:currentColor;transition:width .2s cubic-bezier(.4,0,.2,1)}.role-management__link[_ngcontent-%COMP%]:hover{color:color-mix(in srgb,var(--mat-sys-primary) 80%,black);transform:translateY(-2px)}.role-management__link[_ngcontent-%COMP%]:hover:after{width:100%}.role-management__overflow-text[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding-right:5px}mat-cell[mat-column=actions][_ngcontent-%COMP%], mat-header-cell[mat-column=actions][_ngcontent-%COMP%]{justify-content:flex-end;padding:0 16px}mat-cell[mat-column=actions][_ngcontent-%COMP%]{overflow:visible}.role-management__small-col[_ngcontent-%COMP%]{width:60px;min-width:60px}.role-management__loader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:200px}.role-management__spinner[_ngcontent-%COMP%]{width:48px;height:48px}mat-paginator[_ngcontent-%COMP%]{background:var(--mat-sys-surface);color:var(--mat-sys-on-surface)}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.role-management__header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:16px;padding:16px 0}.role-management__actions[_ngcontent-%COMP%]{width:100%;flex-direction:column}.role-management__button[_ngcontent-%COMP%]{width:100%;height:44px;font-size:15px}.role-management__actions-cell[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px}mat-cell[_ngcontent-%COMP%]{padding:0 12px;font-size:13px}}'],changeDetection:0})}return n})();var Sj=(()=>{class n{httpController;constructor(e){this.httpController=e}get(e){return this.httpController.get(e,"/access/privileges")}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Gv=class{ownedPrivileges;change={add:new Set,delete:new Set};constructor(i){this.ownedPrivileges=i}add(i){this.change.delete.has(i)&&this.change.delete.delete(i),!this.ownedPrivileges.includes(i)&&this.change.add.add(i)}delete(i){this.change.add.has(i)&&this.change.add.delete(i),this.ownedPrivileges.includes(i)&&this.change.delete.add(i)}isAdded(i){return this.change.add.has(i)}isDeleted(i){return this.change.delete.has(i)}get(){return{add:Array.from(this.change.add),delete:Array.from(this.change.delete)}}};var wj=(()=>{class n{transform(e){if(e){let t={};e.forEach(r=>{let[a,c]=r.name.split(".");t.hasOwnProperty(a)?t[a].push({verb:c,privilege:r}):t[a]=[{verb:c,privilege:r}]});let o=[];for(let[r,a]of Object.entries(t))o.push({key:r,values:a});return o}}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"groupPrivileges",type:n,pure:!0})}return n})();var wAe=(n,i)=>i.key,Mj=(n,i)=>i.privilege.privilege_id;function MAe(n,i){if(n&1){let e=z();s(0,"button",7),g("click",function(){k(e);let o=v(2);return T(o.editMode=!0)}),s(1,"mat-icon"),d(2,"edit"),l()()}}function kAe(n,i){if(n&1){let e=z();s(0,"button",8),g("click",function(){k(e);let o=v(2);return T(o.editMode=!1)}),d(1,"Cancel"),l(),s(2,"button",9),g("click",function(){k(e);let o=v(2);return T(o.close())}),d(3,"Update"),l()}}function TAe(n,i){if(n&1&&(A(0,MAe,3,0,"button",6),A(1,kAe,4,0)),n&2){let e=v();O(e.editMode?-1:0),m(),O(e.editMode?1:-1)}}function EAe(n,i){if(n&1&&(s(0,"mat-icon",15),d(1,"info"),l()),n&2){let e=v().$implicit;C("matTooltip",e.privilege.description)}}function DAe(n,i){if(n&1){let e=z();s(0,"div",13)(1,"mat-checkbox",14),g("change",function(o){let r=k(e).$implicit,a=v(4);return T(a.onPrivilegeChange(o.checked,r.privilege))}),l(),s(2,"span"),d(3),l(),A(4,EAe,2,1,"mat-icon",15),l()}if(n&2){let e=i.$implicit,t=v(4);m(),C("checked",t.ownedPrivilegesList().includes(e.privilege.privilege_id)),m(),Be("privileges__verb--added",t.changer.isAdded(e.privilege.privilege_id))("privileges__verb--deleted",t.changer.isDeleted(e.privilege.privilege_id)),m(),ee(" ",e.verb," "),m(),O(e.privilege.description?4:-1)}}function PAe(n,i){if(n&1&&(s(0,"div",10)(1,"div",11),d(2),l(),s(3,"div",12),Y(4,DAe,5,7,"div",13,Mj),l()()),n&2){let e=v().$implicit;m(2),ee("",e.key,":"),m(2),Z(e.values)}}function IAe(n,i){if(n&1&&(s(0,"span",13),d(1),l()),n&2){let e=v().$implicit;m(),ee(" ",e.verb," ")}}function AAe(n,i){if(n&1&&A(0,IAe,2,1,"span",13),n&2){let e=i.$implicit,t=v(5);O(t.ownedPrivilegesList().includes(e.privilege.privilege_id)?0:-1)}}function OAe(n,i){if(n&1&&(s(0,"div",10)(1,"div",11),d(2),l(),s(3,"div",12),Y(4,AAe,1,1,null,null,Mj),l()()),n&2){let e=v(2).$implicit;m(2),ee("",e.key,":"),m(2),Z(e.values)}}function NAe(n,i){if(n&1&&A(0,OAe,6,1,"div",10),n&2){let e=v().$implicit,t=v(2);O(t.ownedPrivilegesName().includes(e.key)?0:-1)}}function FAe(n,i){if(n&1&&A(0,PAe,6,1,"div",10)(1,NAe,1,1),n&2){let e=v(2);O(e.editMode?0:1)}}function RAe(n,i){if(n&1&&(s(0,"div",5),Y(1,FAe,2,1,null,null,wAe),en(3,"groupPrivileges"),l()),n&2){let e=v();m(),Z(jn(3,0,e.privileges()))}}var FM=(()=>{class n{disable=le(!0);privileges=le([]);set ownedPrivilege(e){e&&(this.ownedPrivilegesName.set(e.map(t=>t.name.split(".")[0])),this.ownedPrivilegesList.set(e.map(t=>t.privilege_id)))}update=new ve;ownedPrivilegesName=ae([]);ownedPrivilegesList=ae([]);changer=new Gv([]);editModeState=ae(!1);collapsedState=ae(!0);get editMode(){return this.editModeState()}set editMode(e){e&&(this.changer=new Gv(this.ownedPrivilegesList())),this.editModeState.set(e)}get collapsed(){return this.collapsedState()}toggleCollapsed(){this.collapsedState.set(!this.collapsedState())}constructor(){}onPrivilegeChange(e,t){let o=t.privilege_id;e?this.changer.add(o):this.changer.delete(o)}close(){this.update.emit(this.changer.get()),this.editMode=!1}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-privilege"]],inputs:{disable:[1,"disable"],privileges:[1,"privileges"],ownedPrivilege:"ownedPrivilege"},outputs:{update:"update"},decls:10,vars:6,consts:[[1,"privileges"],[1,"privileges__header",3,"click"],[1,"privileges__title"],[1,"privileges__actions"],["mat-icon-button","",3,"click","matTooltip"],[1,"privileges__list"],["mat-icon-button","","matTooltip","Edit privileges"],["mat-icon-button","","matTooltip","Edit privileges",3,"click"],["mat-raised-button","","color","warn",3,"click"],["mat-raised-button","","color","primary",3,"click"],[1,"privileges__group"],[1,"privileges__key"],[1,"privileges__values"],[1,"privileges__verb"],[1,"privileges__checkbox",3,"change","checked"],["matTooltipPosition","right",1,"privileges__info-icon",3,"matTooltip"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1),g("click",function(){return o.collapsed&&o.toggleCollapsed()}),s(2,"h3",2),d(3,"Privileges"),l(),s(4,"div",3)(5,"button",4),g("click",function(){return o.toggleCollapsed()}),s(6,"mat-icon"),d(7),l()(),A(8,TAe,2,2),l()(),A(9,RAe,4,2,"div",5),l()),t&2&&(m(),Be("privileges__header--clickable",o.collapsed),m(4),C("matTooltip",o.collapsed?"Expand":"Collapse"),m(2),j(o.collapsed?"expand_more":"expand_less"),m(),O(o.disable()?-1:8),m(),O(o.collapsed?-1:9))},dependencies:[ne,W,pe,je,ie,de,Ot,Gt,wt,It,wj],styles:["app-privilege[_ngcontent-%COMP%]{display:block;width:100%}.privileges[_ngcontent-%COMP%]{padding:16px;background:var(--mat-sys-surface);border-radius:12px;border:1px solid var(--mat-sys-outline-variant)}.privileges__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:16px;margin-bottom:16px;border-bottom:1px solid var(--mat-sys-outline-variant)}.privileges__header--clickable[_ngcontent-%COMP%]{cursor:pointer}.privileges__header--clickable[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container-low);margin:-16px -16px 0;padding:16px;border-radius:12px 12px 0 0}.privileges__title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:var(--mat-sys-on-surface);margin:0}.privileges__actions[_ngcontent-%COMP%]{display:flex;gap:8px}.privileges__list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.privileges__group[_ngcontent-%COMP%]{display:flex;flex-direction:row;padding:12px;background:var(--mat-sys-surface-container-low);border-radius:8px;min-height:40px;align-items:flex-start}.privileges__key[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);display:flex;flex-shrink:0;width:120px;align-items:center;height:40px;font-weight:500}.privileges__values[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;padding:8px;min-height:40px;align-items:center}.privileges__verb[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:4px 8px;border-radius:4px;white-space:nowrap;background:var(--mat-sys-surface-container-high);color:var(--mat-sys-on-surface);font-size:13px}.privileges__verb--added[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}.privileges__verb--deleted[_ngcontent-%COMP%]{background:var(--mat-sys-error-container);color:var(--mat-sys-on-error-container);text-decoration:line-through}.privileges__checkbox[_ngcontent-%COMP%]{margin-right:8px}.privileges__info-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;margin-left:4px;color:var(--mat-sys-on-surface-variant);cursor:help;opacity:.6;transition:opacity .2s ease}.privileges__info-icon[_ngcontent-%COMP%]:hover{opacity:1;color:var(--mat-sys-primary)}"],changeDetection:0})}return n})();var LAe=n=>["/controller",n,"management","roles"];function VAe(n,i){if(n&1&&(s(0,"div",10)(1,"div",21)(2,"span",22),d(3,"Role name"),l(),s(4,"span",23),d(5),en(6,"async"),l()(),s(7,"div",21)(8,"span",22),d(9,"Description"),l(),s(10,"span",23),d(11),en(12,"async"),l()()()),n&2){let e,t,o=v();m(5),j((e=jn(6,2,o.$role))==null?null:e.name),m(6),j(((t=jn(12,4,o.$role))==null?null:t.description)||"-")}}function BAe(n,i){if(n&1&&(s(0,"form",11)(1,"mat-form-field",24)(2,"mat-label"),d(3,"Role name"),l(),R(4,"input",25),l(),s(5,"mat-form-field",24)(6,"mat-label"),d(7,"Description"),l(),R(8,"input",26),l()()),n&2){let e=v();C("formGroup",e.editRoleForm)}}var RM=(()=>{class n{roleService=f(Tl);toastService=f(te);route=f(lt);privilegeService=f(Sj);fb=f(CC);cd=f(Q);controller;$role=new an({role_id:"",description:"",updated_at:"",is_builtin:!1,privileges:[],name:"",created_at:""});editRoleForm;$ownedPrivilegesId=this.$role.pipe(Lt(e=>e.privileges));privileges;roleId;constructor(){this.$role.subscribe(e=>{this.editRoleForm=this.fb.group({rolename:[e.name],description:[e.description]})})}ngOnInit(){this.route.data.subscribe({next:e=>{this.controller=e.controller,this.roleId=e.role.role_id,this.privileges=this.privilegeService.get(this.controller),this.roleService.getById(this.controller,this.roleId).subscribe({next:t=>this.$role.next(t),error:t=>{let o=t.error?.message||t.message||"Failed to load role";this.toastService.error(o),this.cd.markForCheck()}})},error:e=>{let t=e.error?.message||e.message||"Failed to load route data";this.toastService.error(t),this.cd.markForCheck()}})}onUpdate(){let e=this.$role.value;e.name=this.editRoleForm.get("rolename")?.value,e.description=this.editRoleForm.get("description")?.value,this.roleService.update(this.controller,e).subscribe({next:()=>{this.toastService.success(`Role ${e.name} was updated`),this.roleService.getById(this.controller,this.roleId).subscribe({next:t=>this.$role.next(t),error:t=>{let o=t.error?.message||t.message||"Failed to load role after update";this.toastService.error(o),this.cd.markForCheck()}})},error:t=>{let o=t.error?.message||t.message||"Failed to update role";this.toastService.error(o),this.cd.markForCheck()}})}onPrivilegesUpdate(e){let t=[];for(let o of e.add)t.push(this.roleService.setPrivileges(this.controller,this.roleId,o));for(let o of e.delete)t.push(this.roleService.removePrivileges(this.controller,this.roleId,o));qi(t).subscribe({next:()=>{this.roleService.getById(this.controller,this.roleId).subscribe({next:o=>this.$role.next(o),error:o=>{let r=o.error?.message||o.message||"Failed to load role after privilege update";this.toastService.error(r),this.cd.markForCheck()}})},error:o=>{let r=o.error?.message||o.message||"Failed to update privileges";this.toastService.error(r),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-role-detail"]],decls:55,vars:35,consts:[[1,"role-detail"],[1,"role-detail__header"],[1,"role-detail__header-content"],["mat-icon-button","","matTooltip","Back to role management","matTooltipClass","custom-tooltip",1,"role-detail__back-btn",3,"routerLink"],["aria-label","Back to role management"],[1,"role-detail__title"],[1,"role-detail__content"],[1,"role-detail__main"],[1,"role-detail__section"],[1,"role-detail__card"],[1,"role-detail__readonly"],[1,"role-detail__form",3,"formGroup"],[1,"role-detail__info-grid"],[1,"role-detail__info-item"],[1,"role-detail__info-label"],[1,"role-detail__info-value"],[1,"role-detail__info-item","role-detail__info-item--full"],[1,"role-detail__info-value","role-detail__info-value--mono"],[1,"role-detail__actions"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"update","disable","ownedPrivilege","privileges"],[1,"role-detail__readonly-item"],[1,"role-detail__readonly-label"],[1,"role-detail__readonly-value"],["appearance","fill",1,"role-detail__field"],["matInput","","type","text","formControlName","rolename"],["matInput","","type","text","formControlName","description"]],template:function(t,o){if(t&1&&(s(0,"div",0)(1,"header",1)(2,"div",2)(3,"a",3)(4,"mat-icon",4),d(5,"keyboard_arrow_left"),l()(),s(6,"h1",5),d(7),en(8,"async"),l()()(),s(9,"div",6)(10,"div",7)(11,"section",8)(12,"mat-card",9)(13,"mat-card-header")(14,"mat-card-title"),d(15,"Role Details"),l()(),s(16,"mat-card-content"),A(17,VAe,13,6,"div",10),en(18,"async"),DO(19,BAe,9,1,"form",11),s(20,"div",12)(21,"div",13)(22,"span",14),d(23,"Creation date"),l(),s(24,"span",15),d(25),en(26,"async"),l()(),s(27,"div",13)(28,"span",14),d(29,"Last update"),l(),s(30,"span",15),d(31),en(32,"async"),l()(),s(33,"div",16)(34,"span",14),d(35,"UUID"),l(),s(36,"span",17),d(37),en(38,"async"),l()(),s(39,"div",13)(40,"span",14),d(41,"Is built-in"),l(),s(42,"span",15),d(43),en(44,"async"),l()()()(),s(45,"mat-card-actions",18)(46,"button",19),en(47,"async"),en(48,"async"),g("click",function(){return o.onUpdate()}),d(49," Update Role "),l()()()(),s(50,"section",8)(51,"app-privilege",20),en(52,"async"),en(53,"async"),en(54,"async"),g("update",function(a){return o.onPrivilegesUpdate(a)}),l()()()()()),t&2){let r,a,c,p,u,h,_,S;m(3),C("routerLink",dn(33,LAe,o.controller.id)),m(4),ee("Role ",(r=jn(8,11,o.$role))==null?null:r.name),m(10),O((a=jn(18,13,o.$role))!=null&&a.is_builtin?17:19),m(8),j((c=jn(26,15,o.$role))==null?null:c.created_at),m(6),j((p=jn(32,17,o.$role))==null?null:p.updated_at),m(6),j((u=jn(38,19,o.$role))==null?null:u.role_id),m(6),j((h=jn(44,21,o.$role))!=null&&h.is_builtin?"YES":"NO"),m(3),C("disabled",!jn(47,23,o.editRoleForm.valueChanges)&&o.editRoleForm.valid||((_=jn(48,25,o.$role))==null?null:_.is_builtin)),m(5),C("disable",(S=jn(52,27,o.$role))==null?null:S.is_builtin)("ownedPrivilege",jn(53,29,o.$ownedPrivilegesId))("privileges",jn(54,31,o.privileges))}},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,dt,vn,Mt,On,$b,ll,Nc,Oc,we,Me,et,Se,Ee,W,pe,je,ie,de,wt,It,FM,zr],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.role-detail[_ngcontent-%COMP%]{padding:20px 24px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out;display:flex;flex-direction:column;align-items:center}.role-detail__header[_ngcontent-%COMP%]{margin-bottom:24px;width:100%;max-width:1000px}.role-detail__header-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.role-detail__back-btn[_ngcontent-%COMP%]{flex-shrink:0}.role-detail__title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.role-detail__content[_ngcontent-%COMP%]{width:100%;max-width:1000px}.role-detail__main[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:24px;width:100%;max-width:1000px}.role-detail__section[_ngcontent-%COMP%]{width:100%}.role-detail__card[_ngcontent-%COMP%]{border-radius:12px}.role-detail__card[_ngcontent-%COMP%] mat-card-header[_ngcontent-%COMP%]{padding:16px 16px 0}.role-detail__card[_ngcontent-%COMP%] mat-card-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:var(--mat-sys-on-surface)}.role-detail__card[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{padding:16px}.role-detail__card[_ngcontent-%COMP%] mat-card-actions[_ngcontent-%COMP%]{padding:0 16px 16px}.role-detail__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}.role-detail__field[_ngcontent-%COMP%]{width:100%}.role-detail__readonly[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;padding:16px;background:var(--mat-sys-surface-container-low);border-radius:8px;margin-bottom:16px}.role-detail__readonly-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.role-detail__readonly-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px}.role-detail__readonly-value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.role-detail__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;padding-top:8px}.role-detail__info-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;padding-top:16px;border-top:1px solid var(--mat-sys-outline-variant)}@media(max-width:600px){.role-detail__info-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.role-detail__info-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.role-detail__info-item--full[_ngcontent-%COMP%]{grid-column:1/-1}.role-detail__info-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px}.role-detail__info-value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.role-detail__info-value--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:12px}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}"],changeDetection:0})}return n})();var kj=(()=>{class n{controllerService;roleService;constructor(e,t){this.controllerService=e,this.roleService=t}resolve(e,t){let o=e.paramMap.get("controller_id"),r=e.paramMap.get("role_id");return Vu(this.controllerService.get(+o)).pipe(Un(a=>this.roleService.getById(a,r)),po(a=>Bo(()=>a)))}static \u0275fac=function(t){return new(t||n)(ge(Je),ge(Tl))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var lO=class{dataNodes;expansionModel=new Oa(!0);trackBy;getLevel;isExpandable;getChildren;toggle(i){this.expansionModel.toggle(this._trackByValue(i))}expand(i){this.expansionModel.select(this._trackByValue(i))}collapse(i){this.expansionModel.deselect(this._trackByValue(i))}isExpanded(i){return this.expansionModel.isSelected(this._trackByValue(i))}toggleDescendants(i){this.expansionModel.isSelected(this._trackByValue(i))?this.collapseDescendants(i):this.expandDescendants(i)}collapseAll(){this.expansionModel.clear()}expandDescendants(i){let e=[i];e.push(...this.getDescendants(i)),this.expansionModel.select(...e.map(t=>this._trackByValue(t)))}collapseDescendants(i){let e=[i];e.push(...this.getDescendants(i)),this.expansionModel.deselect(...e.map(t=>this._trackByValue(t)))}_trackByValue(i){return this.trackBy?this.trackBy(i):i}};var LM=class extends lO{getChildren;options;constructor(i,e){super(),this.getChildren=i,this.options=e,this.options&&(this.trackBy=this.options.trackBy),this.options?.isExpandable&&(this.isExpandable=this.options.isExpandable)}expandAll(){this.expansionModel.clear();let i=this.dataNodes.reduce((e,t)=>[...e,...this.getDescendants(t),t],[]);this.expansionModel.select(...i.map(e=>this._trackByValue(e)))}getDescendants(i){let e=[];return this._getDescendants(e,i),e.splice(1)}_getDescendants(i,e){i.push(e);let t=this.getChildren(e);Array.isArray(t)?t.forEach(o=>this._getDescendants(i,o)):Ng(t)&&t.pipe(Ao(1),ai(Boolean)).subscribe(o=>{for(let r of o)this._getDescendants(i,r)})}},dO=new cn("CDK_TREE_NODE_OUTLET_NODE"),Tg=(()=>{class n{viewContainer=f(oo);_node=f(dO,{optional:!0});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkTreeNodeOutlet",""]]})}return n})(),cO=class{$implicit;level;index;count;constructor(i){this.$implicit=i}},VM=(()=>{class n{template=f(Oo);when;constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:[0,"cdkTreeNodeDefWhen","when"]}})}return n})();function Tj(){return Error("Could not find a tree control, levelAccessor, or childrenAccessor for the tree.")}var Wv=(()=>{class n{_differs=f(ld);_changeDetectorRef=f(Q);_elementRef=f(Zt);_dir=f(Ka);_onDestroy=new He;_dataDiffer;_defaultNodeDef=null;_dataSubscription;_levels=new Map;_parents=new Map;_ariaSets=new Map;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&this._switchDataSource(e)}_dataSource;treeControl;levelAccessor;childrenAccessor;trackBy;expansionKey;_nodeOutlet;_nodeDefs;viewChange=new an({start:0,end:Number.MAX_VALUE});_expansionModel;_flattenedNodes=new an([]);_nodeType=new an(null);_nodes=new an(new Map);_keyManagerNodes=new an([]);_keyManagerFactory=f(p4);_keyManager;_viewInit=!1;constructor(){}ngAfterContentInit(){this._initializeKeyManager()}ngAfterContentChecked(){this._updateDefaultNodeDefinition(),this._subscribeToDataChanges()}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this._nodes.complete(),this._keyManagerNodes.complete(),this._nodeType.complete(),this._flattenedNodes.complete(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&typeof this._dataSource.disconnect=="function"&&this.dataSource.disconnect(this),this._dataSubscription?.unsubscribe(),this._dataSubscription=void 0,this._keyManager?.destroy()}ngOnInit(){this._checkTreeControlUsage(),this._initializeDataDiffer()}ngAfterViewInit(){this._viewInit=!0}_updateDefaultNodeDefinition(){let e=this._nodeDefs.filter(t=>!t.when);e.length>1,this._defaultNodeDef=e[0]}_setNodeTypeIfUnset(e){this._nodeType.value===null&&this._nodeType.next(e)}_switchDataSource(e){this._dataSource&&typeof this._dataSource.disconnect=="function"&&this.dataSource.disconnect(this),this._dataSubscription?.unsubscribe(),this._dataSubscription=void 0,e||this._nodeOutlet.viewContainer.clear(),this._dataSource=e,this._nodeDefs&&this._subscribeToDataChanges()}_getExpansionModel(){return this.treeControl?this.treeControl.expansionModel:(this._expansionModel??=new Oa(!0),this._expansionModel)}_subscribeToDataChanges(){if(this._dataSubscription)return;let e;Uu(this._dataSource)?e=this._dataSource.connect(this):Ng(this._dataSource)?e=this._dataSource:Array.isArray(this._dataSource)&&(e=Nn(this._dataSource)),e&&(this._dataSubscription=this._getRenderData(e).pipe(tt(this._onDestroy)).subscribe(t=>{this._renderDataChanges(t)}))}_getRenderData(e){let t=this._getExpansionModel();return Pr([e,this._nodeType,t.changed.pipe(pi(null),Qi(o=>{this._emitExpansionChanges(o)}))]).pipe(Un(([o,r])=>r===null?Nn({renderNodes:o,flattenedNodes:null,nodeType:r}):this._computeRenderingData(o,r).pipe(Lt(a=>it(K({},a),{nodeType:r})))))}_renderDataChanges(e){if(e.nodeType===null){this.renderNodeChanges(e.renderNodes);return}this._updateCachedData(e.flattenedNodes),this.renderNodeChanges(e.renderNodes),this._updateKeyManagerItems(e.flattenedNodes)}_emitExpansionChanges(e){if(!e)return;let t=this._nodes.value;for(let o of e.added)t.get(o)?._emitExpansionState(!0);for(let o of e.removed)t.get(o)?._emitExpansionState(!1)}_initializeKeyManager(){let e=Pr([this._keyManagerNodes,this._nodes]).pipe(Lt(([o,r])=>o.reduce((a,c)=>{let p=r.get(this._getExpansionKey(c));return p&&a.push(p),a},[]))),t={trackBy:o=>this._getExpansionKey(o.data),skipPredicate:o=>!!o.isDisabled,typeAheadDebounceInterval:!0,horizontalOrientation:this._dir.value};this._keyManager=this._keyManagerFactory(e,t)}_initializeDataDiffer(){let e=this.trackBy??((t,o)=>this._getExpansionKey(o));this._dataDiffer=this._differs.find([]).create(e)}_checkTreeControlUsage(){}renderNodeChanges(e,t=this._dataDiffer,o=this._nodeOutlet.viewContainer,r){let a=t.diff(e);!a&&!this._viewInit||(a?.forEachOperation((c,p,u)=>{if(c.previousIndex==null)this.insertNode(e[u],u,o,r);else if(u==null)o.remove(p);else{let h=o.get(p);o.move(h,u)}}),a?.forEachIdentityChange(c=>{let p=c.item;if(c.currentIndex!=null){let u=o.get(c.currentIndex);u.context.$implicit=p}}),r?this._changeDetectorRef.markForCheck():this._changeDetectorRef.detectChanges())}_getNodeDef(e,t){if(this._nodeDefs.length===1)return this._nodeDefs.first;let o=this._nodeDefs.find(r=>r.when&&r.when(t,e))||this._defaultNodeDef;return o}insertNode(e,t,o,r){let a=this._getLevelAccessor(),c=this._getNodeDef(e,t),p=this._getExpansionKey(e),u=new cO(e);u.index=t,r??=this._parents.get(p)??void 0,a?u.level=a(e):r!==void 0&&this._levels.has(this._getExpansionKey(r))?u.level=this._levels.get(this._getExpansionKey(r))+1:u.level=0,this._levels.set(p,u.level),(o||this._nodeOutlet.viewContainer).createEmbeddedView(c.template,u,t),Eg.mostRecentTreeNode&&(Eg.mostRecentTreeNode.data=e)}isExpanded(e){return!!(this.treeControl?.isExpanded(e)||this._expansionModel?.isSelected(this._getExpansionKey(e)))}toggle(e){this.treeControl?this.treeControl.toggle(e):this._expansionModel&&this._expansionModel.toggle(this._getExpansionKey(e))}expand(e){this.treeControl?this.treeControl.expand(e):this._expansionModel&&this._expansionModel.select(this._getExpansionKey(e))}collapse(e){this.treeControl?this.treeControl.collapse(e):this._expansionModel&&this._expansionModel.deselect(this._getExpansionKey(e))}toggleDescendants(e){this.treeControl?this.treeControl.toggleDescendants(e):this._expansionModel&&(this.isExpanded(e)?this.collapseDescendants(e):this.expandDescendants(e))}expandDescendants(e){if(this.treeControl)this.treeControl.expandDescendants(e);else if(this._expansionModel){let t=this._expansionModel;t.select(this._getExpansionKey(e)),this._getDescendants(e).pipe(Ao(1),tt(this._onDestroy)).subscribe(o=>{t.select(...o.map(r=>this._getExpansionKey(r)))})}}collapseDescendants(e){if(this.treeControl)this.treeControl.collapseDescendants(e);else if(this._expansionModel){let t=this._expansionModel;t.deselect(this._getExpansionKey(e)),this._getDescendants(e).pipe(Ao(1),tt(this._onDestroy)).subscribe(o=>{t.deselect(...o.map(r=>this._getExpansionKey(r)))})}}expandAll(){this.treeControl?this.treeControl.expandAll():this._expansionModel&&this._forEachExpansionKey(e=>this._expansionModel?.select(...e))}collapseAll(){this.treeControl?this.treeControl.collapseAll():this._expansionModel&&this._forEachExpansionKey(e=>this._expansionModel?.deselect(...e))}_getLevelAccessor(){return this.treeControl?.getLevel?.bind(this.treeControl)??this.levelAccessor}_getChildrenAccessor(){return this.treeControl?.getChildren?.bind(this.treeControl)??this.childrenAccessor}_getDirectChildren(e){let t=this._getLevelAccessor(),o=this._expansionModel??this.treeControl?.expansionModel;if(!o)return Nn([]);let r=this._getExpansionKey(e),a=o.changed.pipe(Un(p=>p.added.includes(r)?Nn(!0):p.removed.includes(r)?Nn(!1):Lu),pi(this.isExpanded(e)));if(t)return Pr([a,this._flattenedNodes]).pipe(Lt(([p,u])=>p?this._findChildrenByLevel(t,u,e,1):[]));let c=this._getChildrenAccessor();if(c)return yC(c(e)??[]);throw Tj()}_findChildrenByLevel(e,t,o,r){let a=this._getExpansionKey(o),c=t.findIndex(_=>this._getExpansionKey(_)===a),p=e(o),u=p+r,h=[];for(let _=c+1;_<t.length;_++){let S=e(t[_]);if(S<=p)break;S<=u&&h.push(t[_])}return h}_registerNode(e){this._nodes.value.set(this._getExpansionKey(e.data),e),this._nodes.next(this._nodes.value)}_unregisterNode(e){this._nodes.value.delete(this._getExpansionKey(e.data)),this._nodes.next(this._nodes.value)}_getLevel(e){return this._levels.get(this._getExpansionKey(e))}_getSetSize(e){return this._getAriaSet(e).length}_getPositionInSet(e){let t=this._getAriaSet(e),o=this._getExpansionKey(e);return t.findIndex(r=>this._getExpansionKey(r)===o)+1}_getNodeParent(e){let t=this._parents.get(this._getExpansionKey(e.data));return t&&this._nodes.value.get(this._getExpansionKey(t))}_getNodeChildren(e){return this._getDirectChildren(e.data).pipe(Lt(t=>t.reduce((o,r)=>{let a=this._nodes.value.get(this._getExpansionKey(r));return a&&o.push(a),o},[])))}_sendKeydownToKeyManager(e){if(e.target===this._elementRef.nativeElement)this._keyManager.onKeydown(e);else{let t=this._nodes.getValue();for(let[,o]of t)if(e.target===o._elementRef.nativeElement){this._keyManager.onKeydown(e);break}}}_getDescendants(e){if(this.treeControl)return Nn(this.treeControl.getDescendants(e));if(this.levelAccessor){let t=this._findChildrenByLevel(this.levelAccessor,this._flattenedNodes.value,e,1/0);return Nn(t)}if(this.childrenAccessor)return this._getAllChildrenRecursively(e).pipe(ok((t,o)=>(t.push(...o),t),[]));throw Tj()}_getAllChildrenRecursively(e){return this.childrenAccessor?yC(this.childrenAccessor(e)).pipe(Ao(1),Un(t=>{for(let o of t)this._parents.set(this._getExpansionKey(o),e);return Nn(...t).pipe(rk(o=>ik(Nn([o]),this._getAllChildrenRecursively(o))))})):Nn([])}_getExpansionKey(e){return this.expansionKey?.(e)??e}_getAriaSet(e){let t=this._getExpansionKey(e),o=this._parents.get(t),r=o?this._getExpansionKey(o):null;return this._ariaSets.get(r)??[e]}_findParentForNode(e,t,o){if(!o.length)return null;let r=this._levels.get(this._getExpansionKey(e))??0;for(let a=t-1;a>=0;a--){let c=o[a];if((this._levels.get(this._getExpansionKey(c))??0)<r)return c}return null}_flattenNestedNodesWithExpansion(e,t=0){let o=this._getChildrenAccessor();return o?Nn(...e).pipe(rk(r=>{let a=this._getExpansionKey(r);this._parents.has(a)||this._parents.set(a,null),this._levels.set(a,t);let c=yC(o(r));return ik(Nn([r]),c.pipe(Ao(1),Qi(p=>{this._ariaSets.set(a,[...p??[]]);for(let u of p??[]){let h=this._getExpansionKey(u);this._parents.set(h,r),this._levels.set(h,t+1)}}),Un(p=>p?this._flattenNestedNodesWithExpansion(p,t+1).pipe(Lt(u=>this.isExpanded(r)?u:[])):Nn([]))))}),ok((r,a)=>(r.push(...a),r),[])):Nn([...e])}_computeRenderingData(e,t){if(this.childrenAccessor&&t==="flat")return this._clearPreviousCache(),this._ariaSets.set(null,[...e]),this._flattenNestedNodesWithExpansion(e).pipe(Lt(o=>({renderNodes:o,flattenedNodes:o})));if(this.levelAccessor&&t==="nested"){let o=this.levelAccessor;return Nn(e.filter(r=>o(r)===0)).pipe(Lt(r=>({renderNodes:r,flattenedNodes:e})),Qi(({flattenedNodes:r})=>{this._calculateParents(r)}))}else return t==="flat"?Nn({renderNodes:e,flattenedNodes:e}).pipe(Qi(({flattenedNodes:o})=>{this._calculateParents(o)})):(this._clearPreviousCache(),this._ariaSets.set(null,[...e]),this._flattenNestedNodesWithExpansion(e).pipe(Lt(o=>({renderNodes:e,flattenedNodes:o}))))}_updateCachedData(e){this._flattenedNodes.next(e)}_updateKeyManagerItems(e){this._keyManagerNodes.next(e)}_calculateParents(e){let t=this._getLevelAccessor();if(t){this._clearPreviousCache();for(let o=0;o<e.length;o++){let r=e[o],a=this._getExpansionKey(r);this._levels.set(a,t(r));let c=this._findParentForNode(r,o,e);this._parents.set(a,c);let p=c?this._getExpansionKey(c):null,u=this._ariaSets.get(p)??[];u.splice(o,0,r),this._ariaSets.set(p,u)}}}_forEachExpansionKey(e){let t=[],o=[];this._nodes.value.forEach(r=>{t.push(this._getExpansionKey(r.data)),o.push(this._getDescendants(r.data))}),o.length>0?Pr(o).pipe(Ao(1),tt(this._onDestroy)).subscribe(r=>{r.forEach(a=>a.forEach(c=>t.push(this._getExpansionKey(c)))),e(t)}):e(t)}_clearPreviousCache(){this._parents.clear(),this._levels.clear(),this._ariaSets.clear()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["cdk-tree"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,VM,5),t&2){let a;mt(a=pt())&&(o._nodeDefs=a)}},viewQuery:function(t,o){if(t&1&&xn(Tg,7),t&2){let r;mt(r=pt())&&(o._nodeOutlet=r.first)}},hostAttrs:["role","tree",1,"cdk-tree"],hostBindings:function(t,o){t&1&&g("keydown",function(a){return o._sendKeydownToKeyManager(a)})},inputs:{dataSource:"dataSource",treeControl:"treeControl",levelAccessor:"levelAccessor",childrenAccessor:"childrenAccessor",trackBy:"trackBy",expansionKey:"expansionKey"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(t,o){t&1&&ro(0,0)},dependencies:[Tg],encapsulation:2})}return n})(),Eg=(()=>{class n{_elementRef=f(Zt);_tree=f(Wv);_tabindex=-1;_type="flat";get role(){return"treeitem"}set role(e){}get isExpandable(){return this._isExpandable()}set isExpandable(e){this._inputIsExpandable=e,!(this.data&&!this._isExpandable||!this._inputIsExpandable)&&(this._inputIsExpanded?this.expand():this._inputIsExpanded===!1&&this.collapse())}get isExpanded(){return this._tree.isExpanded(this._data)}set isExpanded(e){this._inputIsExpanded=e,e?this.expand():this.collapse()}isDisabled=!1;typeaheadLabel=null;getLabel(){return this.typeaheadLabel||this._elementRef.nativeElement.textContent?.trim()||""}activation=new ve;expandedChange=new ve;static mostRecentTreeNode=null;_destroyed=new He;_dataChanges=new He;_inputIsExpandable=!1;_inputIsExpanded=void 0;_shouldFocus=!0;_parentNodeAriaLevel;get data(){return this._data}set data(e){e!==this._data&&(this._data=e,this._dataChanges.next())}_data;get isLeafNode(){return this._tree.treeControl?.isExpandable!==void 0&&!this._tree.treeControl.isExpandable(this._data)?!0:this._tree.treeControl?.isExpandable===void 0&&this._tree.treeControl?.getDescendants(this._data).length===0}get level(){return this._tree._getLevel(this._data)??this._parentNodeAriaLevel}_isExpandable(){return this._tree.treeControl?!this.isLeafNode:this._inputIsExpandable}_getAriaExpanded(){return this._isExpandable()?String(this.isExpanded):null}_getSetSize(){return this._tree._getSetSize(this._data)}_getPositionInSet(){return this._tree._getPositionInSet(this._data)}_changeDetectorRef=f(Q);constructor(){n.mostRecentTreeNode=this}ngOnInit(){this._parentNodeAriaLevel=zAe(this._elementRef.nativeElement),this._tree._getExpansionModel().changed.pipe(Lt(()=>this.isExpanded),gp(),tt(this._destroyed)).pipe(tt(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._tree._setNodeTypeIfUnset(this._type),this._tree._registerNode(this)}ngOnDestroy(){n.mostRecentTreeNode===this&&(n.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}getParent(){return this._tree._getNodeParent(this)??null}getChildren(){return this._tree._getNodeChildren(this)}focus(){this._tabindex=0,this._shouldFocus&&this._elementRef.nativeElement.focus(),this._changeDetectorRef.markForCheck()}unfocus(){this._tabindex=-1,this._changeDetectorRef.markForCheck()}activate(){this.isDisabled||this.activation.next(this._data)}collapse(){this.isExpandable&&this._tree.collapse(this._data)}expand(){this.isExpandable&&this._tree.expand(this._data)}makeFocusable(){this._tabindex=0,this._changeDetectorRef.markForCheck()}_focusItem(){this.isDisabled||this._tree._keyManager.focusItem(this)}_setActiveItem(){this.isDisabled||(this._shouldFocus=!1,this._tree._keyManager.focusItem(this),this._shouldFocus=!0)}_emitExpansionState(e){this.expandedChange.emit(e)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["cdk-tree-node"]],hostAttrs:["role","treeitem",1,"cdk-tree-node"],hostVars:5,hostBindings:function(t,o){t&1&&g("click",function(){return o._setActiveItem()})("focus",function(){return o._focusItem()}),t&2&&(Wo("tabIndex",o._tabindex),qt("aria-expanded",o._getAriaExpanded())("aria-level",o.level+1)("aria-posinset",o._getPositionInSet())("aria-setsize",o._getSetSize()))},inputs:{role:"role",isExpandable:[2,"isExpandable","isExpandable",Ct],isExpanded:"isExpanded",isDisabled:[2,"isDisabled","isDisabled",Ct],typeaheadLabel:[0,"cdkTreeNodeTypeaheadLabel","typeaheadLabel"]},outputs:{activation:"activation",expandedChange:"expandedChange"},exportAs:["cdkTreeNode"]})}return n})();function zAe(n){let i=n.parentElement;for(;i&&!jAe(i);)i=i.parentElement;return i?i.classList.contains("cdk-nested-tree-node")?No(i.getAttribute("aria-level")):0:-1}function jAe(n){let i=n.classList;return!!(i?.contains("cdk-nested-tree-node")||i?.contains("cdk-tree"))}var mO=(()=>{class n extends Eg{_type="nested";_differs=f(ld);_dataDiffer;_children;nodeOutlet;constructor(){super()}ngAfterContentInit(){this._dataDiffer=this._differs.find([]).create(this._tree.trackBy),this._tree._getDirectChildren(this.data).pipe(tt(this._destroyed)).subscribe(e=>this.updateChildrenNodes(e)),this.nodeOutlet.changes.pipe(tt(this._destroyed)).subscribe(()=>this.updateChildrenNodes())}ngOnDestroy(){this._clear(),super.ngOnDestroy()}updateChildrenNodes(e){let t=this._getNodeOutlet();if(e&&(this._children=e),t&&this._children){let o=t.viewContainer;this._tree.renderNodeChanges(this._children,this._dataDiffer,o,this._data)}else this._dataDiffer.diff([])}_clear(){let e=this._getNodeOutlet();e&&(e.viewContainer.clear(),this._dataDiffer.diff([]))}_getNodeOutlet(){let e=this.nodeOutlet;return e&&e.find(t=>!t._node||t._node===this)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["cdk-nested-tree-node"]],contentQueries:function(t,o,r){if(t&1&&Ki(r,Tg,5),t&2){let a;mt(a=pt())&&(o.nodeOutlet=a)}},hostAttrs:[1,"cdk-nested-tree-node"],exportAs:["cdkNestedTreeNode"],features:[fn([{provide:Eg,useExisting:n},{provide:dO,useExisting:n}]),si]})}return n})();var pO=(()=>{class n{_tree=f(Wv);_treeNode=f(Eg);recursive=!1;constructor(){}_toggle(){this.recursive?this._tree.toggleDescendants(this._treeNode.data):this._tree.toggle(this._treeNode.data),this._tree._keyManager.focusItem(this._treeNode)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ft({type:n,selectors:[["","cdkTreeNodeToggle",""]],hostAttrs:["tabindex","-1"],hostBindings:function(t,o){t&1&&g("click",function(a){return o._toggle(),a.stopPropagation()})("keydown.Enter",function(a){return o._toggle(),a.preventDefault()})("keydown.Space",function(a){return o._toggle(),a.preventDefault()})},inputs:{recursive:[2,"cdkTreeNodeToggleRecursive","recursive",Ct]}})}return n})();var Dg=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({})}return n})();var BM=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[Dg,hi]})}return n})();var Pg=(function(n){return n.group="group",n.user="user",n})(Pg||{});var El=(()=>{class n{httpController;projectService;constructor(e,t){this.httpController=e,this.projectService=t}getAll(e){return this.httpController.get(e,"/pools")}get(e,t){return qi([this.httpController.get(e,`/pools/${t}`),this.httpController.get(e,`/pools/${t}/resources`)]).pipe(Lt(o=>(o[0].resources=o[1],o[0])))}delete(e,t){return this.httpController.delete(e,`/pools/${t}`)}add(e,t){return this.httpController.post(e,"/pools",{name:t})}update(e,t){return this.httpController.put(e,`/pools/${t.resource_pool_id}`,{name:t.name})}addResource(e,t,o){return this.httpController.put(e,`/pools/${t.resource_pool_id}/resources/${o.project_id}`,{})}deleteResource(e,t,o){return this.httpController.delete(e,`/pools/${o.resource_pool_id}/resources/${t.resource_id}`)}getFreeResources(e){return this.projectService.list(e).pipe(Un(t=>this.getAllNonFreeResources(e).pipe(Lt(o=>o.map(r=>r.resource_id)),Lt(o=>t.filter(r=>!o.includes(r.project_id))))))}getAllNonFreeResources(e){return this.getAll(e).pipe(Un(t=>qi(t.map(o=>this.httpController.get(e,`/pools/${o.resource_pool_id}/resources`)))),Lt(t=>{let o=[];for(let r of t)for(let a of r)o.push(a);return o}))}static \u0275fac=function(t){return new(t||n)(ge(mn),ge(ki))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var zM=class{endpoints;constructor(i){this.endpoints=i}buildTreeFromEndpoints(){let i=[],e=[];return this.endpoints.forEach(t=>{let o=this.extractParent(t);e.push(o)}),e.forEach(t=>{t.depth>0&&e.filter(r=>r.splitEndp.join("/")==t.splitEndp.slice(0,t.depth-1).join("/"))[0].children.push(t)}),i.push(e.find(t=>t.depth===0)),i}extractParent(i){let e=i.endpoint.split("/");e=e.filter(r=>r!==""&&r!=="access");let t=[];return e.length>0&&(t=e.slice(0,e.length-1)),{children:[],depth:e.length,splitEndp:e,endpoint:i.endpoint,endpoint_type:i.endpoint_type,name:i.name,parent:t}}};var UAe=["userTrigger"],GAe=["groupTrigger"],WAe=["roleTrigger"],qAe=(n,i)=>i.role_id,QAe=(n,i)=>i.resource_pool_id,XAe=(n,i)=>i.user_id,KAe=(n,i)=>i.name;function YAe(n,i){if(n&1){let e=z();s(0,"cdk-nested-tree-node",31)(1,"div"),R(2,"button",32),d(3),s(4,"button",33),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.endpointSelection(o))}),s(5,"mat-icon"),d(6),l()()()()}if(n&2){let e=i.$implicit,t=v(2);m(),Be("selected",t.selectedEndpoint&&e.endpoint===t.selectedEndpoint.endpoint),m(2),ee(" ",e.name," "),m(3),j(t.selectedEndpoint&&e.endpoint===t.selectedEndpoint.endpoint?"check_circle":"panorama_fish_eye")}}function ZAe(n,i){if(n&1){let e=z();s(0,"cdk-nested-tree-node",31)(1,"div")(2,"button",34)(3,"mat-icon",35),d(4),l()(),d(5),s(6,"button",33),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.endpointSelection(o))}),s(7,"mat-icon"),d(8),l()()(),s(9,"div"),ro(10,36),l()()}if(n&2){let e=i.$implicit,t=v(2);m(),Be("selected",t.selectedEndpoint&&e.endpoint===t.selectedEndpoint.endpoint),m(),qt("aria-label","Toggle "+e.name),m(2),ee(" ",t.treeControl.isExpanded(e)?"expand_more":"chevron_right"," "),m(),ee(" ",e.name," "),m(3),j(t.selectedEndpoint&&e.endpoint===t.selectedEndpoint.endpoint?"check_circle":"panorama_fish_eye"),m(),Be("example-tree-invisible",!t.treeControl.isExpanded(e))}}function JAe(n,i){if(n&1&&(s(0,"cdk-tree",12),xe(1,YAe,7,4,"cdk-nested-tree-node",29)(2,ZAe,11,8,"cdk-nested-tree-node",30),l()),n&2){let e=v();C("dataSource",e.treeDataSource)("treeControl",e.treeControl),m(2),C("cdkTreeNodeDefWhen",e.hasChild)}}function eOe(n,i){n&1&&(s(0,"mat-icon",41),d(1,"check_circle"),l())}function tOe(n,i){n&1&&(s(0,"mat-icon",42),d(1,"panorama_fish_eye"),l())}function nOe(n,i){if(n&1){let e=z();s(0,"div",38),g("click",function(){let o=k(e).$implicit,r=v(2);return T(r.resourcePoolSelection(o))}),s(1,"mat-icon",39),d(2,"folder"),l(),s(3,"span",40),d(4),l(),A(5,eOe,2,0,"mat-icon",41)(6,tOe,2,0,"mat-icon",42),l()}if(n&2){let e=i.$implicit,t=v(2);Be("selected",t.selectedResourcePool&&t.selectedResourcePool.resource_pool_id===e.resource_pool_id),m(4),j(e.name),m(),O(t.selectedResourcePool&&t.selectedResourcePool.resource_pool_id===e.resource_pool_id?5:6)}}function iOe(n,i){if(n&1&&(s(0,"div",13),Y(1,nOe,7,4,"div",37,QAe),l()),n&2){let e=v();m(),Z(e.resourcePools)}}function oOe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e.charAt(0).toUpperCase()+e.slice(1))}}function rOe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ui(" ",e.username,"",e.full_name?" - "+e.full_name:""," ")}}function aOe(n,i){if(n&1){let e=z();s(0,"mat-form-field")(1,"mat-label"),d(2,"User"),l(),s(3,"input",18,2),g("click",function(){k(e);let o=v();return T(o.openUserPanel())}),l(),s(5,"mat-autocomplete",19,3),g("optionSelected",function(o){k(e);let r=v();return T(r.userSelection(o.option.value))}),Y(7,rOe,2,3,"mat-option",17,XAe),en(9,"async"),l()()}if(n&2){let e=Pe(6),t=v();m(3),C("matAutocomplete",e)("formControl",t.userAutocompleteControl),m(2),C("displayWith",t.displayFnUser),m(2),Z(jn(9,3,t.filteredUsers))}}function sOe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e.name)}}function lOe(n,i){if(n&1){let e=z();s(0,"mat-form-field")(1,"mat-label"),d(2,"Group"),l(),s(3,"input",18,4),g("click",function(){k(e);let o=v();return T(o.openGroupPanel())}),l(),s(5,"mat-autocomplete",19,5),g("optionSelected",function(o){k(e);let r=v();return T(r.groupSelection(o.option.value))}),Y(7,sOe,2,2,"mat-option",17,KAe),en(9,"async"),l()()}if(n&2){let e=Pe(6),t=v();m(3),C("matAutocomplete",e)("formControl",t.groupAutocompleteControl),m(2),C("displayWith",t.displayFn),m(2),Z(jn(9,3,t.filteredGroups))}}function cOe(n,i){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),j(e.name)}}var jM=(()=>{class n{data;dialogRef=f(Ie);aclService=f(fp);userService=f(Er);groupService=f(kl);roleService=f(Tl);resourcePoolsService=f(El);toasterService=f(te);cd=f(Q);controller;addAceForm;allowed=!0;types=Object.values(Pg);resourcePools=[];selectedResourcePool;showResourcePools=!1;userAutoTrigger;groupAutoTrigger;roleAutoTrigger;endpoints;selectedEndpoint;filteredEndpoint=[];endpointTypes;userAutocompleteControl=new Ye;groupAutocompleteControl=new Ye;roleAutocompleteControl=new Ye;filteredUsers;filteredGroups;filteredRoles;groups=[];selectedGroup;users=[];selectedUser;roles=[];selectedRole;TREE_DATA=[];treeControl=new LM(e=>e.children);treeDataSource;constructor(e){this.data=e,this.endpoints=e.endpoints;let o=new zM(this.endpoints).buildTreeFromEndpoints();this.treeDataSource=new qO(o),console.log(o)}ngOnInit(){this.addAceForm=new gr({type:new Ye(Pg.user),role_id:new Ye,propagate:new Ye(!0)}),this.addAceForm.get("type").valueChanges.subscribe(()=>{this.selectedUser=null,this.selectedGroup=null,this.userAutocompleteControl.reset(),this.groupAutocompleteControl.reset()}),this.resourcePoolsService.getAll(this.controller).subscribe({next:e=>{this.resourcePools=e,this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load resource pools";this.toasterService.error(t),this.cd.markForCheck()}}),this.groupService.getGroups(this.controller).subscribe({next:e=>{this.groups=e,this.filteredGroups=this.groupAutocompleteControl.valueChanges.pipe(pi(""),Lt(t=>this._filter(t,e))),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load groups";this.toasterService.error(t),this.cd.markForCheck()}}),this.userService.list(this.controller).subscribe({next:e=>{this.users=e,this.filteredUsers=this.userAutocompleteControl.valueChanges.pipe(pi(""),Lt(t=>this._filterUser(t,e))),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load users";this.toasterService.error(t),this.cd.markForCheck()}}),this.roleService.get(this.controller).subscribe({next:e=>{this.roles=e,this.filteredRoles=this.roleAutocompleteControl.valueChanges.pipe(pi(""),Lt(t=>this._filterRole(t,e))),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load roles";this.toasterService.error(t),this.cd.markForCheck()}})}get form(){return this.addAceForm.controls}onCancelClick(){this.dialogRef.close()}onAddClick(){if(!this.selectedEndpoint&&!this.selectedResourcePool){this.toasterService.error("Please select an endpoint or a resource pool");return}if(!this.selectedRole){this.toasterService.error("Please select a role");return}if(!this.selectedUser&&!this.selectedGroup){this.toasterService.error("Please select a user or group");return}let e={ace_type:this.form.type.value,allowed:this.allowed,group_id:this.form.type.value===Pg.group?this.selectedGroup.user_group_id:null,path:this.selectedEndpoint?this.selectedEndpoint.endpoint:`/pools/${this.selectedResourcePool.resource_pool_id}`,propagate:this.form.propagate.value,role_id:this.selectedRole.role_id,user_id:this.form.type.value===Pg.user?this.selectedUser.user_id:null};e.path&&e.role_id&&(e.user_id||e.group_id)&&(this.aclService.add(this.controller,e).subscribe({next:t=>{this.toasterService.success(`ACE was added for path ${e.path}`)},error:t=>{let o=t.error?.message||t.message||"Failed to create ACE";this.toasterService.error(o),this.cd.markForCheck()}}),this.dialogRef.close())}changeAllowed(){this.allowed=!this.allowed}displayFn(e){return e&&e.name?e.name:""}displayFnUser(e){return!e||!e.username?"":e.full_name?e.username.concat(" - ",e.full_name):e.username}_filter(e,t){let o=typeof e=="string"?e.toLowerCase():"";return t?t.filter(r=>r.name.toLowerCase().includes(o)):[]}_filterUser(e,t){let o=typeof e=="string"?e.toLowerCase():"";return t?t.filter(r=>(r.full_name?.toLowerCase().includes(o)??!1)||r.username.toLowerCase().includes(o)):[]}_filterRole(e,t){let o=typeof e=="string"?e.toLowerCase():"";return t?t.filter(r=>r.name.toLowerCase().includes(o)):[]}userSelection(e){this.selectedUser=e,this.userAutocompleteControl.setValue(e)}groupSelection(e){this.selectedGroup=e,this.groupAutocompleteControl.setValue(e)}roleSelection(e){this.selectedRole=e,this.roleAutocompleteControl.setValue(e)}openUserPanel(){this.userAutocompleteControl.setValue(""),this.userAutoTrigger&&this.userAutoTrigger.openPanel()}openGroupPanel(){this.groupAutocompleteControl.setValue(""),this.groupAutoTrigger&&this.groupAutoTrigger.openPanel()}openRolePanel(){this.roleAutocompleteControl.setValue(""),this.roleAutoTrigger&&this.roleAutoTrigger.openPanel()}endpointSelection(e){if(this.selectedEndpoint&&this.selectedEndpoint.endpoint===e.endpoint)this.selectedEndpoint=null;else{let t={endpoint:e.endpoint,endpoint_type:e.endpoint_type,name:e.name};this.selectedEndpoint=t,this.selectedResourcePool=null}}hasChild=(e,t)=>!!t.children&&t.children.length>0;toggleResourcePoolsView(){this.showResourcePools=!this.showResourcePools,this.showResourcePools?this.selectedEndpoint=null:this.selectedResourcePool=null}resourcePoolSelection(e){this.selectedResourcePool&&this.selectedResourcePool.resource_pool_id===e.resource_pool_id?this.selectedResourcePool=null:(this.selectedResourcePool=e,this.selectedEndpoint=null)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-add-ace-dialog"]],viewQuery:function(t,o){if(t&1&&xn(UAe,5,Ko)(GAe,5,Ko)(WAe,5,Ko),t&2){let r;mt(r=pt())&&(o.userAutoTrigger=r.first),mt(r=pt())&&(o.groupAutoTrigger=r.first),mt(r=pt())&&(o.roleAutoTrigger=r.first)}},decls:44,vars:21,consts:[["roleTrigger","matAutocompleteTrigger"],["roleAuto","matAutocomplete"],["userTrigger","matAutocompleteTrigger"],["userAuto","matAutocomplete"],["groupTrigger","matAutocompleteTrigger"],["groupAuto","matAutocomplete"],["mat-dialog-title",""],[1,"ace-form",3,"formGroup"],[1,"ace-form__tree-panel"],[1,"ace-form__toggle-buttons"],["mat-button","","matTooltip","All endpoints",3,"click"],["mat-button","","matTooltip","Resource pools",3,"click"],[3,"dataSource","treeControl"],[1,"ace-form__resource-pools"],[1,"ace-form__divider",3,"vertical"],[1,"ace-form__selection-panel"],["formControlName","type"],[3,"value"],["type","text","matInput","",3,"click","matAutocomplete","formControl"],[3,"optionSelected","displayWith"],[1,"ace-form__checkbox-row"],[1,"ace-form__checkbox-left"],["formControlName","propagate"],[1,"ace-form__divider-vertical",3,"vertical"],[1,"ace-form__checkbox-right"],["mat-button","",1,"ace-form__action-btn",3,"click"],["mat-dialog-actions","",1,"ace-form__actions"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click","disabled"],["class","ace-form__tree-node",4,"cdkTreeNodeDef"],["class","ace-form__tree-node",4,"cdkTreeNodeDef","cdkTreeNodeDefWhen"],[1,"ace-form__tree-node"],["mat-icon-button","","disabled",""],["mat-icon-button","",3,"click"],["mat-icon-button","","cdkTreeNodeToggle",""],[1,"mat-icon-rtl-mirror"],["cdkTreeNodeOutlet",""],[1,"ace-form__pool-item",3,"selected"],[1,"ace-form__pool-item",3,"click"],[1,"pool-icon"],[1,"pool-name"],[1,"check-icon"],[1,"select-icon"]],template:function(t,o){if(t&1&&(s(0,"h1",6),d(1,"Create new ACE"),l(),s(2,"form",7)(3,"div",8)(4,"div",9)(5,"button",10),g("click",function(){return o.showResourcePools=!1}),d(6," All Endpoints "),l(),s(7,"button",11),g("click",function(){return o.showResourcePools=!0}),d(8," Resource Pools "),l()(),A(9,JAe,3,3,"cdk-tree",12)(10,iOe,3,0,"div",13),l(),R(11,"mat-divider",14),s(12,"div",15)(13,"mat-form-field")(14,"mat-label"),d(15,"Type"),l(),s(16,"mat-select",16),Y(17,oOe,2,2,"mat-option",17,Ae),l()(),A(19,aOe,10,5,"mat-form-field"),A(20,lOe,10,5,"mat-form-field"),s(21,"mat-form-field")(22,"mat-label"),d(23,"Role"),l(),s(24,"input",18,0),g("click",function(){return o.openRolePanel()}),l(),s(26,"mat-autocomplete",19,1),g("optionSelected",function(a){return o.roleSelection(a.option.value)}),Y(28,cOe,2,2,"mat-option",17,qAe),en(30,"async"),l()(),s(31,"div",20)(32,"div",21)(33,"mat-checkbox",22),d(34,"Propagate"),l()(),R(35,"mat-divider",23),s(36,"div",24)(37,"button",25),g("click",function(){return o.changeAllowed()}),d(38),l()()(),s(39,"div",26)(40,"button",27),g("click",function(){return o.onCancelClick()}),d(41,"Cancel"),l(),s(42,"button",28),g("click",function(){return o.onAddClick()}),d(43," Add ACE "),l()()()()),t&2){let r=Pe(27);m(2),C("formGroup",o.addAceForm),m(3),Be("active",!o.showResourcePools),m(2),Be("active",o.showResourcePools),m(2),O(o.showResourcePools?10:9),m(2),C("vertical",!0),m(6),Z(o.types),m(2),O(o.form.type.value==="user"?19:-1),m(),O(o.form.type.value==="group"?20:-1),m(4),C("matAutocomplete",r)("formControl",o.roleAutocompleteControl),m(2),C("displayWith",o.displayFn),m(2),Z(jn(30,19,o.filteredRoles)),m(7),C("vertical",!0),m(2),Be("ace-form__action-btn--allow",o.allowed)("ace-form__action-btn--deny",!o.allowed),m(),ee(" ",o.allowed?"ALLOWED":"DENY"," "),m(4),C("disabled",!o.addAceForm.valid)}},dependencies:[ne,Dt,at,Ft,Pt,rt,Hs,Rt,zt,_e,Ne,Fe,W,pe,je,Ot,Gt,jr,ga,we,Me,et,ie,de,wt,It,Se,Ee,vt,At,_t,Yr,Sa,Ko,BM,Dg,mO,VM,pO,Wv,Tg,zr],styles:[".ace-form[_ngcontent-%COMP%]{display:flex;width:100%;padding:0 16px}.ace-form__tree-panel[_ngcontent-%COMP%]{flex:1;overflow-y:auto;min-width:0;max-height:400px;color:var(--mat-sys-on-surface);display:flex;flex-direction:column}.ace-form__toggle-buttons[_ngcontent-%COMP%]{display:flex;gap:8px;padding:8px;border-bottom:1px solid var(--mat-sys-outline-variant)}.ace-form__toggle-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{flex:1;font-size:13px;font-weight:500;opacity:.6;transition:opacity .2s}.ace-form__toggle-buttons[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{opacity:1;background-color:var(--mat-sys-secondary-container);color:var(--mat-sys-on-surface)}.ace-form__toggle-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{opacity:.8}.ace-form__resource-pools[_ngcontent-%COMP%]{padding:8px;overflow-y:auto;flex:1}.ace-form__pool-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;cursor:pointer;transition:background-color .2s}.ace-form__pool-item[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-hover-state-layer-color)}.ace-form__pool-item.selected[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)}.ace-form__pool-item[_ngcontent-%COMP%] .pool-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--mat-sys-primary)}.ace-form__pool-item[_ngcontent-%COMP%] .pool-name[_ngcontent-%COMP%]{flex:1;font-size:14px}.ace-form__pool-item[_ngcontent-%COMP%] .check-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--mat-sys-primary)}.ace-form__pool-item[_ngcontent-%COMP%] .select-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--mat-sys-outline)}.ace-form__divider[_ngcontent-%COMP%]{flex-shrink:0;margin:0 16px;height:auto;align-self:stretch}.ace-form__selection-panel[_ngcontent-%COMP%]{flex:0 0 280px;display:flex;flex-direction:column;gap:12px;overflow-x:hidden}.example-tree-invisible[_ngcontent-%COMP%]{display:none}.ace-form__tree-node[_ngcontent-%COMP%]{display:block}.ace-form__tree-node[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{line-height:32px}.ace-form__tree-node[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{vertical-align:middle}.ace-form__tree-node[_ngcontent-%COMP%] .ace-form__tree-node[_ngcontent-%COMP%]{padding-left:40px}.ace-form__tree-node[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%]{height:32px;width:32px;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.ace-form__tree-node[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.selected[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.ace-form__checkbox-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:8px}.ace-form__checkbox-left[_ngcontent-%COMP%]{flex:1}.ace-form__divider-vertical[_ngcontent-%COMP%]{height:auto;align-self:stretch}.ace-form__checkbox-right[_ngcontent-%COMP%]{flex:1;text-align:right}.ace-form__action-btn[_ngcontent-%COMP%]{min-width:80px}.ace-form__action-btn--allow[_ngcontent-%COMP%]{background-color:green;color:#fff}.ace-form__action-btn--deny[_ngcontent-%COMP%]{background-color:#8b0000;color:#fff}.ace-form__actions[_ngcontent-%COMP%]{margin-top:auto;padding-top:16px;display:flex;justify-content:flex-end;gap:8px}"],changeDetection:0})}return n})();var dOe=(n,i)=>i.path;function mOe(n,i){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.path)}}var qv=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}onCancel(){this.dialogRef.close()}onDelete(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-delete-ace-dialog"]],decls:10,vars:0,consts:[["mat-dialog-title",""],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following ACEs ?"),l(),s(2,"ul"),Y(3,mOe,2,1,"li",null,dOe),l(),s(5,"div",1)(6,"button",2),g("click",function(){return o.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),g("click",function(){return o.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Z(o.data.aces))},dependencies:[ne,_e,Ne,Fe,W,pe],encapsulation:2,changeDetection:0})}return n})();var Ej=(()=>{class n{transform(e,t,o){if(!e)return[];if(!t)return e;t=t.toLowerCase();let r=o.filter(a=>a.name.toLowerCase().includes(t));return e.data.filter(a=>{let c=this.getEndpoint(a.user_id,o),p=this.getEndpoint(a.group_id,o),u=this.getEndpoint(a.path,o),h=this.getEndpoint(a.role_id,o);return r.some(_=>[c,p,u,h].includes(_.endpoint))})}getEndpoint(e,t){let o=t.filter(r=>r.endpoint.includes(e));return o.length>0?o[0].endpoint.toLowerCase():""}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"aceFilter",type:n,pure:!0})}return n})();var pOe=["acesPaginator"],uOe=["acesSort"],hOe=()=>[5,10,20];function fOe(n,i){if(n&1){let e=z();s(0,"th",28)(1,"mat-checkbox",29),g("change",function(o){k(e);let r=v(2);return T(o?r.masterToggle():null)}),l()()}if(n&2){let e=v(2);m(),C("checked",e.selection.hasValue()&&e.isAllSelected())("indeterminate",e.selection.hasValue()&&!e.isAllSelected())}}function gOe(n,i){if(n&1){let e=z();s(0,"td",30)(1,"mat-checkbox",31),g("click",function(o){return o.stopPropagation()})("change",function(o){let r=k(e).$implicit,a=v(2);return T(o?a.selection.toggle(r):null)}),l()()}if(n&2){let e=i.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function _Oe(n,i){n&1&&(s(0,"th",32),d(1,"Path"),l())}function vOe(n,i){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=i.$implicit,t=v(2);m(2),j(t.getNameByUuidFromEndpoint(e.path))}}function COe(n,i){n&1&&(s(0,"th",32),d(1,"User/Group"),l())}function bOe(n,i){if(n&1&&d(0),n&2){let e=v().$implicit,t=v(2);ee(" ",t.getNameByUuidFromEndpoint(e.user_id)," ")}}function xOe(n,i){if(n&1&&d(0),n&2){let e=v().$implicit,t=v(2);ee(" ",t.getNameByUuidFromEndpoint(e.group_id)," ")}}function yOe(n,i){if(n&1&&(s(0,"td",33)(1,"span",34),A(2,bOe,1,1)(3,xOe,1,1),l()()),n&2){let e=i.$implicit;m(2),O(e.ace_type==="user"?2:3)}}function SOe(n,i){n&1&&(s(0,"th",32),d(1,"Role"),l())}function wOe(n,i){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=i.$implicit,t=v(2);m(2),j(t.getNameByUuidFromEndpoint(e.role_id))}}function MOe(n,i){n&1&&(s(0,"th",32),d(1,"Propagate"),l())}function kOe(n,i){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=i.$implicit;m(),j(e.propagate)}}function TOe(n,i){n&1&&(s(0,"th",32),d(1,"Allowed"),l())}function EOe(n,i){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=i.$implicit;m(),j(e.allowed)}}function DOe(n,i){n&1&&(s(0,"th",32),d(1,"Created"),l())}function POe(n,i){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.created_at)}}function IOe(n,i){n&1&&(s(0,"th",32),d(1,"Last update"),l())}function AOe(n,i){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=i.$implicit;m(2),j(e.updated_at)}}function OOe(n,i){n&1&&R(0,"tr",35)}function NOe(n,i){n&1&&R(0,"tr",36)}function FOe(n,i){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Access Control List (ACL)"),l(),s(3,"div",5)(4,"button",6),g("click",function(){k(e);let o=v();return T(o.deleteMultiple())}),d(5," Delete Selected "),l(),s(6,"button",7),g("click",function(){k(e);let o=v();return T(o.addACE())}),d(7,"Add ACE"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),g("input",function(o){k(e);let r=v();return T(r.searchText.set(o.target.value))}),l()()(),s(11,"div",11)(12,"table",12,0),en(14,"aceFilter"),Le(15,13),xe(16,fOe,2,2,"th",14)(17,gOe,2,1,"td",15),Ve(),Le(18,16),xe(19,_Oe,2,0,"th",17)(20,vOe,3,1,"td",18),Ve(),Le(21,19),xe(22,COe,2,0,"th",17)(23,yOe,4,1,"td",18),Ve(),Le(24,20),xe(25,SOe,2,0,"th",17)(26,wOe,3,1,"td",18),Ve(),Le(27,21),xe(28,MOe,2,0,"th",17)(29,kOe,2,1,"td",18),Ve(),Le(30,22),xe(31,TOe,2,0,"th",17)(32,EOe,2,1,"td",18),Ve(),Le(33,23),xe(34,DOe,2,0,"th",17)(35,POe,3,1,"td",18),Ve(),Le(36,24),xe(37,IOe,2,0,"th",17)(38,AOe,3,1,"td",18),Ve(),xe(39,OOe,1,0,"tr",25)(40,NOe,1,0,"tr",26),l(),R(41,"mat-paginator",27,1),l()}if(n&2){let e=v();m(4),C("disabled",e.selection.selected.length===0),m(6),C("value",e.searchText()),m(2),C("dataSource",PO(14,6,e.dataSource,e.searchText(),e.endpoints())),m(27),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Bt(10,hOe))}}function ROe(n,i){n&1&&(s(0,"div",2),R(1,"mat-spinner",37),l())}var $M=(()=>{class n{route=f(lt);controllerService=f(Je);toasterService=f(te);aclService=f(fp);resourcePoolsService=f(El);dialog=f(nt);cdr=f(Q);acesPaginator;acesSort;controller;displayedColumns=["select","path","user/group","role","propagate","allowed","updated_at"];selection=new Oa(!0,[]);aces;dataSource=new pr;isReady=ae(!1);searchText=U("");endpoints=ae([]);resourcePools=ae([]);constructor(){}ngOnInit(){let e=this.route.parent.snapshot.paramMap.get("controller_id");this.controllerService.get(+e).then(t=>{this.controller=t,this.aclService.getEndpoints(this.controller).subscribe({next:o=>{this.endpoints.set(o),this.refresh()},error:o=>{let r=o.error?.message||o.message||"Failed to load endpoints";this.toasterService.error(r),this.cdr.markForCheck()}}),this.resourcePoolsService.getAll(t).subscribe({next:o=>{this.resourcePools.set(o)},error:o=>{let r=o.error?.message||o.message||"Failed to load resource pools";this.toasterService.error(r),this.cdr.markForCheck()}})})}ngAfterViewInit(){this.acesPaginator.changes.subscribe(e=>{this.dataSource.paginator=e.first}),this.acesSort.changes.subscribe(e=>{this.dataSource.sort=e.first}),this.dataSource.sortingDataAccessor=(e,t)=>{switch(t){case"path":case"user/group":case"role":return e[t]?e[t].toLowerCase():"";default:return e[t]}}}refresh(){this.aclService.list(this.controller).subscribe({next:e=>{this.isReady.set(!0),this.aces=e,this.dataSource.data=e,this.selection.clear()},error:e=>{let t=e.error?.message||e.message||"Failed to load ACL list";this.toasterService.error(t),this.cdr.markForCheck()}})}addACE(){let e=this.dialog.open(jM,{panelClass:["base-dialog-panel","add-ace-dialog-panel"],autoFocus:!1,disableClose:!0,data:{endpoints:this.endpoints()}}),t=e.componentInstance;t.controller=this.controller,e.afterClosed().subscribe(()=>this.refresh())}onDelete(e){this.dialog.open(qv,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{aces:[e]}}).afterClosed().subscribe(t=>{t&&this.aclService.delete(this.controller,e.ace_id).subscribe({next:()=>{this.refresh()},error:o=>{let r=o.error?.message||o.message||"Failed to delete ACE";this.toasterService.error(r),this.cdr.markForCheck()}})})}isAllSelected(){let e=this.selection.selected.length,t=this.aces.length;return e===t}masterToggle(){this.isAllSelected()?this.selection.clear():this.aces.forEach(e=>this.selection.select(e))}deleteMultiple(){this.dialog.open(qv,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{aces:this.selection.selected}}).afterClosed().subscribe(e=>{e&&(this.selection.selected.forEach(t=>{this.aclService.delete(this.controller,t.ace_id).subscribe({next:()=>{this.refresh()},error:o=>{let r=o.error?.message||o.message||"Failed to delete ACE";this.toasterService.error(r),this.cdr.markForCheck()}})}),this.selection.clear())})}getNameByUuidFromEndpoint(e){let t=e.match(/^\/pools\/(.+)$/);if(t){let o=t[1],r=this.resourcePools().find(a=>a.resource_pool_id===o);return r?`Resource pool "${r.name}"`:`Resource pool (${o.slice(0,8)}...)`}if(this.endpoints()){let o=this.endpoints().filter(r=>r.endpoint.includes(e));if(o.length>=1)return o[0].name}return e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-acl-management"]],viewQuery:function(t,o){if(t&1&&xn(pOe,5)(uOe,5),t&2){let r;mt(r=pt())&&(o.acesPaginator=r),mt(r=pt())&&(o.acesSort=r)}},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:2,vars:1,consts:[["acesSort","matSort"],["acesPaginator","matPaginator"],[1,"acl-management__loader"],[1,"acl-management__header"],[1,"acl-management__title"],[1,"acl-management__actions"],["mat-raised-button","","color","primary",1,"acl-management__button",3,"click","disabled"],["mat-raised-button","","color","primary","matTooltip","Add access control entry",1,"acl-management__button",3,"click"],[1,"acl-management__search-form"],[1,"acl-management__search"],["matInput","","placeholder","Search by path, user/group or role",3,"input","value"],[1,"acl-management__table-container"],["mat-table","","matSort","",3,"dataSource"],["matColumnDef","select"],["mat-header-cell","","class","acl-management__small-col",4,"matHeaderCellDef"],["mat-cell","","class","acl-management__small-col",4,"matCellDef"],["matColumnDef","path"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","user/group"],["matColumnDef","role"],["matColumnDef","propagate"],["matColumnDef","allowed"],["matColumnDef","created_at"],["matColumnDef","updated_at"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","","aria-label","Select page",3,"pageSizeOptions"],["mat-header-cell","",1,"acl-management__small-col"],[3,"change","checked","indeterminate"],["mat-cell","",1,"acl-management__small-col"],[3,"click","change","checked"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"acl-management__overflow-text"],["mat-header-row",""],["mat-row",""],[1,"acl-management__spinner"]],template:function(t,o){t&1&&A(0,FOe,43,11)(1,ROe,2,0,"div",2),t&2&&O(o.isReady()?0:1)},dependencies:[ne,Xe,at,rt,Gn,dt,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,hr,ar,mo,Tr,Ot,Gt,W,pe,ie,wt,It,we,Me,Se,Ee,_e,Mt,Ej],styles:["[_nghost-%COMP%]{display:block;width:100%}.acl-management__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 0;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.acl-management__title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.acl-management__actions[_ngcontent-%COMP%]{display:flex;gap:12px}.acl-management__button[_ngcontent-%COMP%]{margin:12px 0;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1)}.acl-management__button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.acl-management__button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.acl-management__search-form[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:16px auto;width:100%;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.acl-management__search[_ngcontent-%COMP%]{width:100%;max-width:1000px}.acl-management__table-container[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;width:100%;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both}.acl-management__table-container--hidden[_ngcontent-%COMP%]{display:none}mat-row[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);cursor:default;position:relative}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent);transform:scale(1.002)}mat-row[_ngcontent-%COMP%]:nth-child(2n){background-color:color-mix(in srgb,var(--mat-sys-on-surface) 1%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n):hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent)}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.mat-header-row[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px;text-transform:uppercase}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}.acl-management__overflow-text[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding-right:5px}mat-cell[mat-column=actions][_ngcontent-%COMP%], mat-header-cell[mat-column=actions][_ngcontent-%COMP%]{justify-content:flex-end;padding:0 16px}mat-cell[mat-column=actions][_ngcontent-%COMP%]{overflow:visible}.acl-management__small-col[_ngcontent-%COMP%]{width:60px;min-width:60px}.acl-management__loader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:200px}.acl-management__spinner[_ngcontent-%COMP%]{width:48px;height:48px}mat-paginator[_ngcontent-%COMP%]{background:var(--mat-sys-surface);color:var(--mat-sys-on-surface)}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.acl-management__header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:16px;padding:16px 0}.acl-management__actions[_ngcontent-%COMP%]{width:100%;flex-direction:column}.acl-management__button[_ngcontent-%COMP%]{width:100%;height:44px;font-size:15px}.acl-management__actions-cell[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px}mat-cell[_ngcontent-%COMP%]{padding:0 12px;font-size:13px}}"],changeDetection:0})}return n})();var HM=(()=>{class n{get(e){return new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\":<>\?]/).test(e.value)?{invalidName:!0}:null}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Dj=(n,i)=>e=>Qa(500).pipe(Un(()=>i.getAll(n)),Lt(t=>t.find(o=>o.name===e.value)?{projectExist:!0}:null));function VOe(n,i){n&1&&(s(0,"mat-error"),d(1,"Resource pool name is required"),l())}function BOe(n,i){n&1&&(s(0,"mat-error"),d(1,"Resource pool name is incorrect"),l())}function zOe(n,i){n&1&&(s(0,"mat-error"),d(1,"Resource pool with this name exists"),l())}var UM=(()=>{class n{data;poolNameValidator;dialogRef=f(Ie);formBuilder=f(Vn);resourcePoolsService=f(El);toasterService=f(te);cd=f(Q);poolNameForm;controller;constructor(e,t){this.data=e,this.poolNameValidator=t}ngOnInit(){this.controller=this.data.controller,this.poolNameForm=this.formBuilder.group({poolName:new Ye(null,[Ue.required,this.poolNameValidator.get],[Dj(this.data.controller,this.resourcePoolsService)])}),this.cd.markForCheck()}onKeyDown(e){e.key==="Enter"&&this.onAddClick()}get form(){return this.poolNameForm.controls}onAddClick(){if(this.poolNameForm.invalid)return;let e=this.poolNameForm.controls.poolName.value;this.resourcePoolsService.add(this.controller,e).subscribe({next:t=>{this.dialogRef.close(!0)},error:t=>{let o=t.error?.message||t.message||"Failed to create resource pool";this.toasterService.error(o),this.cd.markForCheck()}})}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(ot(gt),ot(HM))};static \u0275cmp=F({type:n,selectors:[["app-add-resource-pool-dialog"]],features:[fn([HM])],decls:16,vars:4,consts:[["mat-dialog-title",""],[3,"formGroup"],["mat-dialog-content",""],["appearance","fill",1,"full-width-field"],["matInput","","type","text","formControlName","poolName","placeholder","Please enter a resource pool name",3,"keydown"],["mat-dialog-actions","","align","end"],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Create new resource pool"),l(),s(2,"form",1)(3,"div",2)(4,"mat-form-field",3)(5,"mat-label"),d(6,"Resource pool name"),l(),s(7,"input",4),g("keydown",function(a){return o.onKeyDown(a)}),l(),A(8,VOe,2,0,"mat-error"),A(9,BOe,2,0,"mat-error"),A(10,zOe,2,0,"mat-error"),l()(),s(11,"div",5)(12,"button",6),g("click",function(){return o.onNoClick()}),d(13,"Cancel"),l(),s(14,"button",7),g("click",function(){return o.onAddClick()}),d(15,"Add resource pool"),l()()()),t&2&&(m(2),C("formGroup",o.poolNameForm),m(6),O(o.form.poolName!=null&&o.form.poolName.touched&&(o.form.poolName!=null&&o.form.poolName.errors)&&(o.form.poolName!=null&&o.form.poolName.errors.required)?8:-1),m(),O(o.form.poolName!=null&&o.form.poolName.errors&&(o.form.poolName!=null&&o.form.poolName.errors.invalidName)?9:-1),m(),O(o.form.poolName!=null&&o.form.poolName.errors&&(o.form.poolName!=null&&o.form.poolName.errors.projectExist)?10:-1))},dependencies:[ne,Dt,at,Ft,Pt,rt,Rt,zt,_e,Ne,Fe,bt,we,Me,et,fi,Se,Ee,W,pe],styles:[".full-width-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var jOe=(n,i)=>i.name;function $Oe(n,i){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=i.$implicit;m(),j(e.name)}}var GM=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}onCancel(){this.dialogRef.close()}onDelete(){this.dialogRef.close(!0)}static \u0275fac=function(t){return new(t||n)(ot(gt))};static \u0275cmp=F({type:n,selectors:[["app-delete-resource-pool"]],decls:10,vars:0,consts:[["mat-dialog-title",""],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",1,"add-project-button",3,"click"]],template:function(t,o){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following pools?"),l(),s(2,"ul"),Y(3,$Oe,2,1,"li",null,jOe),l(),s(5,"div",1)(6,"button",2),g("click",function(){return o.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),g("click",function(){return o.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Z(o.data.pools))},dependencies:[ne,_e,Ne,Fe,W,pe],encapsulation:2,changeDetection:0})}return n})();var Pj=(()=>{class n{transform(e,t){return t&&(t=t.trim().toLowerCase(),e.filter=t),e}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ar({name:"resourcePoolsFilter",type:n,pure:!0})}return n})();var HOe=["resourcePoolsPaginator"],UOe=["resourcePoolsSort"],GOe=()=>[5,10,20],WOe=(n,i)=>["/controller",n,"management","pools",i];function qOe(n,i){if(n&1){let e=z();s(0,"th",24)(1,"mat-checkbox",25),g("change",function(o){k(e);let r=v(2);return T(o?r.masterToggle():null)}),l()()}if(n&2){let e=v(2);m(),C("checked",e.selection.hasValue()&&e.isAllSelected())("indeterminate",e.selection.hasValue()&&!e.isAllSelected())}}function QOe(n,i){if(n&1){let e=z();s(0,"td",26)(1,"mat-checkbox",27),g("click",function(o){return o.stopPropagation()})("change",function(o){let r=k(e).$implicit,a=v(2);return T(o?a.selection.toggle(r):null)}),l()()}if(n&2){let e=i.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function XOe(n,i){n&1&&(s(0,"th",28),d(1,"Name"),l())}function KOe(n,i){if(n&1&&(s(0,"td",29)(1,"a",30),d(2),l()()),n&2){let e=i.$implicit,t=v(2);m(),C("routerLink",zs(2,WOe,t.controller.id,e.resource_pool_id)),m(),ee(" ",e.name," ")}}function YOe(n,i){n&1&&(s(0,"th",28),d(1,"Creation date"),l())}function ZOe(n,i){if(n&1&&(s(0,"td",29),d(1),l()),n&2){let e=i.$implicit;m(),j(e.created_at)}}function JOe(n,i){n&1&&(s(0,"th",28),d(1,"Last update"),l())}function e4e(n,i){if(n&1&&(s(0,"td",29),d(1),l()),n&2){let e=i.$implicit;m(),j(e.updated_at)}}function t4e(n,i){n&1&&R(0,"tr",31)}function n4e(n,i){n&1&&R(0,"tr",32)}function i4e(n,i){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Resource pools"),l(),s(3,"div",5)(4,"button",6),g("click",function(){k(e);let o=v();return T(o.onDelete(o.selection.selected))}),d(5," Delete Selected "),l(),s(6,"button",7),g("click",function(){k(e);let o=v();return T(o.addResourcePool())}),d(7," Add Resource Pool "),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),g("input",function(o){k(e);let r=v();return T(r.searchText.set(o.target.value))}),l()()(),s(11,"div",11)(12,"table",12,0),en(14,"resourcePoolsFilter"),Le(15,13),xe(16,qOe,2,2,"th",14)(17,QOe,2,1,"td",15),Ve(),Le(18,16),xe(19,XOe,2,0,"th",17)(20,KOe,3,5,"td",18),Ve(),Le(21,19),xe(22,YOe,2,0,"th",17)(23,ZOe,2,1,"td",18),Ve(),Le(24,20),xe(25,JOe,2,0,"th",17)(26,e4e,2,1,"td",18),Ve(),xe(27,t4e,1,0,"tr",21)(28,n4e,1,0,"tr",22),l(),R(29,"mat-paginator",23,1),l()}if(n&2){let e=v();m(4),C("disabled",e.selection.selected.length===0),m(6),C("value",e.searchText()),m(2),C("dataSource",na(14,6,e.dataSource,e.searchText())),m(15),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Bt(9,GOe))}}function o4e(n,i){n&1&&(s(0,"div",2),R(1,"mat-spinner",33),l())}var WM=(()=>{class n{route=f(lt);controllerService=f(Je);toasterService=f(te);resourcePoolsService=f(El);dialog=f(nt);cd=f(Q);controller;resourcePoolsPaginator;resourcePoolsSort;displayedColumns=["select","name","created_at","updated_at"];selection=new Oa(!0,[]);resourcePools=ae([]);dataSource=new pr;searchText=U("");isReady=ae(!1);constructor(){}ngOnInit(){let e=this.route.parent.snapshot.paramMap.get("controller_id");this.controllerService.get(+e).then(t=>{this.controller=t,this.refresh()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}ngAfterViewInit(){this.resourcePoolsPaginator.changes.subscribe(e=>{this.dataSource.paginator=e.first}),this.resourcePoolsSort.changes.subscribe(e=>{this.dataSource.sort=e.first}),this.dataSource.sortingDataAccessor=(e,t)=>t==="name"?e[t]?e[t].toLowerCase():"":e[t]}isAllSelected(){let e=this.selection.selected.length,t=this.resourcePools().length;return e===t}masterToggle(){this.isAllSelected()?this.selection.clear():this.resourcePools().forEach(e=>this.selection.select(e))}addResourcePool(){this.dialog.open(UM,{width:"400px",autoFocus:!1,disableClose:!0,data:{controller:this.controller}}).afterClosed().subscribe(e=>{e&&this.refresh()})}refresh(){this.resourcePoolsService.getAll(this.controller).subscribe({next:e=>{this.isReady.set(!0),this.resourcePools.set(e),this.dataSource.data=e,this.selection.clear()},error:e=>{let t=e.error?.message||e.message||"Failed to load resource pools";this.toasterService.error(t),this.cd.markForCheck()}})}onDelete(e){this.dialog.open(GM,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{pools:e}}).afterClosed().subscribe(t=>{if(t){let o=e.map(r=>this.resourcePoolsService.delete(this.controller,r.resource_pool_id));qi(o).subscribe({next:()=>{this.refresh()},error:r=>{let a=r.error?.message||r.message||"Failed to delete resource pool";this.toasterService.error(a),this.cd.markForCheck()}})}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-resource-pools-management"]],viewQuery:function(t,o){if(t&1&&xn(HOe,5)(UOe,5),t&2){let r;mt(r=pt())&&(o.resourcePoolsPaginator=r),mt(r=pt())&&(o.resourcePoolsSort=r)}},inputs:{searchText:[1,"searchText"]},outputs:{searchText:"searchTextChange"},decls:2,vars:1,consts:[["resourcePoolsSort","matSort"],["resourcePoolsPaginator","matPaginator"],[1,"resource-pools-management__loader"],[1,"resource-pools-management__header"],[1,"resource-pools-management__title"],[1,"resource-pools-management__actions"],["mat-raised-button","","color","primary",1,"resource-pools-management__button",3,"click","disabled"],["mat-raised-button","","color","primary",1,"resource-pools-management__button",3,"click"],[1,"resource-pools-management__search-form"],[1,"resource-pools-management__search"],["matInput","","placeholder","Search resource pool by name",3,"input","value"],[1,"resource-pools-management__table-container"],["mat-table","","matSort","",3,"dataSource"],["matColumnDef","select"],["mat-header-cell","","class","resource-pools-management__small-col",4,"matHeaderCellDef"],["mat-cell","","class","resource-pools-management__small-col",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","created_at"],["matColumnDef","updated_at"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","","aria-label","Select page",3,"pageSizeOptions"],["mat-header-cell","",1,"resource-pools-management__small-col"],[3,"change","checked","indeterminate"],["mat-cell","",1,"resource-pools-management__small-col"],[3,"click","change","checked"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"resource-pools-management__link",3,"routerLink"],["mat-header-row",""],["mat-row",""],[1,"resource-pools-management__spinner"]],template:function(t,o){t&1&&A(0,i4e,31,10)(1,o4e,2,0,"div",2),t&2&&O(o.isReady()?0:1)},dependencies:[ne,Xe,at,rt,Gn,dt,vn,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,hr,ar,mo,Tr,Ot,Gt,W,pe,ie,we,Me,Se,Ee,_e,pn,li,Pj],styles:['[_nghost-%COMP%]{display:block;width:100%}.resource-pools-management__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 0;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.resource-pools-management__title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.resource-pools-management__actions[_ngcontent-%COMP%]{display:flex;gap:12px}.resource-pools-management__button[_ngcontent-%COMP%]{margin:12px 0;height:48px;border-radius:12px;font-size:16px;font-weight:500;text-transform:none;letter-spacing:.5px;transition:all .2s cubic-bezier(.4,0,.2,1)}.resource-pools-management__button[_ngcontent-%COMP%]:hover:not([disabled]){transform:translateY(-2px);box-shadow:0 4px 12px color-mix(in srgb,var(--mat-sys-primary) 30%,transparent)}.resource-pools-management__button[_ngcontent-%COMP%]:active:not([disabled]){transform:translateY(0)}.resource-pools-management__search-form[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:16px auto;width:100%;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .05s both}.resource-pools-management__search[_ngcontent-%COMP%]{width:100%;max-width:1000px}.resource-pools-management__table-container[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;width:100%;background:var(--mat-sys-surface);box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent);transition:box-shadow .3s cubic-bezier(.4,0,.2,1);animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .15s both}.resource-pools-management__table-container--hidden[_ngcontent-%COMP%]{display:none}mat-row[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);cursor:default;position:relative}mat-row[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 3%,transparent);transform:scale(1.002)}mat-row[_ngcontent-%COMP%]:nth-child(2n){background-color:color-mix(in srgb,var(--mat-sys-on-surface) 1%,transparent)}mat-row[_ngcontent-%COMP%]:nth-child(2n):hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 4%,transparent)}.mat-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:var(--mat-sys-surface)}.mat-header-row[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--mat-sys-on-surface-variant);letter-spacing:.5px;text-transform:uppercase}mat-header-cell[_ngcontent-%COMP%], mat-cell[_ngcontent-%COMP%]{justify-content:center;padding:0 16px}mat-cell[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface)}mat-cell[mat-column=name][_ngcontent-%COMP%]{justify-content:flex-start;font-weight:500}.resource-pools-management__link[_ngcontent-%COMP%]{transition:all .2s cubic-bezier(.4,0,.2,1);display:inline-block;transform-origin:left center;color:var(--mat-sys-primary);text-decoration:none;font-weight:500;position:relative}.resource-pools-management__link[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:-2px;left:0;width:0;height:2px;background-color:currentColor;transition:width .2s cubic-bezier(.4,0,.2,1)}.resource-pools-management__link[_ngcontent-%COMP%]:hover{color:color-mix(in srgb,var(--mat-sys-primary) 80%,black);transform:translateY(-2px)}.resource-pools-management__link[_ngcontent-%COMP%]:hover:after{width:100%}.resource-pools-management__overflow-text[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding-right:5px}mat-cell[mat-column=actions][_ngcontent-%COMP%], mat-header-cell[mat-column=actions][_ngcontent-%COMP%]{justify-content:flex-end;padding:0 16px}mat-cell[mat-column=actions][_ngcontent-%COMP%]{overflow:visible}.resource-pools-management__small-col[_ngcontent-%COMP%]{width:60px;min-width:60px}.resource-pools-management__loader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:200px}.resource-pools-management__spinner[_ngcontent-%COMP%]{width:48px;height:48px}mat-paginator[_ngcontent-%COMP%]{background:var(--mat-sys-surface);color:var(--mat-sys-on-surface)}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.resource-pools-management__header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:16px;padding:16px 0}.resource-pools-management__actions[_ngcontent-%COMP%]{width:100%;flex-direction:column}.resource-pools-management__button[_ngcontent-%COMP%]{width:100%;height:44px;font-size:15px}.resource-pools-management__actions-cell[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px}mat-cell[_ngcontent-%COMP%]{padding:0 12px;font-size:13px}}'],changeDetection:0})}return n})();var qM=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}static \u0275fac=function(t){return new(t||n)(ot(M4))};static \u0275cmp=F({type:n,selectors:[["app-delete-resource-confirmation-dialog"]],decls:7,vars:2,consts:[["mat-dialog-title",""],["mat-dialog-actions",""],["mat-button","",3,"click"],["mat-button","","mat-raised-button","","color","primary",3,"click"]],template:function(t,o){t&1&&(s(0,"h2",0),d(1),l(),s(2,"div",1)(3,"button",2),g("click",function(){return o.dialogRef.close()}),d(4,"No, cancel"),l(),s(5,"button",3),g("click",function(){return o.dialogRef.close(o.data)}),d(6,"Yes, delete!"),l()()),t&2&&(m(),ui("Delete resource ",o.data.resource_type,"/",o.data.name,"?"))},dependencies:[ne,_e,Ne,Fe,W,pe],encapsulation:2,changeDetection:0})}return n})();var r4e=n=>["/controller",n,"management","pools"],a4e=(n,i)=>i.name;function s4e(n,i){if(n&1&&(s(0,"mat-option",24),d(1),l()),n&2){let e=i.$implicit;C("value",e),m(),ee(" ",e," ")}}function l4e(n,i){if(n&1){let e=z();s(0,"div",27)(1,"span",29),d(2),l(),s(3,"div",30)(4,"button",31),g("click",function(){let o=k(e).$implicit,r=v();return T(r.deleteResource(o))}),s(5,"mat-icon"),d(6,"delete"),l()()()()}if(n&2){let e=i.$implicit;m(2),j(e.name)}}function c4e(n,i){n&1&&(s(0,"div",28)(1,"mat-icon"),d(2,"folder_open"),l(),s(3,"span"),d(4,"No resources in this pool"),l()())}var QM=(()=>{class n{toastService=f(te);route=f(lt);resourcePoolsService=f(El);dialog=f(nt);cd=f(Q);controller;pool=ae(void 0);addResourceFormControl=new cc("");addResourceFilteredOptions;projects=ae([]);editPoolForm=new vC({poolname:new cc("")});ngOnInit(){this.route.data.subscribe(e=>{this.controller=e.controller,this.pool.set(e.pool),this.editPoolForm.patchValue({poolname:e.pool.name}),this.refresh()})}onUpdate(){let e=this.editPoolForm.get("poolname")?.value;e&&this.pool()&&(this.pool.update(t=>t&&it(K({},t),{name:e})),this.resourcePoolsService.update(this.controller,this.pool()).subscribe({next:t=>{this.toastService.success(`Pool ${t.name} updated`)},error:t=>{let o=t.error?.message||t.message||"Failed to update pool";this.toastService.error(o),this.cd.markForCheck()}}))}addResource(){let e=this.addResourceFormControl.value,t=this.projects().filter(o=>o.name.includes(e));if(t.length===1){this.resourcePoolsService.addResource(this.controller,this.pool(),t[0]).subscribe({next:()=>{this.toastService.success(`Project ${t[0].name} added to pool: ${this.pool().name}`),this.refresh(),this.addResourceFormControl.setValue("")},error:o=>{let r=o.error?.message||o.message||"Failed to add resource to pool";this.toastService.error(r),this.cd.markForCheck()}});return}if(t.length===0){this.toastService.error(`Cannot find related project with string: ${e}`);return}t.length>1&&this.toastService.error(`${t.length} matches for ${e}, please be more accurate`)}deleteResource(e){this.dialog.open(qM,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:e}).afterClosed().subscribe(t=>{t&&this.resourcePoolsService.deleteResource(this.controller,t,this.pool()).subscribe({next:()=>{this.refresh(),this.toastService.success(`Resource ${t.name} deleted from pool ${this.pool().name}`)},error:o=>{let r=o.error?.message||o.message||"Failed to delete resource from pool";this.toastService.error(r),this.cd.markForCheck()}})})}refresh(){this.resourcePoolsService.get(this.controller,this.pool().resource_pool_id).subscribe({next:e=>{this.pool.set(e)},error:e=>{let t=e.error?.message||e.message||"Failed to load pool";this.toastService.error(t),this.cd.markForCheck()}}),this.resourcePoolsService.getFreeResources(this.controller).subscribe({next:e=>{this.projects.set(e),this.addResourceFilteredOptions=this.addResourceFormControl.valueChanges.pipe(pi(""),Lt(t=>this.projects().filter(o=>o.name.toLowerCase().includes(t?.toLowerCase()||"")).map(o=>o.name)))},error:e=>{let t=e.error?.message||e.message||"Failed to load free resources";this.toastService.error(t),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-resource-pool-details"]],decls:54,vars:20,consts:[["auto","matAutocomplete"],[1,"resource-pool-details"],[1,"resource-pool-details__header"],[1,"resource-pool-details__header-content"],["mat-icon-button","","matTooltip","Back to resource pools management",1,"resource-pool-details__back-btn",3,"routerLink"],[1,"resource-pool-details__title"],[1,"resource-pool-details__content"],[1,"resource-pool-details__details"],[3,"ngSubmit","formGroup"],[1,"resource-pool-details__form-field"],["matInput","","type","text","formControlName","poolname"],[1,"resource-pool-details__info-grid"],[1,"resource-pool-details__info-label"],[1,"resource-pool-details__info-value"],[1,"resource-pool-details__info-value","resource-pool-details__info-value--mono"],[1,"resource-pool-details__actions"],["mat-raised-button","","color","primary","type","submit"],[1,"resource-pool-details__divider",3,"vertical"],[1,"resource-pool-details__resources"],[1,"resource-pool-details__resources-title"],[1,"resource-pool-details__add-form"],["appearance","outline",1,"resource-pool-details__add-input"],["matInput","","type","text","placeholder","Search project...",3,"formControl","matAutocomplete"],["autoActiveFirstOption",""],[3,"value"],["mat-icon-button","","color","primary","matTooltip","Add project",1,"resource-pool-details__add-button",3,"click"],[1,"resource-pool-details__list"],[1,"resource-pool-details__item"],[1,"resource-pool-details__empty"],[1,"resource-pool-details__item-name"],[1,"resource-pool-details__item-actions"],["mat-icon-button","","color","warn","matTooltip","Delete resource",3,"click"]],template:function(t,o){if(t&1&&(s(0,"div",1)(1,"div",2)(2,"div",3)(3,"a",4)(4,"mat-icon"),d(5,"keyboard_arrow_left"),l()(),s(6,"h1",5),d(7),l()()(),s(8,"div",6)(9,"div",7)(10,"form",8),g("ngSubmit",function(){return o.onUpdate()}),s(11,"mat-form-field",9)(12,"mat-label"),d(13,"Resource pool name"),l(),R(14,"input",10),l(),s(15,"div",11)(16,"span",12),d(17,"Creation date:"),l(),s(18,"span",13),d(19),en(20,"date"),l(),s(21,"span",12),d(22,"Last update:"),l(),s(23,"span",13),d(24),en(25,"date"),l(),s(26,"span",12),d(27,"UUID:"),l(),s(28,"span",14),d(29),l()(),s(30,"div",15)(31,"button",16),d(32,"Update resource pool"),l()()()(),R(33,"mat-divider",17),s(34,"div",18)(35,"h3",19),d(36,"Resources"),l(),s(37,"div",20)(38,"mat-form-field",21)(39,"mat-label"),d(40,"Add project to resource pool"),l(),R(41,"input",22),s(42,"mat-autocomplete",23,0),Y(44,s4e,2,2,"mat-option",24,Ae),en(46,"async"),l()(),s(47,"button",25),g("click",function(){return o.addResource()}),s(48,"mat-icon"),d(49,"add"),l()()(),s(50,"div",26),Y(51,l4e,7,1,"div",27,a4e,!1,c4e,5,0,"div",28),l()()()()),t&2){let r=Pe(43);m(3),C("routerLink",dn(18,r4e,o.controller.id)),m(4),ee("Resource pool: ",o.pool().name),m(3),C("formGroup",o.editPoolForm),m(9),j(na(20,10,o.pool().created_at,"medium")),m(5),j(na(25,13,o.pool().updated_at,"medium")),m(5),ee(" ",o.pool().resource_pool_id," "),m(4),C("vertical",!0),m(8),C("formControl",o.addResourceFormControl)("matAutocomplete",r),m(3),Z(jn(46,16,o.addResourceFilteredOptions)),m(7),Z(o.pool().resources)}},dependencies:[ne,Xe,at,Ft,Pt,rt,Dt,Hs,Rt,zt,dt,vn,we,Me,et,Se,Ee,W,pe,je,ie,de,jr,ga,Yr,Sa,_t,Ko,_e,wt,It,zr,oC],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.resource-pool-details[_ngcontent-%COMP%]{padding:20px 24px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out;display:flex;flex-direction:column;align-items:center}.resource-pool-details__header[_ngcontent-%COMP%]{margin-bottom:24px;width:100%;max-width:1000px}.resource-pool-details__header-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.resource-pool-details__back-btn[_ngcontent-%COMP%]{flex-shrink:0}.resource-pool-details__title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:var(--mat-sys-on-surface);margin:0}.resource-pool-details__content[_ngcontent-%COMP%]{width:100%;max-width:1000px;display:flex;gap:24px}@media(max-width:768px){.resource-pool-details__content[_ngcontent-%COMP%]{flex-direction:column}}.resource-pool-details__details[_ngcontent-%COMP%]{width:350px;flex-shrink:0;display:flex;flex-direction:column;gap:16px;padding:24px;background:var(--mat-sys-surface);border-radius:12px;border:1px solid var(--mat-sys-outline-variant)}.resource-pool-details__form-field[_ngcontent-%COMP%]{width:100%}.resource-pool-details__info-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto 1fr;gap:8px 16px}.resource-pool-details__info-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px;display:flex;align-items:center}.resource-pool-details__info-value[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface);word-break:break-all}.resource-pool-details__info-value--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:12px}.resource-pool-details__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;padding-top:8px}.resource-pool-details__divider[_ngcontent-%COMP%]{width:1px;background:var(--mat-sys-outline-variant);margin:0 16px}@media(max-width:768px){.resource-pool-details__divider[_ngcontent-%COMP%]{display:none}}.resource-pool-details__resources[_ngcontent-%COMP%]{flex:1;min-width:0;padding:24px;background:var(--mat-sys-surface);border-radius:12px;border:1px solid var(--mat-sys-outline-variant)}.resource-pool-details__resources-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:var(--mat-sys-on-surface);margin:0 0 16px}.resource-pool-details__add-form[_ngcontent-%COMP%]{display:flex;gap:8px;margin-bottom:16px}.resource-pool-details__add-input[_ngcontent-%COMP%]{flex:1}.resource-pool-details__add-button[_ngcontent-%COMP%]{flex-shrink:0}.resource-pool-details__list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.resource-pool-details__item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:var(--mat-sys-surface-container-low);border-radius:8px;transition:background-color .2s ease}.resource-pool-details__item[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container-high)}.resource-pool-details__item-name[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.resource-pool-details__item-actions[_ngcontent-%COMP%]{flex-shrink:0}.resource-pool-details__empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px;color:var(--mat-sys-on-surface-variant);font-size:14px;text-align:center}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}"],changeDetection:0})}return n})();var Ij=(()=>{class n{controllerService;resourcePoolsService;constructor(e,t){this.controllerService=e,this.resourcePoolsService=t}resolve(e,t){let o=e.paramMap.get("controller_id"),r=e.paramMap.get("pool_id");return Vu(this.controllerService.get(+o)).pipe(Un(a=>this.resourcePoolsService.get(a,r)),po(a=>Bo(()=>a)))}static \u0275fac=function(t){return new(t||n)(ge(Je),ge(El))};static \u0275prov=J({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var d4e=[{path:"controller/:controller_id/login",component:tx},{path:"",component:uM,children:[{path:"controllers",component:Z2},{path:"",redirectTo:"controllers",pathMatch:"full"},{path:"bundled",component:zb},{path:"controller/:controller_id/image-manager",component:SM},{path:"controller/:controller_id/projects",component:K2,canActivate:[ni],resolve:{controller:Mg}},{path:"controller/:controller_id/help",component:qb},{path:"controller/:controller_id/settings",component:oM},{path:"controller/:controller_id/settings/console",component:tM},{path:"controller/:controller_id/management/pools/:pool_id",component:QM,canActivate:[ni],resolve:{pool:Ij,controller:Mg}},{path:"installed-software",component:Jb},{path:"controller/:controller_id/systemstatus",component:sM,canActivate:[ni]},{path:"controller/:controller_ip/:controller_port/project/:project_id",component:Hb,canActivate:[ni]},{path:"controller/:controller_id/preferences",component:Tx,canActivate:[ni]},{path:"controller/:controller_id/computes",component:r8,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin",component:nx,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/ethernet-hubs",component:mx,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/ethernet-hubs/addtemplate",component:cx,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/ethernet-hubs/:template_id",component:dx,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/ethernet-switches",component:hx,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/ethernet-switches/addtemplate",component:px,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/ethernet-switches/:template_id",component:ux,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/cloud-nodes",component:lx,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/cloud-nodes/addtemplate",component:ax,canActivate:[ni]},{path:"controller/:controller_id/preferences/builtin/cloud-nodes/:template_id",component:sx,canActivate:[ni]},{path:"controller/:controller_id/preferences/dynamips/templates",component:yx,canActivate:[ni]},{path:"controller/:controller_id/preferences/dynamips/templates/addtemplate",component:Cx,canActivate:[ni]},{path:"controller/:controller_id/preferences/dynamips/templates/:template_id",component:xx,canActivate:[ni]},{path:"controller/:controller_id/preferences/dynamips/templates/:template_id/copy",component:bx,canActivate:[ni]},{path:"controller/:controller_id/preferences/qemu/templates",component:Ix,canActivate:[ni]},{path:"controller/:controller_id/preferences/qemu/templates/:template_id/copy",component:Dx,canActivate:[ni]},{path:"controller/:controller_id/preferences/qemu/templates/:template_id",component:Px,canActivate:[ni]},{path:"controller/:controller_id/preferences/qemu/addtemplate",component:Ex,canActivate:[ni]},{path:"controller/:controller_id/preferences/vpcs/templates",component:Nx,canActivate:[ni]},{path:"controller/:controller_id/preferences/vpcs/templates/:template_id",component:Ox,canActivate:[ni]},{path:"controller/:controller_id/preferences/vpcs/addtemplate",component:Ax,canActivate:[ni]},{path:"controller/:controller_id/preferences/docker/templates",component:N0,canActivate:[ni]},{path:"controller/:controller_id/preferences/docker/templates/:template_id",component:vx,canActivate:[ni]},{path:"controller/:controller_id/preferences/docker/templates/:template_id/copy",component:_x,canActivate:[ni]},{path:"controller/:controller_id/preferences/docker/addtemplate",component:gx,canActivate:[ni]},{path:"controller/:controller_id/preferences/iou/templates",component:kx,canActivate:[ni]},{path:"controller/:controller_id/preferences/iou/templates/:template_id",component:Mx,canActivate:[ni]},{path:"controller/:controller_id/preferences/iou/templates/:template_id/copy",component:wx,canActivate:[ni]},{path:"controller/:controller_id/preferences/iou/addtemplate",component:Sx,canActivate:[ni]},{path:"controller/:controller_id/management",component:wM,children:[{path:"users",component:vM},{path:"groups",component:IM},{path:"roles",component:NM},{path:"pools",component:WM},{path:"ACL",component:$M}]},{path:"controller/:controller_id/management/roles/:role_id",component:RM,resolve:{role:kj,controller:Mg}}]},{path:"controller/:controller_id/project/:project_id",component:q2,canActivate:[ni],canDeactivate:[lM]},{path:"controller/:controller_id/project/:project_id/nodes/:node_id",component:$v,canActivate:[ni]},{path:"controller/:controller_id/project/:project_id/nodes/:node_id/files",component:F2,canActivate:[ni]},{path:"static/web-ui/controller/:controller_id/project/:project_id/nodes/:node_id",component:$v,canActivate:[ni]},{path:"**",component:m8}],Aj=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[dt.forRoot(d4e,{anchorScrolling:"enabled",enableTracing:!1,scrollPositionRestoration:"enabled"}),dt]})}return n})();var XM=class{builtin;filename;symbol_id;raw;theme};var Oj=(()=>{class n{convert(e){let t=new XM;return t.symbol_id=e.id,t.builtin=e.builtin,t.filename=e.filename,t.raw=e.raw,t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Nj=(()=>{class n{convert(e){let t={font_family:void 0,font_size:void 0,font_weight:void 0};return Sf(e,{context:"declarationList"}).children.forEach(r=>{r.property==="font-size"&&r.value&&r.value.children&&r.value.children.forEach(a=>{a.type==="Dimension"&&(t.font_size=parseInt(a.value))}),r.property==="font-family"&&r.value&&r.value.children&&r.value.children.forEach(a=>{a.type==="Identifier"&&(t.font_family=a.name)}),r.property==="font-weight"&&r.value&&r.value.children&&r.value.children.forEach(a=>{a.type==="Identifier"&&(t.font_weight=a.name)})}),t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Fj=[PS,rp,op,Vf,ip,Zc,Bf,tp,Ff,DS,Hf,fS,Xc,TS,wS,kS,MS,SS,ES];var Rj=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({providers:[xl,ta,dg,p2,u2,h2,f2,g2,Qm,ap,Yc,Df,Km,$x,Eo,Uo,Ml,Da,sp,vs,qm,Mf,Ef,Dy,NS,Jc,Uf,VS,lp,Gf,Oj,Tf,kf,Iy,Xm,rf,jc,af,sf,Rf,Sl,$c,Nj,jf,$f,...Fj],imports:[ne,Ge,ie]})}return n})();var Lj=(()=>{class n extends Qd{getItemKey(e){return e.symbol_id}static \u0275fac=(()=>{let e;return function(o){return(e||(e=Pi(n)))(o||n)}})();static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Vj=(()=>{class n{injector=f(Jo);extractError(e){return e&&e.ngOriginalError&&(e=e.ngOriginalError),typeof e=="string"||e instanceof Error?e:e instanceof $O?e.error instanceof Error?e.error:e.error instanceof ErrorEvent?e.error.message:typeof e.error=="string"?`Server returned code ${e.status} with body "${e.error}"`:e.message:null}handleError(e){let t=this.extractError(e)||"Handled unknown error";if(e.error&&e.error.status&&!(e.error.status===400||e.error.status===403||e.error.status===404||e.error.status===409)&&console.error(t),!e)return;let o=this.injector.get(te);e.error?.message?o.error(e.error.message):e.message?o.error(e.message):e.error&&o.error(e.error)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var m4e=(n,i)=>i.value;function p4e(n,i){n&1&&(s(0,"th",11),d(1,"Adapter number"),l())}function u4e(n,i){if(n&1&&(s(0,"td",12),d(1),l()),n&2){let e=i.$implicit;m(),ee("Adapter ",e.adapter_number)}}function h4e(n,i){n&1&&(s(0,"th",11),d(1,"Port name"),l())}function f4e(n,i){if(n&1){let e=z();s(0,"td",12)(1,"input",13),g("input",function(o){let r=k(e).$implicit,a=v();return T(a.onPortNameChange(r.adapter_number,o.target.value))}),l()()}if(n&2){let e=i.$implicit;m(),C("value",e.port_name)}}function g4e(n,i){n&1&&(s(0,"th",11),d(1,"Adapter type"),l())}function _4e(n,i){if(n&1&&(s(0,"mat-option",15),d(1),l()),n&2){let e=i.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function v4e(n,i){if(n&1){let e=z();s(0,"td",12)(1,"mat-select",14),g("selectionChange",function(o){let r=k(e).$implicit,a=v();return T(a.onAdapterTypeChange(r.adapter_number,o.value))}),Y(2,_4e,2,2,"mat-option",15,m4e),l()()}if(n&2){let e=i.$implicit,t=v();m(),C("value",e.adapter_type),m(),Z(t.networkTypes())}}function C4e(n,i){n&1&&(s(0,"th",11),d(1,"MAC address"),l())}function b4e(n,i){if(n&1){let e=z();s(0,"td",12)(1,"input",16),g("input",function(o){let r=k(e).$implicit,a=v();return T(a.onMacAddressChange(r.adapter_number,o.target.value))}),l()()}if(n&2){let e=i.$implicit;m(),C("value",e.mac_address)}}function x4e(n,i){n&1&&(s(0,"th",11),d(1,"Actions"),l())}function y4e(n,i){if(n&1){let e=z();s(0,"td",12)(1,"button",17),g("click",function(){let o=k(e).$implicit,r=v();return T(r.delete(o))}),s(2,"mat-icon",18),d(3,"delete"),l()()()}}function S4e(n,i){n&1&&R(0,"tr",19)}function w4e(n,i){n&1&&R(0,"tr",20)}var Bj=(()=>{class n{cd=f(Q);networkTypes=le([]);displayedColumns=le([]);adapters=U([]);onAdd(){let e=this.adapters(),t={adapter_number:e.length,adapter_type:this.networkTypes()[0]?.value};this.adapters.set([...e,t])}delete(e){this.adapters.set(this.adapters().filter(t=>t!==e))}onPortNameChange(e,t){this.adapters.update(o=>o.map(r=>r.adapter_number===e?it(K({},r),{port_name:t}):r)),this.cd.markForCheck()}onAdapterTypeChange(e,t){this.adapters.update(o=>o.map(r=>r.adapter_number===e?it(K({},r),{adapter_type:t}):r)),this.cd.markForCheck()}onMacAddressChange(e,t){this.adapters.update(o=>o.map(r=>r.adapter_number===e?it(K({},r),{mac_address:t}):r)),this.cd.markForCheck()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-custom-adapters-table"]],inputs:{networkTypes:[1,"networkTypes"],displayedColumns:[1,"displayedColumns"],adapters:[1,"adapters"]},outputs:{adapters:"adaptersChange"},decls:20,vars:3,consts:[["mat-table","",3,"dataSource"],["matColumnDef","adapter_number"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","port_name"],["matColumnDef","adapter_type"],["matColumnDef","mac_address"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-button","",1,"form-field",3,"click"],["mat-header-cell",""],["mat-cell",""],["matInput","","placeholder","Port name",2,"width","120px",3,"input","value"],["placeholder","Type",3,"selectionChange","value"],[3,"value"],["matInput","","placeholder","XX:XX:XX:XX:XX:XX",2,"width","150px",3,"input","value"],["mat-icon-button","","matTooltip","Delete adapter","matTooltipClass","custom-tooltip",3,"click"],["aria-label","Delete adapter"],["mat-header-row",""],["mat-row",""]],template:function(t,o){t&1&&(s(0,"table",0),Le(1,1),xe(2,p4e,2,0,"th",2)(3,u4e,2,1,"td",3),Ve(),Le(4,4),xe(5,h4e,2,0,"th",2)(6,f4e,2,1,"td",3),Ve(),Le(7,5),xe(8,g4e,2,0,"th",2)(9,v4e,4,1,"td",3),Ve(),Le(10,6),xe(11,C4e,2,0,"th",2)(12,b4e,2,1,"td",3),Ve(),Le(13,7),xe(14,x4e,2,0,"th",2)(15,y4e,4,0,"td",3),Ve(),xe(16,S4e,1,0,"tr",8)(17,w4e,1,0,"tr",9),l(),s(18,"button",10),g("click",function(){return o.onAdd()}),d(19,"Add"),l()),t&2&&(C("dataSource",o.adapters()),m(16),C("matHeaderRowDef",o.displayedColumns()),m(),C("matRowDefColumns",o.displayedColumns()))},dependencies:[ne,hn,Sn,Mn,Dn,kn,wn,Pn,Tn,En,In,An,vt,At,_t,Fo,W,pe,je,ie,de,wt,It,Se,Ee,we],styles:["[_nghost-%COMP%]{display:block;width:100%;background:transparent}.preferences__header[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:32px 20px 16px;display:flex;align-items:center;gap:16px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out}.preferences__back-btn[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;color:var(--mat-sys-on-surface);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__back-btn[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 8%,transparent)}.preferences__title[_ngcontent-%COMP%]{font-size:32px;font-weight:500;color:var(--mat-sys-on-surface);margin:0;padding-bottom:8px}.preferences__content[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;padding:0 20px 20px;animation:_ngcontent-%COMP%_fadeInSlideIn .4s ease-out .1s both}.preferences__nav-list[_ngcontent-%COMP%]{background:var(--mat-sys-surface);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 10%,transparent)}.preferences__nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px 24px;color:var(--mat-sys-on-surface);text-decoration:none;font-size:16px;font-weight:500;border-bottom:1px solid var(--mat-sys-outline-variant);transition:all .2s cubic-bezier(.4,0,.2,1)}.preferences__nav-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.preferences__nav-item[_ngcontent-%COMP%]:hover{background-color:color-mix(in srgb,var(--mat-sys-on-surface) 5%,transparent)}.preferences__nav-item.mdc-list-item--activated[_ngcontent-%COMP%]{background-color:color-mix(in srgb,var(--mat-sys-primary) 12%,transparent);border-left:3px solid var(--mat-sys-primary)}.preferences__nav-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);margin-right:8px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px 24px 24px}.preferences__usage-field--full[_ngcontent-%COMP%]{width:100%}@keyframes _ngcontent-%COMP%_fadeInSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:768px){.preferences__header[_ngcontent-%COMP%]{padding:24px 16px 12px;gap:12px}.preferences__back-btn[_ngcontent-%COMP%]{width:44px;height:44px}.preferences__title[_ngcontent-%COMP%]{font-size:24px}.preferences__content[_ngcontent-%COMP%]{padding:0 16px 16px}.preferences__nav-item[_ngcontent-%COMP%]{padding:14px 16px;font-size:15px}.preferences__usage-form[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var zj=(()=>{class n{controller=le(void 0);symbol=le(void 0);symbolChangedEmitter=new ve;chosenSymbol=ae("");symbolChanged(e){this.chosenSymbol.set(e)}chooseSymbol(){this.symbolChangedEmitter.emit(this.chosenSymbol())}cancelChooseSymbol(){this.symbolChangedEmitter.emit(this.symbol())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-symbols-menu"]],inputs:{controller:[1,"controller"],symbol:[1,"symbol"]},outputs:{symbolChangedEmitter:"symbolChangedEmitter"},decls:11,vars:2,consts:[[1,"content","configurator"],[1,"default-header"],[1,"row"],[1,"col"],["mat-button","",1,"top-button","cancel-button",3,"click"],["mat-raised-button","","color","primary",1,"top-button",3,"click"],[1,"default-content"],[3,"symbolChanged","controller","symbol"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"Symbol selection"),l(),s(5,"button",4),g("click",function(){return o.cancelChooseSymbol()}),d(6,"Cancel"),l(),s(7,"button",5),g("click",function(){return o.chooseSymbol()}),d(8,"Choose symbol"),l()()(),s(9,"div",6)(10,"app-symbols",7),g("symbolChanged",function(a){return o.symbolChanged(a)}),l()()()),t&2&&(m(10),C("controller",o.controller())("symbol",o.symbol()))},dependencies:[ne,W,pe,Em],styles:["[_nghost-%COMP%]{display:block}.configurator[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:color-mix(in srgb,var(--mat-sys-shadow) 50%,transparent);z-index:1000;overflow-y:auto}.content[_ngcontent-%COMP%]{max-width:800px;margin:40px auto;background:var(--mat-sys-surface);border-radius:16px;box-shadow:0 12px 40px color-mix(in srgb,var(--mat-sys-shadow) 25%,transparent),0 4px 12px color-mix(in srgb,var(--mat-sys-shadow) 12%,transparent)}.default-header[_ngcontent-%COMP%]{padding:16px 24px;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline) 30%,transparent)}.default-header[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px}.default-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:20px;font-weight:500;color:var(--mat-sys-on-surface)}.default-content[_ngcontent-%COMP%]{padding:24px}.top-button[_ngcontent-%COMP%]{text-transform:none;font-size:14px;font-weight:500}.cancel-button[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant)}@media(max-width:768px){.content[_ngcontent-%COMP%]{margin:16px;max-width:calc(100% - 32px)}.default-header[_ngcontent-%COMP%]{padding:12px 16px}.default-content[_ngcontent-%COMP%]{padding:16px}}"],changeDetection:0})}return n})();var jj=(()=>{class n{route=f(lt);controllerService=f(Je);toasterService=f(te);cd=f(Q);controller;dynamipsPath=U("");ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}restoreDefaults(){this.dynamipsPath.set("")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-dynamips-preferences"]],inputs:{dynamipsPath:[1,"dynamipsPath"]},outputs:{dynamipsPath:"dynamipsPathChange"},decls:8,vars:1,consts:[[1,"content"],[1,"default-header"],[1,"row"],[1,"col"],[1,"default-content"],[1,"form-field"],["matInput","","type","text","placeholder","Path to Dynamips",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"Dynamips preferences"),l()()(),s(5,"div",4)(6,"mat-form-field",5)(7,"input",6),g("input",function(a){return o.dynamipsPath.set(a.target.value)}),l()()()()),t&2&&(m(7),C("value",o.dynamipsPath()))},dependencies:[ne,we,Me,Se,Ee],styles:[".top-button[_ngcontent-%COMP%]{height:36px;margin-top:22px}.form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var KM=(()=>{class n{httpController;constructor(e){this.httpController=e}get(e){return this.httpController.get(e,"/settings")}update(e,t){return this.httpController.post(e,"/settings",t)}getSettingsForQemu(e){return this.httpController.get(e,"/settings/qemu")}updateSettingsForQemu(e,t){return this.httpController.put(e,"/settings/qemu",{enable_hardware_acceleration:t.enable_hardware_acceleration,require_hardware_acceleration:t.require_hardware_acceleration})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();function M4e(n,i){if(n&1&&(s(0,"button",4),d(1," QEMU VM templates "),l()),n&2){let e=v();C("routerLink",Ui("/controller/",e.controller.id,"/preferences/qemu/templates"))}}function k4e(n,i){if(n&1){let e=z();s(0,"mat-list-item")(1,"mat-checkbox",10),g("change",function(o){k(e);let r=v(2);return r.settings.require_hardware_acceleration=o.checked,T(r.cd.markForCheck())}),d(2," Require Hardware Acceleration (KVM/HAXM) "),l()()}if(n&2){let e=v(2);m(),C("checked",e.settings.require_hardware_acceleration)}}function T4e(n,i){if(n&1){let e=z();s(0,"mat-nav-list")(1,"mat-list-item")(2,"mat-checkbox",10),g("change",function(o){k(e);let r=v();return r.settings.enable_hardware_acceleration=o.checked,T(r.cd.markForCheck())}),d(3," Enable Hardware Acceleration (KVM/HAXM) "),l()(),A(4,k4e,3,1,"mat-list-item"),l()}if(n&2){let e=v();m(2),C("checked",e.settings.enable_hardware_acceleration),m(2),O(e.settings.enable_hardware_acceleration?4:-1)}}var $j=(()=>{class n{route=f(lt);controllerService=f(Je);controllerSettingsService=f(KM);toasterService=f(te);cd=f(Q);controller;settings;ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck(),this.controllerSettingsService.getSettingsForQemu(this.controller).subscribe({next:o=>{this.settings=o,this.cd.markForCheck()},error:o=>{let r=o.error?.message||o.message||"Failed to load QEMU settings";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}apply(){this.settings.enable_hardware_acceleration||(this.settings.require_hardware_acceleration=!1),this.controllerSettingsService.updateSettingsForQemu(this.controller,this.settings).subscribe({next:e=>{this.toasterService.success("Changes applied")},error:e=>{let t=e.error?.message||e.message||"Failed to apply QEMU settings";this.toasterService.error(t),this.cd.markForCheck()}})}restoreDefaults(){let e={enable_hardware_acceleration:!0,require_hardware_acceleration:!0};this.controllerSettingsService.updateSettingsForQemu(this.controller,e).subscribe({next:t=>{this.settings=t,this.toasterService.success("Restored to default settings")},error:t=>{let o=t.error?.message||t.message||"Failed to restore QEMU settings";this.toasterService.error(o),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-qemu-preferences"]],decls:14,vars:2,consts:[[1,"content"],[1,"default-header"],[1,"row"],[1,"col"],["mat-raised-button","","color","primary",1,"top-button",3,"routerLink"],[1,"default-content"],[1,"container","mat-elevation-z8"],[1,"buttons-bar"],["mat-button","","color","accent",3,"click"],["mat-raised-button","","color","primary",3,"click"],[3,"change","checked"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"QEMU preferences"),l(),A(5,M4e,2,2,"button",4),l()(),s(6,"div",5)(7,"div",6),A(8,T4e,5,2,"mat-nav-list"),l(),s(9,"div",7)(10,"button",8),g("click",function(){return o.restoreDefaults()}),d(11,"Restore defaults"),l(),s(12,"button",9),g("click",function(){return o.apply()}),d(13,"Apply"),l()()()()),t&2&&(m(5),O(o.controller?5:-1),m(3),O(o.settings?8:-1))},dependencies:[ne,dt,vn,W,pe,Ot,Gt,Zi,R4,Wd],styles:[".top-button[_ngcontent-%COMP%]{height:36px;margin-top:16px}"],changeDetection:0})}return n})();var Hj=(()=>{class n{route=f(lt);controllerService=f(Je);toasterService=f(te);cd=f(Q);controller;vpcsExecutable=U("");ngOnInit(){let e=this.route.snapshot.paramMap.get("controller_id");this.controllerService.get(parseInt(e,10)).then(t=>{this.controller=t,this.cd.markForCheck()},t=>{let o=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(o),this.cd.markForCheck()})}restoreDefaults(){this.vpcsExecutable.set("")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-vpcs-preferences"]],inputs:{vpcsExecutable:[1,"vpcsExecutable"]},outputs:{vpcsExecutable:"vpcsExecutableChange"},decls:8,vars:1,consts:[[1,"content"],[1,"default-header"],[1,"row"],[1,"col"],[1,"default-content"],[1,"form-field"],["matInput","","type","text","placeholder","Path to VPCS executable",3,"input","value"]],template:function(t,o){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"VPCS preferences"),l()()(),s(5,"div",4)(6,"mat-form-field",5)(7,"input",6),g("input",function(a){return o.vpcsExecutable.set(a.target.value)}),l()()()()),t&2&&(m(7),C("value",o.vpcsExecutable()))},dependencies:[ne,we,Me,Se,Ee],styles:[".form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var E4e=["container"],Uj=(()=>{class n{sanitizer=f(fr);changeDetector=f(Q);mapSettingsService=f(go);consoleService=f(rr);toasterService=f(te);router=f(ht);vncConsoleService=f(dp);project=le(void 0);controller;contextConsoleMenu=Nt(Fn);container=Nt("container",{read:oo});componentBrowserRef;topPosition=ae(void 0);leftPosition=ae(void 0);node;constructor(){}ngOnInit(){this.setPosition(0,0)}setPosition(e,t){this.topPosition.set(this.sanitizer.bypassSecurityTrustStyle(e+"px")),this.leftPosition.set(this.sanitizer.bypassSecurityTrustStyle(t+"px")),this.changeDetector.detectChanges()}openMenu(e,t,o){this.node=e;let r=this.mapSettingsService.getConsoleContextMenuAction();r?r==="web console"?this.openWebConsole():r==="web console in new tab"?this.openWebConsoleInNewTab():r==="console"&&this.openConsole():(this.setPosition(t,o),this.contextConsoleMenu().openMenu())}openConsole(){this.mapSettingsService.setConsoleContextMenuAction("console"),this.componentBrowserRef=this.container().createComponent(tg),this.componentBrowserRef.setInput("controller",this.controller),this.componentBrowserRef.setInput("node",this.node),this.componentBrowserRef.changeDetectorRef.detectChanges(),this.componentBrowserRef.instance.openConsole()}openWebConsole(){this.mapSettingsService.setConsoleContextMenuAction("web console"),this.node.status==="started"?this.node.console_type==="vnc"?this.vncConsoleService.openVncConsole(this.controller,this.node):this.node.console_type&&this.node.console_type.startsWith("spice")?this.toasterService.error("SPICE console is not yet supported."):this.node.console_type==="telnet"||this.node.console_type==="ssh"?(this.mapSettingsService.logConsoleSubject.next(!0),this.consoleService.openConsoleForNode(this.node)):this.toasterService.error(`Console type '${this.node.console_type}' is not supported in web console mode.`):this.toasterService.error("To open console please start the node")}openWebConsoleInNewTab(){if(this.mapSettingsService.setConsoleContextMenuAction("web console in new tab"),this.node.status==="started")if(this.node.console_type==="vnc")this.vncConsoleService.openVncConsole(this.controller,this.node);else if(this.node.console_type&&this.node.console_type.startsWith("spice"))this.toasterService.error("SPICE console is not yet supported.");else if(this.node.console_type==="telnet"||this.node.console_type==="ssh"){let e=this.router.url.split("/"),t=`/static/web-ui/${e[1]}/${e[2]}/${e[3]}/${e[4]}/nodes/${this.node.node_id}`;window.open(t)}else this.toasterService.error("Console type not supported in new tab");else this.toasterService.error("To open console please start the node")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-context-console-menu"]],viewQuery:function(t,o){t&1&&Xt(o.contextConsoleMenu,Fn,5)(o.container,E4e,5,oo),t&2&&Kt(2)},inputs:{project:[1,"project"],controller:"controller"},decls:23,vars:6,consts:[["contextConsoleMenu","matMenu"],["container",""],[1,"context-menu"],[3,"matMenuTriggerFor"],[1,"context-menu-items"],[1,"title"],["mat-menu-item","",3,"click"],[3,"hidden"]],template:function(t,o){if(t&1&&(s(0,"div",2),R(1,"span",3),s(2,"mat-menu",4,0)(4,"span",5),d(5," Choose default behavior for double click on node "),l(),s(6,"button",6),g("click",function(){return o.openConsole()}),s(7,"mat-icon"),d(8,"web_asset"),l(),s(9,"span"),d(10,"Open console"),l()(),s(11,"button",6),g("click",function(){return o.openWebConsole()}),s(12,"mat-icon"),d(13,"http"),l(),s(14,"span"),d(15,"Open web console"),l()(),s(16,"button",6),g("click",function(){return o.openWebConsoleInNewTab()}),s(17,"mat-icon"),d(18,"http"),l(),s(19,"span"),d(20,"Open web console in new tab"),l()()()(),R(21,"template",7,1)),t&2){let r=Pe(3);nn("left",o.leftPosition())("top",o.topPosition()),m(),C("matMenuTriggerFor",r),m(20),C("hidden",!0)}},dependencies:[ne,Ge,Qn,Ze,Fn,ie,de],styles:[".context-menu[_ngcontent-%COMP%]{position:absolute;min-height:0}.title[_ngcontent-%COMP%]{margin:8px}"],changeDetection:0})}return n})();var Gj=(()=>{class n{controllerService=f(Je);settingsService=f($r);toasterService=f(te);nodeService=f(ut);controller=le(void 0);nodes=le([]);async console(){this.toasterService.error("Console action is only supported in Electron mode")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-console-device-action"]],inputs:{controller:[1,"controller"],nodes:[1,"nodes"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.console()}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Console"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var Wj=(()=>{class n{controller=le(void 0);node=le(void 0);open(){console.log("Opening file explorer is only supported in Electron mode")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-open-file-explorer-action"]],inputs:{controller:[1,"controller"],node:[1,"node"]},decls:5,vars:0,consts:[["mat-menu-item","",3,"click"]],template:function(t,o){t&1&&(s(0,"button",0),g("click",function(){return o.open()}),s(1,"mat-icon"),d(2,"tab"),l(),s(3,"span"),d(4,"Open file explorer"),l()())},dependencies:[W,ie,de,Ge,Ze],encapsulation:2,changeDetection:0})}return n})();var qj=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[pk,hi,pk]})}return n})();var Qj=[sg,W,Ge,Mt,pM,ie,we,Se,hn,_e,ms,pn,Ya,Ot,Zi,cl,ar,vt,wt,ul,io,qj,To,BM,Bc,ti];var YM=(()=>{class n{settingsService;constructor(e,t){wi.production&&e.events.subscribe(o=>{t.getStatisticsSettings()&&o instanceof bp&&(gtag("set","page",o.url),gtag("send","pageview"))})}static \u0275fac=function(t){return new(t||n)(ge(ht),ge($r))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var Xj=(()=>{class n{controllerService;loginService;constructor(e,t){this.controllerService=e,this.loginService=t}intercept(e,t){return t.handle(e).pipe(po(o=>Bo(()=>o)))}async call(){let e=JSON.parse(localStorage.getItem("isRememberMe"))??null,t=this.loginService.controller_id,o=await this.controllerService.get(parseInt(t,10));o.tokenExpired=!0,await this.controllerService.update(o);try{if(e&&e.isRememberMe){let r=await this.loginService.getLoggedUserRefToken(o,e);o.authToken=r.access_token,o.tokenExpired=!1,await this.controllerService.update(o),await this.loginService.getLoggedUser(o),this.reloadCurrentRoute()}}catch(r){throw r}}reloadCurrentRoute(){location.reload()}static \u0275fac=function(t){return new(t||n)(ge(Je),ge(dl))};static \u0275prov=J({token:n,factory:n.\u0275fac})}return n})();var P4e=["switch"],I4e=["*"];function A4e(n,i){n&1&&(s(0,"span",11),ei(),s(1,"svg",13),R(2,"path",14),l(),s(3,"svg",15),R(4,"path",16),l()())}var O4e=new cn("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),ZM=class{source;checked;constructor(i,e){this.source=i,this.checked=e}},N4e=(()=>{class n{_elementRef=f(Zt);_focusMonitor=f(Aa);_changeDetectorRef=f(Q);defaults=f(O4e);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new ZM(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=qo();_focused=!1;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required=!1;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new ve;toggleChange=new ve;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){f(cr).load(ia);let e=f(new sc("tabindex"),{optional:!0}),t=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=t.color||"accent",this.id=this._uniqueId=f(Mo).getId("mat-mdc-slide-toggle-"),this.hideIcon=t.hideIcon??!1,this.disabledInteractive=t.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new ZM(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,o){if(t&1&&xn(P4e,5),t&2){let r;mt(r=pt())&&(o._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(t,o){t&2&&(Wo("id",o.id),qt("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),er(o.color?"mat-"+o.color:""),Be("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",Ct],color:"color",disabled:[2,"disabled","disabled",Ct],disableRipple:[2,"disableRipple","disableRipple",Ct],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:No(e)],checked:[2,"checked","checked",Ct],hideIcon:[2,"hideIcon","hideIcon",Ct],disabledInteractive:[2,"disabledInteractive","disabledInteractive",Ct]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[fn([{provide:ud,useExisting:ad(()=>n),multi:!0},{provide:gC,useExisting:n,multi:!0}]),bn],ngContentSelectors:I4e,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(t,o){if(t&1&&(ii(),s(0,"div",1)(1,"button",2,0),g("click",function(){return o._handleClick()}),R(3,"div",3)(4,"span",4),s(5,"span",5)(6,"span",6)(7,"span",7),R(8,"span",8),l(),s(9,"span",9),R(10,"span",10),l(),A(11,A4e,5,0,"span",11),l()()(),s(12,"label",12),g("click",function(a){return a.stopPropagation()}),on(13),l()()),t&2){let r=Pe(2);C("labelPosition",o.labelPosition),m(),Be("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),C("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),qt("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(9),C("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),O(o.hideIcon?-1:11),m(),C("for",o.buttonId),qt("id",o._labelId)}},dependencies:[Us,Ju],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle label:empty{display:none}.mat-mdc-slide-toggle-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-slide-toggle-touch-target-size, 48px);width:100%;transform:translate(-50%, -50%);display:var(--mat-slide-toggle-touch-target-display, block)}[dir=rtl] .mat-mdc-slide-toggle-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}
`],encapsulation:2,changeDetection:0})}return n})(),Kj=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ht({type:n});static \u0275inj=$t({imports:[N4e,hi]})}return n})();function F4e(n,i){if(n&1&&(s(0,"mat-option",4),d(1),l()),n&2){let e=i.$implicit,t=v();C("value",e),m(),ee(" ",t.displayFn()(e)," ")}}var Yj=(()=>{class n{data=le(void 0);filteredData;typeName;autocompleteControl=new Ye;eltType=le(void 0);displayFn=le(void 0);filterFn=le(void 0);selectionChange=new ve;constructor(){}ngOnChanges(){this.filteredData=this.autocompleteControl.valueChanges.pipe(pi(""),Lt(e=>this.filterFn()(e,this.data())))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-autocomplete"]],inputs:{data:[1,"data"],eltType:[1,"eltType"],displayFn:[1,"displayFn"],filterFn:[1,"filterFn"]},outputs:{selectionChange:"selectionChange"},features:[bn],decls:9,vars:6,consts:[["auto","matAutocomplete"],[1,"input-field"],["type","text","matInput","",3,"matAutocomplete","formControl"],[3,"optionSelected","displayWith"],[3,"value"]],template:function(t,o){if(t&1&&(s(0,"mat-form-field",1)(1,"mat-label"),d(2),l(),R(3,"input",2),s(4,"mat-autocomplete",3,0),g("optionSelected",function(a){return o.selectionChange.emit(a.option.value)}),Y(6,F4e,2,2,"mat-option",4,Ae),en(8,"async"),l()()),t&2){let r=Pe(5);m(2),j(o.eltType()),m(),C("matAutocomplete",r)("formControl",o.autocompleteControl),m(),C("displayWith",o.displayFn()),m(2),Z(jn(8,4,o.filteredData))}},dependencies:[ne,Xe,Ft,Pt,Dt,Hs,we,Me,et,Se,Ee,Yr,Sa,_t,Ko,zr],styles:[".input-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var R4e=(n,i,e,t)=>({"status-uploading":n,"status-done":i,"status-error":e,"status-canceled":t});function L4e(n,i){return this.trackByTempId}function V4e(n,i){if(n&1&&(Le(0),d(1),Ve()),n&2){let e=v(2);m(),ui(" Uploading ",e.activeCount," file",e.activeCount!==1?"s":""," ")}}function B4e(n,i){n&1&&(Le(0),d(1," Uploads complete "),Ve())}function z4e(n,i){if(n&1&&R(0,"mat-progress-bar",6),n&2){let e=v(2);C("value",e.overallProgress)}}function j4e(n,i){n&1&&(Le(0),d(1,"check_circle"),Ve())}function $4e(n,i){n&1&&(Le(0),d(1,"error"),Ve())}function H4e(n,i){n&1&&(Le(0),d(1,"cancel"),Ve())}function U4e(n,i){n&1&&(Le(0),d(1,"insert_drive_file"),Ve())}function G4e(n,i){n&1&&(s(0,"span",15),d(1,"Queued"),l())}function W4e(n,i){if(n&1&&(s(0,"span",15),d(1),l()),n&2){let e=v().$implicit;m(),ee("",e.progress,"%")}}function q4e(n,i){n&1&&(s(0,"span",16),d(1,"Done"),l())}function Q4e(n,i){if(n&1&&(s(0,"span",17),d(1),l()),n&2){let e=v().$implicit;m(),j(e.errorMessage||"Failed")}}function X4e(n,i){n&1&&(s(0,"span",18),d(1,"Canceled"),l())}function K4e(n,i){if(n&1){let e=z();s(0,"button",21),g("click",function(){k(e);let o=v().$implicit,r=v(3);return T(r.cancelUpload(o.tempId))}),s(1,"mat-icon"),d(2,"close"),l()()}}function Y4e(n,i){if(n&1&&R(0,"mat-progress-bar",20),n&2){let e=v().$implicit;C("value",e.progress)}}function Z4e(n,i){if(n&1){let e=z();s(0,"div",10)(1,"div",11)(2,"mat-icon",12),A(3,j4e,2,0,"ng-container"),A(4,$4e,2,0,"ng-container"),A(5,H4e,2,0,"ng-container"),A(6,U4e,2,0,"ng-container"),l(),s(7,"div",13),g("click",function(o){let r=k(e).$implicit,a=v(3);return T(a.navigateToFile(r,o))}),s(8,"span",14),d(9),l(),A(10,G4e,2,0,"span",15),A(11,W4e,2,1,"span",15),A(12,q4e,2,0,"span",16),A(13,Q4e,2,1,"span",17),A(14,X4e,2,0,"span",18),l(),A(15,K4e,3,0,"button",19),l(),A(16,Y4e,1,1,"mat-progress-bar",20),l()}if(n&2){let e=i.$implicit;Be("dismissing",e.dismissing),m(2),C("ngClass",nC(16,R4e,e.status==="uploading"||e.status==="queued",e.status==="uploaded",e.status==="error",e.status==="canceled")),m(),O(e.status==="uploaded"?3:-1),m(),O(e.status==="error"?4:-1),m(),O(e.status==="canceled"?5:-1),m(),O(e.status==="uploading"||e.status==="queued"?6:-1),m(2),C("title",e.filename),m(),j(e.filename),m(),O(e.status==="queued"?10:-1),m(),O(e.status==="uploading"?11:-1),m(),O(e.status==="uploaded"?12:-1),m(),O(e.status==="error"?13:-1),m(),O(e.status==="canceled"?14:-1),m(),O(e.status==="uploading"||e.status==="queued"?15:-1),m(),O(e.status==="uploading"||e.status==="queued"?16:-1)}}function J4e(n,i){if(n&1&&(s(0,"div",8),Y(1,Z4e,17,21,"div",9,L4e,!0),l()),n&2){let e=v(2);m(),Z(e.uploadList)}}function e5e(n,i){if(n&1){let e=z();s(0,"div",0)(1,"div",1),g("click",function(){k(e);let o=v();return T(o.toggleExpanded())}),s(2,"div",2)(3,"mat-icon",3),d(4,"cloud_upload"),l(),s(5,"span",4),A(6,V4e,2,2,"ng-container"),A(7,B4e,2,0,"ng-container"),l()(),s(8,"div",5),A(9,z4e,1,1,"mat-progress-bar",6),s(10,"mat-icon",7),d(11),l()()(),A(12,J4e,3,0,"div",8),l()}if(n&2){let e=v();m(6),O(e.activeCount>0?6:-1),m(),O(e.activeCount===0?7:-1),m(2),O(e.activeCount>0?9:-1),m(2),j(e.isExpanded()?"expand_more":"expand_less"),m(),O(e.isExpanded()?12:-1)}}var JM=(()=>{class n{imageUploadSessionService=f(kg);router=f(ht);uploads=new Map;isExpanded=ae(!0);subscription;ngOnInit(){this.subscription=this.imageUploadSessionService.events$.subscribe(e=>{this.onUploadEvent(e)})}get uploadList(){return Array.from(this.uploads.values())}get hasUploads(){return this.uploads.size>0}get activeCount(){return this.uploadList.filter(e=>e.status==="uploading"||e.status==="queued").length}get overallProgress(){let e=this.uploadList.filter(t=>t.status==="uploading"||t.status==="queued");return e.length?Math.round(e.reduce((t,o)=>t+(o.progress||0),0)/e.length):100}cancelUpload(e){this.imageUploadSessionService.requestCancel(e)}navigateToFile(e,t){t.stopPropagation(),e.controller_id&&this.router.navigate(["/controller",e.controller_id,"image-manager"],{queryParams:{highlight:e.filename}})}toggleExpanded(){this.isExpanded.set(!this.isExpanded())}trackByTempId(e,t){return t.tempId}onUploadEvent(e){let t=this.uploads.get(e.tempId);t?.dismissTimer&&clearTimeout(t.dismissTimer);let o=K(K({},t||{}),e);e.status==="uploaded"||e.status==="error"||e.status==="canceled"?(o.dismissing=!1,o.dismissTimer=setTimeout(()=>{let r=this.uploads.get(e.tempId);r&&(r.dismissing=!0),setTimeout(()=>{this.uploads.delete(e.tempId)},400)},3e3)):o.dismissing=!1,this.uploads.set(e.tempId,o),!t&&e.status==="queued"&&this.isExpanded.set(!0)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),this.uploadList.forEach(e=>{e.dismissTimer&&clearTimeout(e.dismissTimer)})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-global-upload-indicator"]],decls:1,vars:1,consts:[[1,"upload-indicator-container"],[1,"upload-indicator-header",3,"click"],[1,"header-left"],[1,"upload-icon"],[1,"header-title"],[1,"header-right"],["mode","determinate",1,"header-progress",3,"value"],[1,"toggle-icon"],[1,"upload-list"],[1,"upload-item",3,"dismissing"],[1,"upload-item"],[1,"upload-item-info"],[1,"file-icon",3,"ngClass"],[1,"upload-item-text",3,"click"],[1,"filename",3,"title"],[1,"status-text"],[1,"status-text","status-done"],[1,"status-text","status-error"],[1,"status-text","status-canceled"],["mat-icon-button","","title","Cancel upload",1,"cancel-btn"],["mode","determinate",1,"item-progress",3,"value"],["mat-icon-button","","title","Cancel upload",1,"cancel-btn",3,"click"]],template:function(t,o){t&1&&A(0,e5e,13,5,"div",0),t&2&&O(o.hasUploads?0:-1)},dependencies:[ne,Yi,ie,de,ms,Rc,W,je],styles:[".upload-indicator-container[_ngcontent-%COMP%]{position:fixed;bottom:16px;right:16px;width:320px;background:var(--mat-sys-surface);border-radius:4px;box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent);z-index:2000;overflow:hidden;font-size:12px}.upload-indicator-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:8px;cursor:pointer;background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container);user-select:none}.upload-indicator-header[_ngcontent-%COMP%]:hover{background:var(--mat-sys-primary-fixed-dim)}.header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.upload-icon[_ngcontent-%COMP%]{font-size:14px;height:14px;width:14px;flex-shrink:0}.header-title[_ngcontent-%COMP%]{font-weight:500;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header-right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.header-progress[_ngcontent-%COMP%]{width:60px}.toggle-icon[_ngcontent-%COMP%]{font-size:14px;height:14px;width:14px}.upload-list[_ngcontent-%COMP%]{max-height:280px;overflow-y:auto;padding:8px 0}.upload-item[_ngcontent-%COMP%]{padding:8px;transition:opacity .4s ease,max-height .4s ease;opacity:1}.upload-item.dismissing[_ngcontent-%COMP%]{opacity:0}.upload-item-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.file-icon[_ngcontent-%COMP%]{font-size:14px;height:14px;width:14px;flex-shrink:0}.file-icon.status-uploading[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.file-icon.status-done[_ngcontent-%COMP%]{color:var(--custom-mat-sys-success)}.file-icon.status-error[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.file-icon.status-canceled[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant)}.upload-item-text[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;cursor:pointer}.upload-item-text[_ngcontent-%COMP%]:hover .filename[_ngcontent-%COMP%]{text-decoration:underline}.filename[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:500}.status-text[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant)}.status-text.status-done[_ngcontent-%COMP%]{color:var(--custom-mat-sys-success)}.status-text.status-error[_ngcontent-%COMP%]{color:var(--mat-sys-error);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status-text.status-canceled[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant)}.cancel-btn[_ngcontent-%COMP%]{width:10px;height:10px;line-height:10px;flex-shrink:0}.cancel-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:12px;height:12px;width:12px}.item-progress[_ngcontent-%COMP%]{margin-top:8px;height:2px;border-radius:2px}"],changeDetection:0})}return n})();var Zj=(()=>{class n{_googleAnalyticsService;constructor(e){this._googleAnalyticsService=e}static \u0275fac=function(t){return new(t||n)(ge(YM))};static \u0275mod=Ht({type:n});static \u0275inj=$t({providers:[$r,{provide:wO,useClass:Vj},{provide:HO,useClass:Xj,multi:!0},ex,ki,ml,Je,pl,ut,Fi,Ri,mn,bg,$2,te,no,Wf,zo,di,Lj,I2,Ho,IS,Ei,S4,wm,Rs,gl,KM,Kr,Rm,xa,yr,ps,Kb,Xb,Qb,Pm,Om,Lm,ya,ds,Fc,us,ef,qd,yg,zc,eM,J2,c2,up,ng,go,YS,ko,og,pp,Ws,Tm,ci,YM,rr,dp,rg,Mg,ni,lM,Hu,d2,nM,dl,Er],imports:[rC,UO,Aj,uM,cg,q2,wM,NM,vM,Z2,Cg,ag,Uj,G4,WM,QM,i2,o2,Ow,Aw,Fw,Nw,_g,Yw,fg,O2,k2,y2,S2,w2,$M,IM,dM,hp,PM,SM,K2,tf,Jb,Zb,L2,Ww,V2,dw,$v,M2,Xe,Dt,UR,xm,FM,sM,Xr,tM,aM,rM,zv,gw,vw,_w,Cw,Mw,kw,Gj,JM,xw,n2,r2,jw,JS,Iw,a2,qw,Qw,Jw,e2,Hw,Uw,Gw,Wj,Pw,Zw,t2,fw,s2,l2,bw,$w,tg,Xw,ig,Vw,Bw,Rw,Tw,Lw,Ew,ZS,_2,zw,Vv,Vd,XS,j2,Q2,Zf,U2,m2,zb,Yb,qb,Kw,Wa,X2,B2,v2,wg,xg,fl,Dw,qr,Em,tw,Bj,zj,uw,cw,ew,rw,aw,hw,nw,pw,lw,sw,Jh,iw,ow,Vc,Px,Ax,Ox,cx,dx,ax,sx,px,ux,Cx,gx,vx,Sx,Mx,Dx,bx,wx,_x,z2,pg,kM,gM,TM,Uv,AM,RM,OM,bM,qv,EM,jM,Yj,qM,KS,DM,CM,Nu,qf,UM,GM,oM,vg,Yf,QS,Kf,C2,tx,Sg,G2,Y2,Hb,nx,Tx,jj,Ed,Hj,$j,Ix,Sm,Oi,Nx,N0,N0,kx,yx,xx,Ex,hx,mx,lx,_b,Rj,sl,G6,we,Ge,Bb,V6,Qj,Qu,Kj,Ot,Yr,DC,Ub,Dg,Xf.forRoot()]})}return n})();var Jj=(()=>{class n{overlayContainer=f(qu);iconReg=f(C4);sanitizer=f(fr);settingsService=f($r);themeService=f(ci);router=f(ht);progressService=f(no);connectionManager=f(Tm);controllerService=f(Je);constructor(){this.iconReg.addSvgIcon("gns3",this.sanitizer.bypassSecurityTrustResourceUrl("./assets/gns3_icon.svg")),this.iconReg.addSvgIcon("gns3black",this.sanitizer.bypassSecurityTrustResourceUrl("./assets/gns3_icon_black.svg")),this.iconReg.addSvgIcon("github",this.sanitizer.bypassSecurityTrustResourceUrl("./assets/github-icon.svg")),this.router.events.subscribe(e=>{this.checkEvent(e)})}ngOnInit(){this.themeService.themeChanged.subscribe(e=>{this.applyTheme(e)}),this.router.events.pipe(ai(e=>e instanceof bp)).subscribe(e=>{this.checkAndEstablishConnection(e.url)})}async checkAndEstablishConnection(e){let t=e.match(/\/controller\/(\d+)/);if(!t)return;let o=parseInt(t[1],10);try{let r=await this.controllerService.get(o);r&&r.authToken&&this.connectionManager.establishConnection(r)}catch(r){console.error("Failed to check controller for auto-login:",r)}}applyTheme(e){let t=this.overlayContainer.getContainerElement().classList;t.remove("theme-deeppurple-amber","theme-indigo-pink","theme-magenta-violet","theme-rose-red","theme-pink-bluegrey","theme-purple-green","theme-azure-blue","theme-cyan-orange"),t.add(`theme-${e}`)}checkEvent(e){e instanceof f4?this.progressService.activate():(e instanceof bp||e instanceof g4||e instanceof _4)&&this.progressService.deactivate()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-root"]],hostAttrs:[1,"componentCssClass"],decls:2,vars:0,template:function(t,o){t&1&&R(0,"router-outlet")(1,"app-global-upload-indicator")},dependencies:[ne,dt,Ku,JM],styles:["[_nghost-%COMP%]{display:block;height:100%}mat-menu-panel[_ngcontent-%COMP%]{min-height:0px}"],changeDetection:0})}return n})();wi.production&&void 0;BO(Jj,{providers:[IO(),yO(Zj)]}).then(n=>{GO(n.components[0])}).catch(n=>console.log(n));